* [PATCH] tools/libxc: Add xstate cpuid leaf of avx512
@ 2016-11-04 8:29 Luwei Kang
2016-11-04 10:20 ` Andrew Cooper
2016-11-04 10:57 ` Wei Liu
0 siblings, 2 replies; 6+ messages in thread
From: Luwei Kang @ 2016-11-04 8:29 UTC (permalink / raw)
To: xen-devel; +Cc: wei.liu2, ian.jackson, Luwei Kang
Enable get xstate cpuid leaf information regarding avx512 in guest.
Signed-off-by: Luwei Kang <luwei.kang@intel.com>
---
tools/libxc/xc_cpuid_x86.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index de06b32..d761805 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -406,6 +406,9 @@ static void intel_xc_cpuid_policy(xc_interface *xch,
#define X86_XCR0_AVX (1ULL << 2)
#define X86_XCR0_BNDREG (1ULL << 3)
#define X86_XCR0_BNDCSR (1ULL << 4)
+#define X86_XCR0_OPMASK (1ULL << 5)
+#define X86_XCR0_ZMM (1ULL << 6)
+#define X86_XCR0_HI_ZMM (1ULL << 7)
#define X86_XCR0_PKRU (1ULL << 9)
#define X86_XCR0_LWP (1ULL << 62)
@@ -437,6 +440,9 @@ static void xc_cpuid_config_xsave(xc_interface *xch,
if ( test_bit(X86_FEATURE_MPX, info->featureset) )
guest_xfeature_mask |= X86_XCR0_BNDREG | X86_XCR0_BNDCSR;
+ if ( test_bit(X86_FEATURE_AVX512F, info->featureset) )
+ guest_xfeature_mask |= X86_XCR0_OPMASK | X86_XCR0_ZMM | X86_XCR0_HI_ZMM;
+
if ( test_bit(X86_FEATURE_PKU, info->featureset) )
guest_xfeature_mask |= X86_XCR0_PKRU;
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] tools/libxc: Add xstate cpuid leaf of avx512
2016-11-04 8:29 [PATCH] tools/libxc: Add xstate cpuid leaf of avx512 Luwei Kang
@ 2016-11-04 10:20 ` Andrew Cooper
2016-11-04 11:00 ` Wei Liu
2016-11-04 10:57 ` Wei Liu
1 sibling, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2016-11-04 10:20 UTC (permalink / raw)
To: Luwei Kang, xen-devel; +Cc: ian.jackson, wei.liu2
On 04/11/16 08:29, Luwei Kang wrote:
> Enable get xstate cpuid leaf information regarding avx512 in guest.
>
> Signed-off-by: Luwei Kang <luwei.kang@intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> tools/libxc/xc_cpuid_x86.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
> index de06b32..d761805 100644
> --- a/tools/libxc/xc_cpuid_x86.c
> +++ b/tools/libxc/xc_cpuid_x86.c
> @@ -406,6 +406,9 @@ static void intel_xc_cpuid_policy(xc_interface *xch,
> #define X86_XCR0_AVX (1ULL << 2)
> #define X86_XCR0_BNDREG (1ULL << 3)
> #define X86_XCR0_BNDCSR (1ULL << 4)
> +#define X86_XCR0_OPMASK (1ULL << 5)
> +#define X86_XCR0_ZMM (1ULL << 6)
> +#define X86_XCR0_HI_ZMM (1ULL << 7)
> #define X86_XCR0_PKRU (1ULL << 9)
> #define X86_XCR0_LWP (1ULL << 62)
>
> @@ -437,6 +440,9 @@ static void xc_cpuid_config_xsave(xc_interface *xch,
> if ( test_bit(X86_FEATURE_MPX, info->featureset) )
> guest_xfeature_mask |= X86_XCR0_BNDREG | X86_XCR0_BNDCSR;
>
> + if ( test_bit(X86_FEATURE_AVX512F, info->featureset) )
> + guest_xfeature_mask |= X86_XCR0_OPMASK | X86_XCR0_ZMM | X86_XCR0_HI_ZMM;
> +
> if ( test_bit(X86_FEATURE_PKU, info->featureset) )
> guest_xfeature_mask |= X86_XCR0_PKRU;
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tools/libxc: Add xstate cpuid leaf of avx512
2016-11-04 8:29 [PATCH] tools/libxc: Add xstate cpuid leaf of avx512 Luwei Kang
2016-11-04 10:20 ` Andrew Cooper
@ 2016-11-04 10:57 ` Wei Liu
1 sibling, 0 replies; 6+ messages in thread
From: Wei Liu @ 2016-11-04 10:57 UTC (permalink / raw)
To: Luwei Kang; +Cc: wei.liu2, Andrew Cooper, ian.jackson, Jan Beulich, xen-devel
CC x86 maintainers. I will defer this patch to them.
On Fri, Nov 04, 2016 at 04:29:18PM +0800, Luwei Kang wrote:
> Enable get xstate cpuid leaf information regarding avx512 in guest.
>
> Signed-off-by: Luwei Kang <luwei.kang@intel.com>
> ---
> tools/libxc/xc_cpuid_x86.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
> index de06b32..d761805 100644
> --- a/tools/libxc/xc_cpuid_x86.c
> +++ b/tools/libxc/xc_cpuid_x86.c
> @@ -406,6 +406,9 @@ static void intel_xc_cpuid_policy(xc_interface *xch,
> #define X86_XCR0_AVX (1ULL << 2)
> #define X86_XCR0_BNDREG (1ULL << 3)
> #define X86_XCR0_BNDCSR (1ULL << 4)
> +#define X86_XCR0_OPMASK (1ULL << 5)
> +#define X86_XCR0_ZMM (1ULL << 6)
> +#define X86_XCR0_HI_ZMM (1ULL << 7)
> #define X86_XCR0_PKRU (1ULL << 9)
> #define X86_XCR0_LWP (1ULL << 62)
>
> @@ -437,6 +440,9 @@ static void xc_cpuid_config_xsave(xc_interface *xch,
> if ( test_bit(X86_FEATURE_MPX, info->featureset) )
> guest_xfeature_mask |= X86_XCR0_BNDREG | X86_XCR0_BNDCSR;
>
> + if ( test_bit(X86_FEATURE_AVX512F, info->featureset) )
> + guest_xfeature_mask |= X86_XCR0_OPMASK | X86_XCR0_ZMM | X86_XCR0_HI_ZMM;
> +
> if ( test_bit(X86_FEATURE_PKU, info->featureset) )
> guest_xfeature_mask |= X86_XCR0_PKRU;
>
> --
> 2.7.4
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tools/libxc: Add xstate cpuid leaf of avx512
2016-11-04 10:20 ` Andrew Cooper
@ 2016-11-04 11:00 ` Wei Liu
2016-11-04 13:40 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 6+ messages in thread
From: Wei Liu @ 2016-11-04 11:00 UTC (permalink / raw)
To: Andrew Cooper; +Cc: wei.liu2, Luwei Kang, ian.jackson, xen-devel
On Fri, Nov 04, 2016 at 10:20:24AM +0000, Andrew Cooper wrote:
> On 04/11/16 08:29, Luwei Kang wrote:
> > Enable get xstate cpuid leaf information regarding avx512 in guest.
> >
> > Signed-off-by: Luwei Kang <luwei.kang@intel.com>
>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
Oops, should have read all the entire thread.
I think we can sneak this in for 4.8 if we have some free cycles,
otherwise I will queue it up for -next.
> > ---
> > tools/libxc/xc_cpuid_x86.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
> > index de06b32..d761805 100644
> > --- a/tools/libxc/xc_cpuid_x86.c
> > +++ b/tools/libxc/xc_cpuid_x86.c
> > @@ -406,6 +406,9 @@ static void intel_xc_cpuid_policy(xc_interface *xch,
> > #define X86_XCR0_AVX (1ULL << 2)
> > #define X86_XCR0_BNDREG (1ULL << 3)
> > #define X86_XCR0_BNDCSR (1ULL << 4)
> > +#define X86_XCR0_OPMASK (1ULL << 5)
> > +#define X86_XCR0_ZMM (1ULL << 6)
> > +#define X86_XCR0_HI_ZMM (1ULL << 7)
> > #define X86_XCR0_PKRU (1ULL << 9)
> > #define X86_XCR0_LWP (1ULL << 62)
> >
> > @@ -437,6 +440,9 @@ static void xc_cpuid_config_xsave(xc_interface *xch,
> > if ( test_bit(X86_FEATURE_MPX, info->featureset) )
> > guest_xfeature_mask |= X86_XCR0_BNDREG | X86_XCR0_BNDCSR;
> >
> > + if ( test_bit(X86_FEATURE_AVX512F, info->featureset) )
> > + guest_xfeature_mask |= X86_XCR0_OPMASK | X86_XCR0_ZMM | X86_XCR0_HI_ZMM;
> > +
> > if ( test_bit(X86_FEATURE_PKU, info->featureset) )
> > guest_xfeature_mask |= X86_XCR0_PKRU;
> >
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tools/libxc: Add xstate cpuid leaf of avx512
2016-11-04 11:00 ` Wei Liu
@ 2016-11-04 13:40 ` Konrad Rzeszutek Wilk
2016-11-04 14:24 ` Wei Liu
0 siblings, 1 reply; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-11-04 13:40 UTC (permalink / raw)
To: Wei Liu; +Cc: Andrew Cooper, Luwei Kang, ian.jackson, xen-devel
On Fri, Nov 04, 2016 at 11:00:16AM +0000, Wei Liu wrote:
> On Fri, Nov 04, 2016 at 10:20:24AM +0000, Andrew Cooper wrote:
> > On 04/11/16 08:29, Luwei Kang wrote:
> > > Enable get xstate cpuid leaf information regarding avx512 in guest.
> > >
> > > Signed-off-by: Luwei Kang <luwei.kang@intel.com>
> >
> > Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >
>
> Oops, should have read all the entire thread.
>
> I think we can sneak this in for 4.8 if we have some free cycles,
> otherwise I will queue it up for -next.
It would be good to get it in as it provides some nice performance
benefits for guests.
>
> > > ---
> > > tools/libxc/xc_cpuid_x86.c | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> > >
> > > diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
> > > index de06b32..d761805 100644
> > > --- a/tools/libxc/xc_cpuid_x86.c
> > > +++ b/tools/libxc/xc_cpuid_x86.c
> > > @@ -406,6 +406,9 @@ static void intel_xc_cpuid_policy(xc_interface *xch,
> > > #define X86_XCR0_AVX (1ULL << 2)
> > > #define X86_XCR0_BNDREG (1ULL << 3)
> > > #define X86_XCR0_BNDCSR (1ULL << 4)
> > > +#define X86_XCR0_OPMASK (1ULL << 5)
> > > +#define X86_XCR0_ZMM (1ULL << 6)
> > > +#define X86_XCR0_HI_ZMM (1ULL << 7)
> > > #define X86_XCR0_PKRU (1ULL << 9)
> > > #define X86_XCR0_LWP (1ULL << 62)
> > >
> > > @@ -437,6 +440,9 @@ static void xc_cpuid_config_xsave(xc_interface *xch,
> > > if ( test_bit(X86_FEATURE_MPX, info->featureset) )
> > > guest_xfeature_mask |= X86_XCR0_BNDREG | X86_XCR0_BNDCSR;
> > >
> > > + if ( test_bit(X86_FEATURE_AVX512F, info->featureset) )
> > > + guest_xfeature_mask |= X86_XCR0_OPMASK | X86_XCR0_ZMM | X86_XCR0_HI_ZMM;
> > > +
> > > if ( test_bit(X86_FEATURE_PKU, info->featureset) )
> > > guest_xfeature_mask |= X86_XCR0_PKRU;
> > >
> >
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tools/libxc: Add xstate cpuid leaf of avx512
2016-11-04 13:40 ` Konrad Rzeszutek Wilk
@ 2016-11-04 14:24 ` Wei Liu
0 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2016-11-04 14:24 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Andrew Cooper, Wei Liu, ian.jackson, Luwei Kang, xen-devel
On Fri, Nov 04, 2016 at 09:40:20AM -0400, Konrad Rzeszutek Wilk wrote:
> On Fri, Nov 04, 2016 at 11:00:16AM +0000, Wei Liu wrote:
> > On Fri, Nov 04, 2016 at 10:20:24AM +0000, Andrew Cooper wrote:
> > > On 04/11/16 08:29, Luwei Kang wrote:
> > > > Enable get xstate cpuid leaf information regarding avx512 in guest.
> > > >
> > > > Signed-off-by: Luwei Kang <luwei.kang@intel.com>
> > >
> > > Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > >
> >
> > Oops, should have read all the entire thread.
> >
> > I think we can sneak this in for 4.8 if we have some free cycles,
> > otherwise I will queue it up for -next.
>
> It would be good to get it in as it provides some nice performance
> benefits for guests.
>
Given that the queue is empty at the moment, I've pushed this patch.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-11-04 14:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 8:29 [PATCH] tools/libxc: Add xstate cpuid leaf of avx512 Luwei Kang
2016-11-04 10:20 ` Andrew Cooper
2016-11-04 11:00 ` Wei Liu
2016-11-04 13:40 ` Konrad Rzeszutek Wilk
2016-11-04 14:24 ` Wei Liu
2016-11-04 10:57 ` Wei Liu
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).