From: Matthew Daley <mattd@bugfuzz.com>
To: xen-devel@lists.xen.org
Cc: Keir Fraser <keir@xen.org>, Matthew Daley <mattd@bugfuzz.com>,
Eddie Dong <eddie.dong@intel.com>,
Jan Beulich <jbeulich@suse.com>,
Jun Nakajima <jun.nakajima@intel.com>
Subject: [PATCH] nested vmx: fix I/O port bitmap indexing arithmetic
Date: Sat, 30 Nov 2013 11:38:46 +1300 [thread overview]
Message-ID: <1385764726-4615-1-git-send-email-mattd@bugfuzz.com> (raw)
The I/O port bitmap holds 8 ports per element, and hence the port number
used when indexing into it should be shifted right by 3 bits, not 4.
Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
Jan: I'm not sure if this also needs a fixup similar to what you did in
SVM code with commit b1e87805bf.
xen/arch/x86/hvm/vmx/vvmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 248e975..7fa110e 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2225,7 +2225,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
__vmread(EXIT_QUALIFICATION, &qual);
port = qual >> 16;
bitmap = nvmx->iobitmap[port >> 15];
- if ( bitmap[(port & 0x7fff) >> 4] & (1 << (port & 0x7)) )
+ if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
nvcpu->nv_vmexit_pending = 1;
if ( !nvcpu->nv_vmexit_pending )
gdprintk(XENLOG_WARNING, "L0 PIO %x.\n", port);
--
1.7.10.4
next reply other threads:[~2013-11-29 22:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-29 22:38 Matthew Daley [this message]
2013-12-02 5:24 ` [PATCH] nested vmx: fix I/O port bitmap indexing arithmetic Zhang, Yang Z
2013-12-02 7:08 ` Dong, Eddie
2013-12-02 9: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=1385764726-4615-1-git-send-email-mattd@bugfuzz.com \
--to=mattd@bugfuzz.com \
--cc=eddie.dong@intel.com \
--cc=jbeulich@suse.com \
--cc=jun.nakajima@intel.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).