From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v3 3/4] x86/hvm: Add HVM-specific hypervisor CPUID leaf Date: Fri, 14 Mar 2014 10:41:21 -0400 Message-ID: <53231511.6030705@oracle.com> References: <1394734109-3192-1-git-send-email-boris.ostrovsky@oracle.com> <1394734109-3192-4-git-send-email-boris.ostrovsky@oracle.com> <5322C8840200007800124120@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5322C8840200007800124120@nat28.tlf.novell.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: Jan Beulich Cc: keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 03/14/2014 04:14 AM, Jan Beulich wrote: >>>> On 13.03.14 at 19:08, Boris Ostrovsky wrote: >> +void hvm_hypervisor_cpuid_leaf(uint32_t idx, uint32_t sub_idx, >> + uint32_t *eax, uint32_t *ebx, >> + uint32_t *ecx, uint32_t *edx) >> +{ >> + if ( idx != 4 ) >> + return; > What's the point of this check? Indeed unnecessary, this is already checked at the caller. > Why is "idx" being passed in here in > the first place? With you making use of "sub_idx", there's absolutely > no reason to expect the need for another leaf to ever get funneled > into here. I am passing the arguments directly from cpuid_hypervisor_leaves() which already has idx and sub_idx and I wasn't sure I can assume that they will be in eax and ecx (which they currently are). As for sub_idx, I thought that at some point in the future we we might use it so I kept it. But I can drop it since it's rather unlikely. -boris