All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Kevin Tian <kevin.tian@intel.com>,
	Eddie Dong <eddie.dong@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH 4/5] VMX: drop VMCS *_HIGH enumerators
Date: Tue, 20 Jan 2015 17:57:03 +0000	[thread overview]
Message-ID: <54BE96EF.5010305@citrix.com> (raw)
In-Reply-To: <54BE45040200007800056F38@mail.emea.novell.com>

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 <jbeulich@suse.com>
> ---
> 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

  reply	other threads:[~2015-01-20 18:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 10:58 [PATCH 0/5] VMX: assorted adjustments Jan Beulich
2015-01-20 11:05 ` [PATCH 1/5] VMX: dump full guest state Jan Beulich
2015-01-20 17:03   ` Andrew Cooper
2015-01-21 10:33     ` Jan Beulich
2015-01-22  4:40   ` Tian, Kevin
2015-01-22 11:56     ` Jan Beulich
2015-01-20 11:06 ` [PATCH 2/5] VMX: dump full host state Jan Beulich
2015-01-20 17:19   ` Andrew Cooper
2015-01-21 10:39     ` Jan Beulich
2015-01-22  4:40   ` Tian, Kevin
2015-01-20 11:06 ` [PATCH 3/5] VMX: dump further control state Jan Beulich
2015-01-20 17:39   ` Andrew Cooper
2015-01-22  4:41   ` Tian, Kevin
2015-01-20 11:07 ` [PATCH 4/5] VMX: drop VMCS *_HIGH enumerators Jan Beulich
2015-01-20 17:57   ` Andrew Cooper [this message]
2015-01-21 10:41     ` Jan Beulich
2015-01-22  4:41   ` Tian, Kevin
2015-01-20 11:08 ` [PATCH 5/5] VMX: use cached "current" where available Jan Beulich
2015-01-20 18:03   ` Andrew Cooper
2015-01-22  4:44   ` Tian, Kevin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54BE96EF.5010305@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.