From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ed White Subject: Re: [PATCH 03/11] x86/HVM: Hardware alternate p2m support detection. Date: Mon, 12 Jan 2015 09:46:26 -0800 Message-ID: <54B40872.3070603@intel.com> References: <1420838801-11704-1-git-send-email-edmund.h.white@intel.com> <1420838801-11704-4-git-send-email-edmund.h.white@intel.com> <54B3FF85.7090706@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54B3FF85.7090706@citrix.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: Andrew Cooper , xen-devel@lists.xen.org Cc: ian.jackson@eu.citrix.com, tim@xen.org, keir@xen.org, ian.campbell@citrix.com, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org On 01/12/2015 09:08 AM, Andrew Cooper wrote: > On 09/01/15 21:26, Ed White wrote: >> As implemented here, only supported on platforms with VMX HAP. >> >> Signed-off-by: Ed White >> --- >> xen/arch/x86/hvm/hvm.c | 8 ++++++++ >> xen/arch/x86/hvm/vmx/vmx.c | 1 + >> xen/include/asm-x86/hvm/hvm.h | 6 ++++++ >> 3 files changed, 15 insertions(+) >> >> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c >> index bc414ff..3a7367c 100644 >> --- a/xen/arch/x86/hvm/hvm.c >> +++ b/xen/arch/x86/hvm/hvm.c >> @@ -157,6 +157,9 @@ static int __init hvm_enable(void) >> if ( !fns->pvh_supported ) >> printk(XENLOG_INFO "HVM: PVH mode not supported on this platform\n"); >> >> + if ( !fns->altp2m_supported ) >> + printk(XENLOG_INFO "HVM: Alternate p2m mode not supported on this platform\n"); >> + > > I am not sure this message is particularly useful. The PVH message > above is just transitory until PVH looses some of its restrictions. > >> /* >> * 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). >> @@ -6369,6 +6372,11 @@ enum hvm_intblk nhvm_interrupt_blocked(struct vcpu *v) >> return hvm_funcs.nhvm_intr_blocked(v); >> } >> >> +bool_t hvm_altp2m_supported() > > I have to admit that I am somewhat uneasy about the name "altp2m", but I > can't suggest anything better at the moment. I am all ears if anyone > else has any other suggestions. > Me too. The first name I used was even worse. Ed >> +{ >> + return hvm_funcs.altp2m_supported; >> +} >> + >> /* >> * Local variables: >> * mode: C >> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c >> index f2554d6..931709b 100644 >> --- a/xen/arch/x86/hvm/vmx/vmx.c >> +++ b/xen/arch/x86/hvm/vmx/vmx.c >> @@ -1796,6 +1796,7 @@ const struct hvm_function_table * __init start_vmx(void) >> if ( cpu_has_vmx_ept && (cpu_has_vmx_pat || opt_force_ept) ) >> { >> vmx_function_table.hap_supported = 1; >> + vmx_function_table.altp2m_supported = 1; >> >> vmx_function_table.hap_capabilities = 0; >> >> diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h >> index e3d2d9a..7115a68 100644 >> --- a/xen/include/asm-x86/hvm/hvm.h >> +++ b/xen/include/asm-x86/hvm/hvm.h >> @@ -94,6 +94,9 @@ struct hvm_function_table { >> /* Necessary hardware support for PVH mode? */ >> int pvh_supported; >> >> + /* Necessary hardware support for alternate p2m's? */ >> + int altp2m_supported; > > bool_t please. (The adjacent examples are poor) > > ~Andrew > >> + >> /* Indicate HAP capabilities. */ >> int hap_capabilities; >> >> @@ -518,6 +521,9 @@ bool_t nhvm_vmcx_hap_enabled(struct vcpu *v); >> /* interrupt */ >> enum hvm_intblk nhvm_interrupt_blocked(struct vcpu *v); >> >> +/* returns true if hardware supports alternate p2m's */ >> +bool_t hvm_altp2m_supported(void); >> + >> #ifndef NDEBUG >> /* Permit use of the Forced Emulation Prefix in HVM guests */ >> extern bool_t opt_hvm_fep; > >