From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Cc: Matthew Daley <mattd@bugfuzz.com>,
"Dong, Eddie" <eddie.dong@intel.com>,
"Nakajima, Jun" <jun.nakajima@intel.com>
Subject: Re: [PATCH v2] nested VMX: fix I/O port exit emulation
Date: Wed, 4 Dec 2013 02:08:01 +0000 [thread overview]
Message-ID: <529E8E81.5040208@citrix.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E0A984B05@SHSMSX104.ccr.corp.intel.com>
On 04/12/2013 01:51, Zhang, Yang Z wrote:
> Jan Beulich wrote on 2013-12-03:
>> For multi-byte operations all affected ports' bits in the bitmap need to be
>> checked, not just the first port's one.
>>
>> Reported-by: Matthew Daley <mattd@bugfuzz.com>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> v2: Fix loop construct.
>>
>> --- a/xen/arch/x86/hvm/vmx/vvmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
>> @@ -2134,7 +2134,6 @@ int nvmx_n2_vmexit_handler(struct cpu_us
>> struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
>> struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
>> u32 ctrl;
>> - u8 *bitmap;
>>
>> nvcpu->nv_vmexit_pending = 0;
>> nvmx->intr.intr_info = 0;
>> @@ -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;
>> + do {
>> + const u8 *bitmap = nvmx->iobitmap[port >> 15];
>> +
>> + if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 7)) )
>> + nvcpu->nv_vmexit_pending = 1;
>> + if ( !--size )
>> + break;
>> + if ( !++port )
>> + nvcpu->nv_vmexit_pending = 1;
> If port overflow, will it cause vmexit or maybe other fault like GP or just be ignored? Also, you need to check the DF bit to know the string direction before updating the port.
>
> Best regards,
> Yang
>
>
What does the direction flag have to do with the port(s) used as the
target of an ins/outs instruction? I was under the impression that it
solely acted as an increment/decrement on si/di.
~Andrew
next prev parent reply other threads:[~2013-12-04 2:08 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
2013-12-04 1:51 ` Zhang, Yang Z
2013-12-04 2:08 ` Andrew Cooper [this message]
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=529E8E81.5040208@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 \
--cc=yang.z.zhang@intel.com \
/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.