From: Jan Kiszka <jan.kiszka@web.de>
To: Zhihui Zhang <zzhsuny@gmail.com>,
gleb@redhat.com, pbonzini@redhat.com, hpa@zytor.com
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] Check use I/O bitmap first before unconditional I/O exit
Date: Mon, 30 Dec 2013 20:35:03 +0100 [thread overview]
Message-ID: <52C1CAE7.9070605@web.de> (raw)
In-Reply-To: <1388416188-3261-1-git-send-email-zzhsuny@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]
On 2013-12-30 16:09, Zhihui Zhang wrote:
> Signed-off-by: Zhihui Zhang <zzhsuny@gmail.com>
You should explain the "why" here, e.g. point to the SDM section that
requires this ordering.
> ---
> arch/x86/kvm/vmx.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index b2fe1c2..44d4f829 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -6460,11 +6460,11 @@ static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu,
> int size;
> u8 b;
>
> - if (nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING))
> - return 1;
> -
> - if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS))
> + if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) {
> + if (nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING))
> + return 1;
Minor nit, but what about
if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS))
return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING);
instead?
Logic is correct, thanks for addressing this.
Could you also write an according sub-test in kvm-unit-tests [1]? We are
already checking IO bitmap accesses, but not yet unconditional PIO
exiting. Would be great!
Jan
[1] https://git.kernel.org/cgit/virt/kvm/kvm-unit-tests.git
> return 0;
> + }
>
> exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
next prev parent reply other threads:[~2013-12-30 19:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-30 15:09 [PATCH] Check use I/O bitmap first before unconditional I/O exit Zhihui Zhang
2013-12-30 19:35 ` Jan Kiszka [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-12-30 20:56 Zhihui Zhang
2013-12-31 8:55 ` Jan Kiszka
2014-01-08 21:01 ` Marcelo Tosatti
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=52C1CAE7.9070605@web.de \
--to=jan.kiszka@web.de \
--cc=gleb@redhat.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=zzhsuny@gmail.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.