From: "Jan Beulich" Subject: Re: [PATCH 4/5] VMX: drop VMCS *_HIGH enumerators Date: Wed, 21 Jan 2015 10:41:28 +0000 Message-ID: <54BF90680200007800057657@mail.emea.novell.com> References: <54BE42EA0200007800056EDC@mail.emea.novell.com> <54BE45040200007800056F38@mail.emea.novell.com> <54BE96EF.5010305@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDsj4-0005CY-K1 for xen-devel@lists.xenproject.org; Wed, 21 Jan 2015 10:41:30 +0000 In-Reply-To: <54BE96EF.5010305@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 Cc: xen-devel , Kevin Tian , Eddie Dong , JunNakajima List-Id: xen-devel@lists.xenproject.org >>> On 20.01.15 at 18:57, wrote: > On 20/01/15 11:07, Jan Beulich wrote: >> @@ -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. A good compiler certainly could, but I prefer to make such optimizations explicit (and hence compiler independent) in the source code. Jan