From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v4 01/16] xen: Add support for VMware cpuid leaves Date: Fri, 12 Sep 2014 08:37:27 -0400 Message-ID: <5412E907.1060909@oracle.com> References: <1410460610-14759-1-git-send-email-dslutz@verizon.com> <1410460610-14759-2-git-send-email-dslutz@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1410460610-14759-2-git-send-email-dslutz@verizon.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: Don Slutz , xen-devel@lists.xen.org Cc: Kevin Tian , Keir Fraser , Ian Campbell , Stefano Stabellini , Jun Nakajima , Eddie Dong , Ian Jackson , Tim Deegan , George Dunlap , Aravind Gopalakrishnan , Jan Beulich , Andrew Cooper , Suravee Suthikulpanit List-Id: xen-devel@lists.xenproject.org On 09/11/2014 02:36 PM, Don Slutz wrote: > diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c > index 10fc2ca..f353f42 100644 > --- a/xen/arch/x86/traps.c > +++ b/xen/arch/x86/traps.c > @@ -685,8 +685,12 @@ int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx, > uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) > { > struct domain *d = current->domain; > - /* Optionally shift out of the way of Viridian architectural leaves. */ > - uint32_t base = is_viridian_domain(d) ? 0x40000100 : 0x40000000; > + /* > + * Optionally shift out of the way of Viridian or VMware > + * architectural leaves. > + */ > + uint32_t base = is_viridian_domain(d) | is_vmware_domain(d) ? Given how is_viridian and is_vmware are defined I think '||' is more appropriate. -boris > + 0x40000100 : 0x40000000; > uint32_t limit, dummy; > > idx -= base; > diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h > index 1123857..546210a 100644 > --- a/xen/include/asm-x86/hvm/hvm.h > +++ b/xen/include/asm-x86/hvm/hvm.h > @@ -347,6 +347,9 @@ static inline unsigned long hvm_get_shadow_gs_base(struct vcpu *v) > #define is_viridian_domain(_d) \ > (is_hvm_domain(_d) && ((_d)->arch.hvm_domain.params[HVM_PARAM_VIRIDIAN])) > > +#define is_vmware_domain(_d) \ > + (is_hvm_domain(_d) && ((_d)->arch.hvm_domain.params[HVM_PARAM_VMWARE_HW])) > + >