All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Matthew Daley <mattd@bugfuzz.com>,
	Eddie Dong <eddie.dong@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH v2] nested VMX: fix I/O port exit emulation
Date: Tue, 3 Dec 2013 15:58:03 +0000	[thread overview]
Message-ID: <529DFF8B.9090406@citrix.com> (raw)
In-Reply-To: <529E0CFB0200007800109842@nat28.tlf.novell.com>

On 03/12/13 15:55, Jan Beulich wrote:
>>>> On 03.12.13 at 15:30, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>> @@ -2220,15 +2219,23 @@ int nvmx_n2_vmexit_handler(struct cpu_us
>>>          if ( ctrl & CPU_BASED_ACTIVATE_IO_BITMAP )
>>>          {
>>>              unsigned long qual;
>>> -            u16 port;
>>> +            u16 port, size;
>>>  
>>>              __vmread(EXIT_QUALIFICATION, &qual);
>>>              port = qual >> 16;
>>> -            bitmap = nvmx->iobitmap[port >> 15];
>>> -            if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
>>> -                nvcpu->nv_vmexit_pending = 1;
>>> +            size = (qual & 7) + 1;
>> This should be (qual & 3) for the correct size (Bit 3 is the
>> direction).
> Right - bit 3 is the direction. Bits 0..2 are the size. Hence the
> mask ought to be 7.

D'oh - I cant count, even with the manual for reference.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
>>  Is it worth also verifying that ((qual & 3) != 2)?
> I don't think so - there's no harm to our code here if an undefined
> value was there.
>
> Jan
>

  reply	other threads:[~2013-12-03 15:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 13:44 [PATCH] nested VMX: fix I/O port exit emulation Jan Beulich
2013-12-03 13:55 ` Andrew Cooper
2013-12-03 14:02   ` Jan Beulich
2013-12-03 14:06     ` [PATCH v2] " Jan Beulich
2013-12-03 14:30       ` Andrew Cooper
2013-12-03 15:55         ` Jan Beulich
2013-12-03 15:58           ` Andrew Cooper [this message]
2013-12-04  1:51       ` Zhang, Yang Z
2013-12-04  2:08         ` Andrew Cooper
2013-12-04  2:16           ` Zhang, Yang Z
2013-12-04  7:52         ` Jan Beulich
2013-12-04  8:07           ` Zhang, Yang Z
2013-12-04  8:51             ` Jan Beulich
2013-12-05  1:38               ` Zhang, Yang Z
2013-12-04  8:34       ` Dong, Eddie
2013-12-04  9:51       ` Egger, Christoph
2013-12-04 10:05         ` Jan Beulich

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=529DFF8B.9090406@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=mattd@bugfuzz.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.