All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxc: Expose the MPX cpuid flag to guest
@ 2016-01-11  8:52 Liang Li
  2016-01-11  9:05 ` Wei Liu
  2016-01-11 16:03 ` Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 9+ messages in thread
From: Liang Li @ 2016-01-11  8:52 UTC (permalink / raw)
  To: xen-devel
  Cc: wei.liu2, ian.campbell, stefano.stabellini, Liang Li,
	ian.jackson, jbeulich

If hardware support memory protect externsion, expose this feature
to guest by default. Users don't have to use a 'cpuid= ' option in
config file to turn it on.

Signed-off-by: Liang Li <liang.z.li@intel.com>
---
 tools/libxc/xc_cpufeature.h | 1 +
 tools/libxc/xc_cpuid_x86.c  | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h
index c3ddc80..cda9305 100644
--- a/tools/libxc/xc_cpufeature.h
+++ b/tools/libxc/xc_cpufeature.h
@@ -137,6 +137,7 @@
 #define X86_FEATURE_ERMS         9 /* Enhanced REP MOVSB/STOSB */
 #define X86_FEATURE_INVPCID     10 /* Invalidate Process Context ID */
 #define X86_FEATURE_RTM         11 /* Restricted Transactional Memory */
+#define X86_FEATURE_MPX         14 /* Memory Protection Extensions */
 #define X86_FEATURE_RDSEED      18 /* RDSEED instruction */
 #define X86_FEATURE_ADX         19 /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP        20 /* Supervisor Mode Access Protection */
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index 8882c01..4c88db4 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -423,6 +423,8 @@ static void xc_cpuid_hvm_policy(xc_interface *xch,
                         bitmaskof(X86_FEATURE_ERMS) |
                         bitmaskof(X86_FEATURE_INVPCID) |
                         bitmaskof(X86_FEATURE_RTM)  |
+                        ((info->xfeature_mask != 0) ?
+                        bitmaskof(X86_FEATURE_MPX) : 0)  |
                         bitmaskof(X86_FEATURE_RDSEED)  |
                         bitmaskof(X86_FEATURE_ADX)  |
                         bitmaskof(X86_FEATURE_SMAP) |
@@ -538,6 +540,7 @@ static void xc_cpuid_pv_policy(xc_interface *xch,
 
     case 0x00000007:
         if ( input[1] == 0 )
+        {
             regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
                         bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
@@ -547,6 +550,9 @@ static void xc_cpuid_pv_policy(xc_interface *xch,
                         bitmaskof(X86_FEATURE_RDSEED)  |
                         bitmaskof(X86_FEATURE_ADX)  |
                         bitmaskof(X86_FEATURE_FSGSBASE));
+            if ( info->xfeature_mask == 0 )
+                clear_bit(X86_FEATURE_MPX, regs[1]);
+        }
         else
             regs[1] = 0;
         regs[0] = regs[2] = regs[3] = 0;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxc: Expose the MPX cpuid flag to guest
  2016-01-11  8:52 [PATCH] libxc: Expose the MPX cpuid flag to guest Liang Li
@ 2016-01-11  9:05 ` Wei Liu
  2016-01-11  9:59   ` Andrew Cooper
  2016-01-11 16:03 ` Konrad Rzeszutek Wilk
  1 sibling, 1 reply; 9+ messages in thread
From: Wei Liu @ 2016-01-11  9:05 UTC (permalink / raw)
  To: Liang Li
  Cc: wei.liu2, ian.campbell, stefano.stabellini, ian.jackson,
	xen-devel, jbeulich

On Mon, Jan 11, 2016 at 04:52:10PM +0800, Liang Li wrote:
> If hardware support memory protect externsion, expose this feature
> to guest by default. Users don't have to use a 'cpuid= ' option in
> config file to turn it on.
> 
> Signed-off-by: Liang Li <liang.z.li@intel.com>

I will defer this to the x86 maintainers.

Wei.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxc: Expose the MPX cpuid flag to guest
  2016-01-11  9:05 ` Wei Liu
@ 2016-01-11  9:59   ` Andrew Cooper
  2016-01-11 10:07     ` Li, Liang Z
  2016-02-23  8:57     ` Li, Liang Z
  0 siblings, 2 replies; 9+ messages in thread
From: Andrew Cooper @ 2016-01-11  9:59 UTC (permalink / raw)
  To: Wei Liu, Liang Li
  Cc: xen-devel, ian.jackson, ian.campbell, jbeulich, stefano.stabellini

On 11/01/16 09:05, Wei Liu wrote:
> On Mon, Jan 11, 2016 at 04:52:10PM +0800, Liang Li wrote:
>> If hardware support memory protect externsion, expose this feature
>> to guest by default. Users don't have to use a 'cpuid= ' option in
>> config file to turn it on.
>>
>> Signed-off-by: Liang Li <liang.z.li@intel.com>
> I will defer this to the x86 maintainers.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Looks like the hypervisor side is all present.

~Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxc: Expose the MPX cpuid flag to guest
  2016-01-11  9:59   ` Andrew Cooper
@ 2016-01-11 10:07     ` Li, Liang Z
  2016-02-23  8:57     ` Li, Liang Z
  1 sibling, 0 replies; 9+ messages in thread
From: Li, Liang Z @ 2016-01-11 10:07 UTC (permalink / raw)
  To: Andrew Cooper, Wei Liu
  Cc: xen-devel, ian.jackson, ian.campbell, jbeulich, stefano.stabellini

> On 11/01/16 09:05, Wei Liu wrote:
> > On Mon, Jan 11, 2016 at 04:52:10PM +0800, Liang Li wrote:
> >> If hardware support memory protect extension, expose this feature to
> >> guest by default. Users don't have to use a 'cpuid= ' option in
> >> config file to turn it on.
> >>
> >> Signed-off-by: Liang Li <liang.z.li@intel.com>
> > I will defer this to the x86 maintainers.
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Looks like the hypervisor side is all present.
> 

Yes,  Thanks for reviewing.

Liang

> ~Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxc: Expose the MPX cpuid flag to guest
  2016-01-11  8:52 [PATCH] libxc: Expose the MPX cpuid flag to guest Liang Li
  2016-01-11  9:05 ` Wei Liu
@ 2016-01-11 16:03 ` Konrad Rzeszutek Wilk
  2016-01-20  9:20   ` Li, Liang Z
  1 sibling, 1 reply; 9+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-01-11 16:03 UTC (permalink / raw)
  To: Liang Li
  Cc: wei.liu2, ian.campbell, stefano.stabellini, ian.jackson,
	xen-devel, jbeulich

On Mon, Jan 11, 2016 at 04:52:10PM +0800, Liang Li wrote:
> If hardware support memory protect externsion, expose this feature

extension
> to guest by default. Users don't have to use a 'cpuid= ' option in
> config file to turn it on.
> 
> Signed-off-by: Liang Li <liang.z.li@intel.com>
> ---
>  tools/libxc/xc_cpufeature.h | 1 +
>  tools/libxc/xc_cpuid_x86.c  | 6 ++++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h
> index c3ddc80..cda9305 100644
> --- a/tools/libxc/xc_cpufeature.h
> +++ b/tools/libxc/xc_cpufeature.h
> @@ -137,6 +137,7 @@
>  #define X86_FEATURE_ERMS         9 /* Enhanced REP MOVSB/STOSB */
>  #define X86_FEATURE_INVPCID     10 /* Invalidate Process Context ID */
>  #define X86_FEATURE_RTM         11 /* Restricted Transactional Memory */
> +#define X86_FEATURE_MPX         14 /* Memory Protection Extensions */
>  #define X86_FEATURE_RDSEED      18 /* RDSEED instruction */
>  #define X86_FEATURE_ADX         19 /* ADCX, ADOX instructions */
>  #define X86_FEATURE_SMAP        20 /* Supervisor Mode Access Protection */
> diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
> index 8882c01..4c88db4 100644
> --- a/tools/libxc/xc_cpuid_x86.c
> +++ b/tools/libxc/xc_cpuid_x86.c
> @@ -423,6 +423,8 @@ static void xc_cpuid_hvm_policy(xc_interface *xch,
>                          bitmaskof(X86_FEATURE_ERMS) |
>                          bitmaskof(X86_FEATURE_INVPCID) |
>                          bitmaskof(X86_FEATURE_RTM)  |
> +                        ((info->xfeature_mask != 0) ?
> +                        bitmaskof(X86_FEATURE_MPX) : 0)  |
>                          bitmaskof(X86_FEATURE_RDSEED)  |
>                          bitmaskof(X86_FEATURE_ADX)  |
>                          bitmaskof(X86_FEATURE_SMAP) |
> @@ -538,6 +540,7 @@ static void xc_cpuid_pv_policy(xc_interface *xch,
>  
>      case 0x00000007:
>          if ( input[1] == 0 )
> +        {
>              regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
>                          bitmaskof(X86_FEATURE_HLE)  |
>                          bitmaskof(X86_FEATURE_AVX2) |
> @@ -547,6 +550,9 @@ static void xc_cpuid_pv_policy(xc_interface *xch,
>                          bitmaskof(X86_FEATURE_RDSEED)  |
>                          bitmaskof(X86_FEATURE_ADX)  |
>                          bitmaskof(X86_FEATURE_FSGSBASE));
> +            if ( info->xfeature_mask == 0 )
> +                clear_bit(X86_FEATURE_MPX, regs[1]);
> +        }
>          else
>              regs[1] = 0;
>          regs[0] = regs[2] = regs[3] = 0;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxc: Expose the MPX cpuid flag to guest
  2016-01-11 16:03 ` Konrad Rzeszutek Wilk
@ 2016-01-20  9:20   ` Li, Liang Z
  2016-03-01 18:02     ` Ian Jackson
  0 siblings, 1 reply; 9+ messages in thread
From: Li, Liang Z @ 2016-01-20  9:20 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: wei.liu2, ian.campbell, stefano.stabellini, ian.jackson,
	xen-devel, jbeulich

> Cc: wei.liu2@citrix.com; ian.campbell@citrix.com;
> stefano.stabellini@eu.citrix.com; ian.jackson@eu.citrix.com; xen-
> devel@lists.xen.org; jbeulich@suse.com
> Subject: Re: [Xen-devel] [PATCH] libxc: Expose the MPX cpuid flag to guest
> 
> On Mon, Jan 11, 2016 at 04:52:10PM +0800, Liang Li wrote:
> > If hardware support memory protect externsion, expose this feature
> 
> extension

Thanks!

Liang

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxc: Expose the MPX cpuid flag to guest
  2016-01-11  9:59   ` Andrew Cooper
  2016-01-11 10:07     ` Li, Liang Z
@ 2016-02-23  8:57     ` Li, Liang Z
  2016-02-29 17:10       ` Doug Goldstein
  1 sibling, 1 reply; 9+ messages in thread
From: Li, Liang Z @ 2016-02-23  8:57 UTC (permalink / raw)
  To: Andrew Cooper, Wei Liu
  Cc: xen-devel, ian.jackson, ian.campbell, jbeulich, stefano.stabellini

> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> Sent: Monday, January 11, 2016 5:59 PM
> To: Wei Liu; Li, Liang Z
> Cc: ian.campbell@citrix.com; stefano.stabellini@eu.citrix.com;
> ian.jackson@eu.citrix.com; xen-devel@lists.xen.org; jbeulich@suse.com
> Subject: Re: [Xen-devel] [PATCH] libxc: Expose the MPX cpuid flag to guest
> 
> On 11/01/16 09:05, Wei Liu wrote:
> > On Mon, Jan 11, 2016 at 04:52:10PM +0800, Liang Li wrote:
> >> If hardware support memory protect externsion, expose this feature to
> >> guest by default. Users don't have to use a 'cpuid= ' option in
> >> config file to turn it on.
> >>
> >> Signed-off-by: Liang Li <liang.z.li@intel.com>
> > I will defer this to the x86 maintainers.
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Looks like the hypervisor side is all present.
> 
> ~Andrew

Is there anyone who can help to make this patch merged? It's pending for a long time.

Liang

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxc: Expose the MPX cpuid flag to guest
  2016-02-23  8:57     ` Li, Liang Z
@ 2016-02-29 17:10       ` Doug Goldstein
  0 siblings, 0 replies; 9+ messages in thread
From: Doug Goldstein @ 2016-02-29 17:10 UTC (permalink / raw)
  To: Li, Liang Z, Andrew Cooper, Wei Liu
  Cc: stefano.stabellini, ian.jackson, ian.campbell, jbeulich, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1116 bytes --]

On 2/23/16 2:57 AM, Li, Liang Z wrote:
>> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
>> Sent: Monday, January 11, 2016 5:59 PM
>> To: Wei Liu; Li, Liang Z
>> Cc: ian.campbell@citrix.com; stefano.stabellini@eu.citrix.com;
>> ian.jackson@eu.citrix.com; xen-devel@lists.xen.org; jbeulich@suse.com
>> Subject: Re: [Xen-devel] [PATCH] libxc: Expose the MPX cpuid flag to guest
>>
>> On 11/01/16 09:05, Wei Liu wrote:
>>> On Mon, Jan 11, 2016 at 04:52:10PM +0800, Liang Li wrote:
>>>> If hardware support memory protect externsion, expose this feature to
>>>> guest by default. Users don't have to use a 'cpuid= ' option in
>>>> config file to turn it on.
>>>>
>>>> Signed-off-by: Liang Li <liang.z.li@intel.com>
>>> I will defer this to the x86 maintainers.
>>
>> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> Looks like the hypervisor side is all present.
>>
>> ~Andrew
> 
> Is there anyone who can help to make this patch merged? It's pending for a long time.
> 
> Liang
> 

Ping on the behalf of Liang. This patch still applies cleanly.

-- 
Doug Goldstein


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 959 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxc: Expose the MPX cpuid flag to guest
  2016-01-20  9:20   ` Li, Liang Z
@ 2016-03-01 18:02     ` Ian Jackson
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Jackson @ 2016-03-01 18:02 UTC (permalink / raw)
  To: Li, Liang Z; +Cc: xen-devel, stefano.stabellini, wei.liu2, jbeulich

Li, Liang Z writes ("RE: [Xen-devel] [PATCH] libxc: Expose the MPX cpuid flag to guest"):
> > Cc: wei.liu2@citrix.com; ian.campbell@citrix.com;
> > stefano.stabellini@eu.citrix.com; ian.jackson@eu.citrix.com; xen-
> > devel@lists.xen.org; jbeulich@suse.com
> > Subject: Re: [Xen-devel] [PATCH] libxc: Expose the MPX cpuid flag to guest
> > 
> > On Mon, Jan 11, 2016 at 04:52:10PM +0800, Liang Li wrote:
> > > If hardware support memory protect externsion, expose this feature
> > 
> > extension
> 
> Thanks!

Sorry for the delay.  I have queued this patch and assuming that my
build test passes it will be pushed shortly.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-03-01 18:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-11  8:52 [PATCH] libxc: Expose the MPX cpuid flag to guest Liang Li
2016-01-11  9:05 ` Wei Liu
2016-01-11  9:59   ` Andrew Cooper
2016-01-11 10:07     ` Li, Liang Z
2016-02-23  8:57     ` Li, Liang Z
2016-02-29 17:10       ` Doug Goldstein
2016-01-11 16:03 ` Konrad Rzeszutek Wilk
2016-01-20  9:20   ` Li, Liang Z
2016-03-01 18:02     ` Ian Jackson

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.