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

Re: [Xen-devel] [PATCH RFC 05/14] xen: vmx: Disable the 2M/1G superpage when SPP enabled



On 2017-10-24 at 11:43:45 -0600, Tamas K Lengyel wrote:
> On Fri, Oct 20, 2017 at 2:44 AM, Yi Zhang <yi.z.zhang@xxxxxxxxxxxxxxx> wrote:
> > On 2017-10-19 at 12:17:12 -0600, Tamas K Lengyel wrote:
> >> On Thu, Oct 19, 2017 at 2:11 AM, Zhang Yi <yi.z.zhang@xxxxxxxxxxxxxxx> 
> >> wrote:
> >> > From: Zhang Yi Z <yi.z.zhang@xxxxxxxxxxxxxxx>
> >> >
> >> > Current we only support Sub-page Protection on the 4k
> >> > page table.
> >> >
> >> > Signed-off-by: Zhang Yi Z <yi.z.zhang@xxxxxxxxxxxxxxx>
> >> > ---
> >> >  xen/arch/x86/hvm/vmx/vmx.c | 6 ++++++
> >> >  1 file changed, 6 insertions(+)
> >> >
> >> > diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
> >> > index 04ae0d6..a4c24bb 100644
> >> > --- a/xen/arch/x86/hvm/vmx/vmx.c
> >> > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> >> > @@ -2497,6 +2497,12 @@ const struct hvm_function_table * __init 
> >> > start_vmx(void)
> >> >          vmx_function_table.get_guest_bndcfgs = vmx_get_guest_bndcfgs;
> >> >      }
> >> >
> >> > +    if ( cpu_has_vmx_ept_spp )
> >>
> >> I think this really only ought to happen if the command-line option
> >> has also been enabled.
> >
> > Sorry, didn't catch your point, the command line option opt_hap_2m and
> > opt_hap_1G was enable by default, I need to  disable the supper page
> > when spp feature enabled. Did you mean that if we enable 2M/1G by
> > command-line we couldn't disable it here? yes, it is, I will improve
> > this logic. Thank you Tamas.
> 
> I meant that right now "cpu_has_vmx_ept_spp" looks like just checks
> whether the CPU supports SPP, not whether the command-line option was
> set to enable it. If the command line option is not set (or
> specifically disables SPP) then the large pages shouldn't get
> disabled.
> 

In patch 02/14, if we didn't set spp_enable, we will not set the spp cap 
in vmx_secondary_exec_control, so cp_has_vmx_ept_spp flag will set when 
hardware has spp cap and xen cmdlline passed the parameter "spp_enable=1"

> >
> >>
> >> > +    {
> >> > +        vmx_function_table.hap_capabilities &= ~HVM_HAP_SUPERPAGE_2MB;
> >> > +        vmx_function_table.hap_capabilities &= ~HVM_HAP_SUPERPAGE_1GB;
> >> > +    }
> >> > +
> >> >      setup_vmcs_dump();
> >> >
> >> >      lbr_tsx_fixup_check();
> >> > --
> >> > 2.7.4

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

 


Rackspace

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