From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Luwei Kang <luwei.kang@intel.com>, xen-devel@lists.xen.org
Cc: chao.p.peng@intel.com, yong.y.wang@intel.com, jbeulich@suse.com
Subject: Re: [PATCH] x86/cpuid: AVX-512 Feature Detection
Date: Tue, 28 Jun 2016 09:46:37 +0100 [thread overview]
Message-ID: <6b4f73b4-7763-4f7c-ee19-a4e11fe045d6@citrix.com> (raw)
In-Reply-To: <1467093106-3444-1-git-send-email-luwei.kang@intel.com>
On 28/06/16 06:51, Luwei Kang wrote:
> @@ -1136,9 +1136,16 @@ void pv_cpuid(struct cpu_user_regs *regs)
> case XSTATE_CPUID:
>
> if ( !is_control_domain(currd) && !is_hardware_domain(currd) )
> + {
> domain_cpuid(currd, 1, 0, &tmp, &tmp, &_ecx, &tmp);
> + domain_cpuid(currd, 0x07, 0, &tmp, &_ebx, &tmp, &tmp);
> + }
> else
> + {
> _ecx = cpuid_ecx(1);
> + cpuid_count(0x07, 0, &tmp, &_ebx, &tmp, &tmp);
> + }
> +
In addition to Jan's comments, having _ecx from one leaf and _ebx from a
different leaf collected at the same time is liable to cause confusion.
Please split the cpuid call for leaf 7 out from here, and put it in the
next hunk, just like the way the hvm_cpuid() side works.
~Andrew
> _ecx &= pv_featureset[FEATURESET_1c];
>
> if ( !(_ecx & cpufeat_mask(X86_FEATURE_XSAVE)) || subleaf >= 63 )
> @@ -1157,6 +1164,14 @@ void pv_cpuid(struct cpu_user_regs *regs)
> xstate_sizes[_XSTATE_YMM]);
> }
>
> + if ( _ebx & cpufeat_mask(X86_FEATURE_AVX512F) )
> + {
> + xfeature_mask |= XSTATE_OPMASK | XSTATE_ZMM | XSTATE_HI_ZMM;
> + xstate_size = max(xstate_size,
> + xstate_offsets[_XSTATE_HI_ZMM] +
> + xstate_sizes[_XSTATE_HI_ZMM]);
> + }
> +
> a = (uint32_t)xfeature_mask;
> d = (uint32_t)(xfeature_mask >> 32);
> c = xstate_size;
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-06-28 8:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-28 5:51 [PATCH] x86/cpuid: AVX-512 Feature Detection Luwei Kang
2016-06-28 7:49 ` Jan Beulich
2016-06-28 8:10 ` Kang, Luwei
2016-06-28 8:46 ` Andrew Cooper [this message]
2016-06-28 8:51 ` Kang, Luwei
2016-06-29 1:57 Luwei Kang
2016-06-29 9:21 ` Jan Beulich
2016-06-29 2:20 Luwei Kang
2016-06-29 9:50 ` Andrew Cooper
2016-06-29 9:53 ` Andrew Cooper
2016-06-29 10:03 ` Jan Beulich
2016-06-29 11:37 ` Andrew Cooper
2016-06-29 14:13 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6b4f73b4-7763-4f7c-ee19-a4e11fe045d6@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=chao.p.peng@intel.com \
--cc=jbeulich@suse.com \
--cc=luwei.kang@intel.com \
--cc=xen-devel@lists.xen.org \
--cc=yong.y.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).