From: Sean Christopherson <seanjc@google.com>
To: Hao Xiang <hao.xiang@linux.alibaba.com>
Cc: kvm@vger.kernel.org, shannon.zhao@linux.alibaba.com,
pbonzini@redhat.com, xiaoyao.li@intel.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] KVM: VMX: Remove redundant handling of bus lock vmexit
Date: Fri, 15 Oct 2021 14:45:14 +0000 [thread overview]
Message-ID: <YWmT+k9X9+SO0pJv@google.com> (raw)
In-Reply-To: <1634299161-30101-1-git-send-email-hao.xiang@linux.alibaba.com>
On Fri, Oct 15, 2021, Hao Xiang wrote:
> Hardware may or may not set exit_reason.bus_lock_detected on BUS_LOCK
> VM-Exits. Dealing with KVM_RUN_X86_BUS_LOCK in handle_bus_lock_vmexit
> could be redundant when exit_reason.basic is EXIT_REASON_BUS_LOCK.
>
> We can remove redundant handling of bus lock vmexit. Unconditionally Set
> exit_reason.bus_lock_detected in handle_bus_lock_vmexit(), and deal with
> KVM_RUN_X86_BUS_LOCK only in vmx_handle_exit().
>
> Suggested-by: Xiaoyao Li <xiaoyao.li@intel.com>
Code review feedback generally doesn't warrant a Suggested-by. The intent of
Suggested-by is to give credit to the idea/approach of a patch, so unless the
review feedback suggests a completely different, noting the input in the delta
(as you did below) is sufficient. And then that way you don't need to juggle
the Suggested-by vs Co-developed-by for me.
> Co-developed-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Hao Xiang <hao.xiang@linux.alibaba.com>
> ---
> v1 -> v2: a little modifications of comments
> v2 -> v3: addressed the review comments
>
> arch/x86/kvm/vmx/vmx.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 116b089..7fb2a3a 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -5562,9 +5562,13 @@ static int handle_encls(struct kvm_vcpu *vcpu)
>
> static int handle_bus_lock_vmexit(struct kvm_vcpu *vcpu)
> {
> - vcpu->run->exit_reason = KVM_EXIT_X86_BUS_LOCK;
> - vcpu->run->flags |= KVM_RUN_X86_BUS_LOCK;
> - return 0;
> + /*
> + * Hardware may or may not set the BUS_LOCK_DETECTED flag on BUS_LOCK
> + * VM-Exits. Unconditionally set the flag here and leave the handling to
> + * vmx_handle_exit().
+1 for "Unconditionally" instead of "Force". Any objection to rewording the
second half slightly?
/*
* Hardware may or may not set the BUS_LOCK_DETECTED flag on BUS_LOCK
* VM-Exits. Unconditionally set the flag here and let vmx_handle_exit()
* handle all flavors of bus-lock exits.
*/
Not a big deal in this case, but in the future please give reviewers a chance to
respond and wait for discussion to settle before sending a new version, e.g. I
would happily have replied to Xiaoyao's suggestion in v2.
next prev parent reply other threads:[~2021-10-15 14:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 11:59 [PATCH v3] KVM: VMX: Remove redundant handling of bus lock vmexit Hao Xiang
2021-10-15 14:45 ` Sean Christopherson [this message]
2021-10-15 16:09 ` Paolo Bonzini
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=YWmT+k9X9+SO0pJv@google.com \
--to=seanjc@google.com \
--cc=hao.xiang@linux.alibaba.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=shannon.zhao@linux.alibaba.com \
--cc=xiaoyao.li@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox