All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yi Zhang <yi.z.zhang@linux.intel.com>
To: Tamas K Lengyel <tamas@tklengyel.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	"wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Razvan Cojocaru <rcojocaru@bitdefender.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH RFC 05/14] xen: vmx: Disable the 2M/1G superpage when SPP enabled
Date: Wed, 25 Oct 2017 23:32:21 +0800	[thread overview]
Message-ID: <20171025153220.GA8038@dazhang1-ssd.sh.intel.com> (raw)
In-Reply-To: <CABfawh=54dasasGD0Ob8c=08=YwVEuo9eTVL7Sz3hr-9XKo_aA@mail.gmail.com>

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@linux.intel.com> 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@linux.intel.com> wrote:
> >> > From: Zhang Yi Z <yi.z.zhang@linux.intel.com>
> >> >
> >> > Current we only support Sub-page Protection on the 4k
> >> > page table.
> >> >
> >> > Signed-off-by: Zhang Yi Z <yi.z.zhang@linux.intel.com>
> >> > ---
> >> >  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@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-10-25  7:41 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19  8:04 [PATCH RFC 00/14] Intel EPT-Based Sub-page Write Protection Support Zhang Yi
2017-10-19  8:08 ` [PATCH RFC 01/14] xen: vmx: Added EPT based Subpage Write Protection Doc Zhang Yi
2017-10-19  8:08 ` [PATCH RFC 02/14] xen: vmx: Added VMX SPP feature flags and VM-Execution Controls Zhang Yi
2017-10-19  8:09 ` [PATCH RFC 03/14] xen: vmx: Introduce the SPPTP and SPP page table Zhang Yi
2017-10-19  8:10 ` [PATCH RFC 04/14] xen: vmx: Introduce SPP-Induced vm exit and it's handle Zhang Yi
2017-10-19  8:11 ` [PATCH RFC 05/14] xen: vmx: Disable the 2M/1G superpage when SPP enabled Zhang Yi
2017-10-19 18:17   ` Tamas K Lengyel
2017-10-20  8:44     ` Yi Zhang
2017-10-24 17:43       ` Tamas K Lengyel
2017-10-25 15:32         ` Yi Zhang [this message]
2017-10-25 15:12           ` Tamas K Lengyel
2017-10-19  8:11 ` [PATCH RFC 06/14] xen: vmx: Added SPP flags in EPT leaf entry Zhang Yi
2017-10-19  8:12 ` [PATCH RFC 07/14] xen: vmx: Update the EPT leaf entry indicated with the SPP enable bit Zhang Yi
2017-10-19  8:12 ` [PATCH RFC 08/14] xen: vmx: Added setup spp page structure Zhang Yi
2017-10-19 18:26   ` Tamas K Lengyel
2017-10-20  8:43     ` Yi Zhang
2017-10-19  8:13 ` [PATCH RFC 09/14] xen: vmx: Introduce a Hyper call to set subpage Zhang Yi
2017-10-19 18:34   ` Tamas K Lengyel
2017-10-20  8:41     ` Yi Zhang
2017-10-19  8:13 ` [PATCH RFC 10/14] xen: vmx: Implement the Hypercall p2m_set_subpage Zhang Yi
2017-10-19  8:14 ` [PATCH RFC 11/14] xen: vmx: Added handle of SPP write protection fault Zhang Yi
2017-10-19  8:15 ` [PATCH RFC 12/14] xen: vmx: Support for clear EPT SPP write Protect bit Zhang Yi
2017-10-19  8:15 ` [PATCH RFC 13/14] xen: tools: Introduce the set-subpage into xenctrl Zhang Yi
2017-10-19  8:37   ` Razvan Cojocaru
2017-10-20  8:40     ` Yi Zhang
2017-10-19  8:16 ` [PATCH RFC 14/14] xen: tools: Added xen-subpage tool Zhang Yi
2017-10-19  8:42   ` Razvan Cojocaru
2017-10-20  8:39     ` Yi Zhang
2017-10-19  9:07 ` [PATCH RFC 00/14] Intel EPT-Based Sub-page Write Protection Support Razvan Cojocaru
2017-10-20  8:37   ` Yi Zhang
2017-10-20  8:39     ` Razvan Cojocaru
2017-10-20  8:39     ` Razvan Cojocaru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171025153220.GA8038@dazhang1-ssd.sh.intel.com \
    --to=yi.z.zhang@linux.intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=tamas@tklengyel.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.