* [PATCH 3/3 v2] XSAVE/XRSTOR: enable guest AVX
@ 2010-08-31 14:52 Han, Weidong
2010-09-01 14:00 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 4+ messages in thread
From: Han, Weidong @ 2010-08-31 14:52 UTC (permalink / raw)
To: Xen-devel; +Cc: Keir Fraser, Jan Beulich
[-- Attachment #1: Type: text/plain, Size: 126 bytes --]
This patch enables Intel(R) Advanced Vector Extension (AVX) for guest.
Signed-off-by: Weidong Han <weidong.han@intel.com>
[-- Attachment #2: guest-avx.patch --]
[-- Type: application/octet-stream, Size: 1228 bytes --]
diff -r fc6e0522a6a7 tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h Fri Aug 27 08:00:07 2010 -0400
+++ b/tools/libxc/xc_cpufeature.h Fri Aug 27 08:01:13 2010 -0400
@@ -101,6 +101,7 @@
#define X86_FEATURE_POPCNT (4*32+23) /* POPCNT instruction */
#define X86_FEATURE_AES (4*32+25) /* AES acceleration instructions */
#define X86_FEATURE_XSAVE (4*32+26) /* XSAVE/XRSTOR/XSETBV/XGETBV */
+#define X86_FEATURE_AVX (4*32+28) /* Advanced Vector Extensions */
#define X86_FEATURE_HYPERVISOR (4*32+31) /* Running under some hypervisor */
/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
diff -r fc6e0522a6a7 tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c Fri Aug 27 08:00:07 2010 -0400
+++ b/tools/libxc/xc_cpuid_x86.c Fri Aug 27 08:01:13 2010 -0400
@@ -195,7 +195,8 @@ static void xc_cpuid_hvm_policy(
bitmaskof(X86_FEATURE_SSE4_1) |
bitmaskof(X86_FEATURE_SSE4_2) |
bitmaskof(X86_FEATURE_POPCNT) |
- bitmaskof(X86_FEATURE_AES));
+ bitmaskof(X86_FEATURE_AES) |
+ bitmaskof(X86_FEATURE_AVX));
regs[2] |= bitmaskof(X86_FEATURE_HYPERVISOR);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 3/3 v2] XSAVE/XRSTOR: enable guest AVX
2010-08-31 14:52 [PATCH 3/3 v2] XSAVE/XRSTOR: enable guest AVX Han, Weidong
@ 2010-09-01 14:00 ` Konrad Rzeszutek Wilk
2010-09-01 14:22 ` Li, Xin
0 siblings, 1 reply; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-09-01 14:00 UTC (permalink / raw)
To: Han, Weidong; +Cc: Xen-devel, Keir Fraser, Jan Beulich
On Tue, Aug 31, 2010 at 10:52:38PM +0800, Han, Weidong wrote:
> This patch enables Intel(R) Advanced Vector Extension (AVX) for guest.
I thought that this would also work on the AMD Bulldozer's CPUs? Or is the
Intel AVX incompatible with AMD AVX?
>
> Signed-off-by: Weidong Han <weidong.han@intel.com>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 3/3 v2] XSAVE/XRSTOR: enable guest AVX
2010-09-01 14:00 ` Konrad Rzeszutek Wilk
@ 2010-09-01 14:22 ` Li, Xin
2010-09-01 16:27 ` Huang2, Wei
0 siblings, 1 reply; 4+ messages in thread
From: Li, Xin @ 2010-09-01 14:22 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, Han, Weidong; +Cc: Xen-devel, Keir Fraser, Jan Beulich
> On Tue, Aug 31, 2010 at 10:52:38PM +0800, Han, Weidong wrote:
> > This patch enables Intel(R) Advanced Vector Extension (AVX) for guest.
>
> I thought that this would also work on the AMD Bulldozer's CPUs? Or is the
> Intel AVX incompatible with AMD AVX?
The code just checks if a feature is available thru CPUID before using, no matter it's Intel CPU or AMD.
There are 2 approaches to provide a new feature, use a compatible way the other side is using thus reuse the code/binary, or a complete new way. There are many examples you can find in Linux/Xen code.
AMD people can comment if they will implement the AVX like feature. If yes, if it's in a software compatible way or totally new.
Thanks!
-Xin
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 3/3 v2] XSAVE/XRSTOR: enable guest AVX
2010-09-01 14:22 ` Li, Xin
@ 2010-09-01 16:27 ` Huang2, Wei
0 siblings, 0 replies; 4+ messages in thread
From: Huang2, Wei @ 2010-09-01 16:27 UTC (permalink / raw)
To: Li, Xin, Konrad Rzeszutek Wilk, Han, Weidong
Cc: Xen-devel, Keir Fraser, Jan Beulich
The AVX feature bit is compatible between Intel and AMD. AMD has another XSAVE/XRSTOR related feature (light-weight profiling) to be added in Xen. We are going to provide patches when they are ready.
-Wei
-----Original Message-----
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Li, Xin
Sent: Wednesday, September 01, 2010 9:23 AM
To: Konrad Rzeszutek Wilk; Han, Weidong
Cc: Xen-devel; Keir Fraser; Jan Beulich
Subject: RE: [Xen-devel] [PATCH 3/3 v2] XSAVE/XRSTOR: enable guest AVX
> On Tue, Aug 31, 2010 at 10:52:38PM +0800, Han, Weidong wrote:
> > This patch enables Intel(R) Advanced Vector Extension (AVX) for guest.
>
> I thought that this would also work on the AMD Bulldozer's CPUs? Or is the
> Intel AVX incompatible with AMD AVX?
The code just checks if a feature is available thru CPUID before using, no matter it's Intel CPU or AMD.
There are 2 approaches to provide a new feature, use a compatible way the other side is using thus reuse the code/binary, or a complete new way. There are many examples you can find in Linux/Xen code.
AMD people can comment if they will implement the AVX like feature. If yes, if it's in a software compatible way or totally new.
Thanks!
-Xin
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-01 16:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-31 14:52 [PATCH 3/3 v2] XSAVE/XRSTOR: enable guest AVX Han, Weidong
2010-09-01 14:00 ` Konrad Rzeszutek Wilk
2010-09-01 14:22 ` Li, Xin
2010-09-01 16:27 ` Huang2, Wei
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.