From: "Jan Beulich" Subject: Re: [RFC PATCH 03/10] Add cpuid_vmware_leaves Date: Fri, 13 Dec 2013 10:55:08 +0000 Message-ID: <52AAF59C020000780010CEC9@nat28.tlf.novell.com> References: <1386875718-28166-1-git-send-email-dslutz@terremark.com> <1386875718-28166-4-git-send-email-dslutz@terremark.com> <52AA383B.8000105@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VrQOm-0005l3-U1 for xen-devel@lists.xenproject.org; Fri, 13 Dec 2013 10:55:13 +0000 In-Reply-To: <52AA383B.8000105@citrix.com> Content-Disposition: inline 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 , Don Slutz Cc: Keir Fraser , Ian Campbell , Stefano Stabellini , Ian Jackson , Eddie Dong , Jun Nakajima , xen-devel , Boris Ostrovsky , Suravee Suthikulpanit List-Id: xen-devel@lists.xenproject.org >>> On 12.12.13 at 23:27, Andrew Cooper wrote: > On 12/12/2013 19:15, Don Slutz wrote: >> 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; >> + uint32_t base = 0x40000000; >> uint32_t limit; >> >> + if ( is_viridian_domain(d) ) >> + base += 0x100; >> + if ( is_vmware_domain(d) ) >> + base += 0x100; >> + > > These bases need a far more scalable solution, especially as the result > of each of these clauses can be changed at runtime with a cunning > hvm_param_set hypercall. > > I think that both "is pretending to be HyperV" and "is pretending to be > VMware" need to be domain creation flags which are strictly static for > the lifetime of the domain. And it seems highly questionable to me whether having both at the same time makes much sense. Plus the new function doesn't belong in xen/arch/x86/traps.c ... Jan