[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/3] X86: MPX support for PV guest



>>> On 11.11.13 at 09:39, "Liu, Jinsong" <jinsong.liu@xxxxxxxxx> wrote:
> From 56d4b02f595c75b3884b36e54c880ec7019680bc Mon Sep 17 00:00:00 2001
> From: Liu Jinsong <jinsong.liu@xxxxxxxxx>
> Date: Fri, 8 Nov 2013 01:40:59 +0800
> Subject: [PATCH 2/3] X86: MPX support for PV guest
> 
> Signed-off-by: Xudong Hao <xudong.hao@xxxxxxxxx>
> Acked-by: Liu Jinsong <jinsong.liu@xxxxxxxxx>
> 
> ---
>  tools/libxc/xc_cpuid_x86.c |    3 ++-
>  xen/arch/x86/traps.c       |    3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
> index bcb7a59..4c922a8 100644
> --- a/tools/libxc/xc_cpuid_x86.c
> +++ b/tools/libxc/xc_cpuid_x86.c
> @@ -504,7 +504,8 @@ static void xc_cpuid_pv_policy(
>                          bitmaskof(X86_FEATURE_BMI2) |
>                          bitmaskof(X86_FEATURE_ERMS) |
>                          bitmaskof(X86_FEATURE_RTM)  |
> -                        bitmaskof(X86_FEATURE_FSGSBASE));
> +                        bitmaskof(X86_FEATURE_FSGSBASE) |
> +                        bitmaskof(X86_FEATURE_MPX));
>          else
>              regs[1] = 0;
>          regs[0] = regs[2] = regs[3] = 0;
> diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
> index 77c200b..4ecf7d5 100644
> --- a/xen/arch/x86/traps.c
> +++ b/xen/arch/x86/traps.c
> @@ -826,7 +826,8 @@ static void pv_cpuid(struct cpu_user_regs *regs)
>                    cpufeat_mask(X86_FEATURE_BMI2) |
>                    cpufeat_mask(X86_FEATURE_ERMS) |
>                    cpufeat_mask(X86_FEATURE_RTM)  |
> -                  cpufeat_mask(X86_FEATURE_FSGSBASE));
> +                  cpufeat_mask(X86_FEATURE_FSGSBASE) |
> +                  cpufeat_mask(X86_FEATURE_MPX));
>          else
>              b = 0;
>          a = c = d = 0;

So here you purely mechanically enable the feature. But did you
consider how it would work? How is the MSR being handled? How
do you switch between (guest) kernel and user mode? And there's
no word about what would need to be done when Xen wanted to
use MPX for its own purposes too.

In the shape it is now, the above is a clear NAK.

Jan


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.