From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 4/5] VMX: drop VMCS *_HIGH enumerators Date: Tue, 20 Jan 2015 17:57:03 +0000 Message-ID: <54BE96EF.5010305@citrix.com> References: <54BE42EA0200007800056EDC@mail.emea.novell.com> <54BE45040200007800056F38@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDdY8-0002yv-Uc for xen-devel@lists.xenproject.org; Tue, 20 Jan 2015 18:29:13 +0000 In-Reply-To: <54BE45040200007800056F38@mail.emea.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 , xen-devel Cc: Kevin Tian , Eddie Dong , Jun Nakajima List-Id: xen-devel@lists.xenproject.org On 20/01/15 11:07, Jan Beulich wrote: > Most of them have been unused since the dropping of 32-bit support, and > the few remaining cases are more efficiently dealt with using a generic > macro (and probably things should have been done that way from the > beginning). > > Signed-off-by: Jan Beulich > --- > As already mentioned in > http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg01580.html, > looking at the changes to vvmx.c here emphasizes the question about the > inconsistency between nvmx_vcpu_initialise() and nvmx_handle_vmwrite() > wrt the MSR bitmap handling. > > --- a/xen/arch/x86/hvm/vmx/vvmx.c > +++ b/xen/arch/x86/hvm/vmx/vvmx.c > @@ -98,9 +98,9 @@ int nvmx_vcpu_initialise(struct vcpu *v) > * Let them vmexit as usual. > */ > set_bit(IO_BITMAP_A, vw); > - set_bit(IO_BITMAP_A_HIGH, vw); > + set_bit(VMCS_HIGH(IO_BITMAP_A), vw); > set_bit(IO_BITMAP_B, vw); > - set_bit(IO_BITMAP_B_HIGH, vw); > + set_bit(VMCS_HIGH(IO_BITMAP_B), vw); > > unmap_domain_page(vr); > unmap_domain_page(vw); > @@ -1761,15 +1761,15 @@ int nvmx_handle_vmwrite(struct cpu_user_ > vmcs_encoding = reg_read(regs, decode.reg2); > __set_vvmcs(nvcpu->nv_vvmcx, vmcs_encoding, operand); > > - switch ( vmcs_encoding ) > + switch ( vmcs_encoding & ~VMCS_HIGH(0) ) While this is functionally fine, it is quite odd to read. One option would be to use case IO_BITMAP_A: case VMCS_HIGH(IO_BITMAP_A): but I am not sure whether a compiler could optimise that as well as masking the bottom bit out and halfing the number of case statements. ~Andrew