From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 03/12] x86/HVM: Hardware alternate p2m support detection. Date: Wed, 24 Jun 2015 10:44:01 +0100 Message-ID: <558A7BE1.2010401@citrix.com> References: <1434999372-3688-1-git-send-email-edmund.h.white@intel.com> <1434999372-3688-4-git-send-email-edmund.h.white@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1434999372-3688-4-git-send-email-edmund.h.white@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ed White , xen-devel@lists.xen.org Cc: Ravi Sahita , Wei Liu , Ian Jackson , Tim Deegan , Jan Beulich , tlengyel@novetta.com, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org On 22/06/15 19:56, Ed White wrote: > As implemented here, only supported on platforms with VMX HAP. > > By default this functionality is force-disabled, it can be enabled > by specifying altp2m=1 on the Xen command line. > > Signed-off-by: Ed White > --- > docs/misc/xen-command-line.markdown | 7 +++++++ > xen/arch/x86/hvm/hvm.c | 12 ++++++++++++ > xen/arch/x86/hvm/vmx/vmx.c | 1 + > xen/include/asm-x86/hvm/hvm.h | 6 ++++++ > 4 files changed, 26 insertions(+) > > diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown > index aa684c0..3391c66 100644 > --- a/docs/misc/xen-command-line.markdown > +++ b/docs/misc/xen-command-line.markdown > @@ -139,6 +139,13 @@ mode during S3 resume. > > Default: `true` > > Permit Xen to use superpages when performing memory management. > + > +### altp2m (Intel) > +> `= ` > + > ++> Default: `false` > + > +Permit multiple copies of host p2m. > > ### apic > > `= bigsmp | default` > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c > index 65baa1b..af68d44 100644 > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -94,6 +94,10 @@ bool_t opt_hvm_fep; > boolean_param("hvm_fep", opt_hvm_fep); > #endif > > +/* Xen command-line option to enable altp2m */ > +static bool_t __initdata opt_altp2m_enabled = 0; > +boolean_param("altp2m", opt_altp2m_enabled); > + > static int cpu_callback( > struct notifier_block *nfb, unsigned long action, void *hcpu) > { > @@ -160,6 +164,9 @@ static int __init hvm_enable(void) > if ( !fns->pvh_supported ) > printk(XENLOG_INFO "HVM: PVH mode not supported on this platform\n"); > > + if ( !opt_altp2m_enabled ) > + hvm_funcs.altp2m_supported = 0; > + > /* > * Allow direct access to the PC debug ports 0x80 and 0xed (they are > * often used for I/O delays, but the vmexits simply slow things down). > @@ -6474,6 +6481,11 @@ enum hvm_intblk nhvm_interrupt_blocked(struct vcpu *v) > return hvm_funcs.nhvm_intr_blocked(v); > } > > +bool_t hvm_altp2m_supported() > +{ > + return hvm_funcs.altp2m_supported; > +} I would put this as a static inline in hvm.h, as opposed to forcing a call into a different translation unit to retrieve a global boolean. Otherwise, Reviewed-by: Andrew Cooper