From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Xiaoyao Li <xiaoyao.li@intel.com>
Subject: Re: [PATCH 04/10] KVM: VMX: Convert local exit_reason to u16 in nested_vmx_exit_reflected()
Date: Fri, 13 Mar 2020 13:47:01 +0100 [thread overview]
Message-ID: <87a74kpgl6.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20200312184521.24579-5-sean.j.christopherson@intel.com>
Sean Christopherson <sean.j.christopherson@intel.com> writes:
> Store only the basic exit reason in the local "exit_reason" variable in
> nested_vmx_exit_reflected(). Except for tracing, all references to
> exit_reason are expecting to encounter only the basic exit reason.
>
> Opportunistically align the params to nested_vmx_exit_handled_msr().
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
> arch/x86/kvm/vmx/nested.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index cb05bcbbfc4e..1848ca0116c0 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -5374,7 +5374,7 @@ static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu,
> * MSR bitmap. This may be the case even when L0 doesn't use MSR bitmaps.
> */
> static bool nested_vmx_exit_handled_msr(struct kvm_vcpu *vcpu,
> - struct vmcs12 *vmcs12, u32 exit_reason)
> + struct vmcs12 *vmcs12, u16 exit_reason)
> {
> u32 msr_index = kvm_rcx_read(vcpu);
> gpa_t bitmap;
> @@ -5523,7 +5523,7 @@ bool nested_vmx_exit_reflected(struct kvm_vcpu *vcpu)
> u32 intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
> struct vcpu_vmx *vmx = to_vmx(vcpu);
> struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
> - u32 exit_reason = vmx->exit_reason;
> + u16 exit_reason;
>
> if (vmx->nested.nested_run_pending)
> return false;
> @@ -5548,13 +5548,15 @@ bool nested_vmx_exit_reflected(struct kvm_vcpu *vcpu)
> */
> nested_mark_vmcs12_pages_dirty(vcpu);
>
> - trace_kvm_nested_vmexit(kvm_rip_read(vcpu), exit_reason,
> + trace_kvm_nested_vmexit(kvm_rip_read(vcpu), vmx->exit_reason,
> vmcs_readl(EXIT_QUALIFICATION),
> vmx->idt_vectoring_info,
> intr_info,
> vmcs_read32(VM_EXIT_INTR_ERROR_CODE),
> KVM_ISA_VMX);
>
> + exit_reason = vmx->exit_reason;
> +
> switch (exit_reason) {
> case EXIT_REASON_EXCEPTION_NMI:
> if (is_nmi(intr_info))
If the patch is looked at by itself (and not as part of the series) one
may ask to add a comment explaining that we do the trunctation
deliberately but with all patches of the series it is superfluous.
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
--
Vitaly
next prev parent reply other threads:[~2020-03-13 12:47 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-12 18:45 [PATCH 00/10] KVM: VMX: Unionize vcpu_vmx.exit_reason Sean Christopherson
2020-03-12 18:45 ` [PATCH 01/10] KVM: nVMX: Move reflection check into nested_vmx_reflect_vmexit() Sean Christopherson
2020-03-13 12:12 ` Vitaly Kuznetsov
2020-03-17 5:33 ` Sean Christopherson
2020-03-17 16:16 ` Sean Christopherson
2020-03-17 17:00 ` Vitaly Kuznetsov
2020-03-17 17:38 ` Paolo Bonzini
2020-03-17 18:01 ` Sean Christopherson
2020-03-12 18:45 ` [PATCH 02/10] KVM: nVMX: Drop a superfluous WARN on reflecting EXTERNAL_INTERRUPT Sean Christopherson
2020-03-13 12:14 ` Vitaly Kuznetsov
2020-03-12 18:45 ` [PATCH 03/10] KVM: nVMX: Pull exit_reason from vcpu_vmx in nested_vmx_exit_reflected() Sean Christopherson
2020-03-13 12:38 ` Vitaly Kuznetsov
2020-03-12 18:45 ` [PATCH 04/10] KVM: VMX: Convert local exit_reason to u16 " Sean Christopherson
2020-03-13 12:47 ` Vitaly Kuznetsov [this message]
2020-03-12 18:45 ` [PATCH 05/10] KVM: VMX: Convert local exit_reason to u16 in vmx_handle_exit() Sean Christopherson
2020-03-13 13:48 ` Vitaly Kuznetsov
2020-03-12 18:45 ` [PATCH 06/10] KVM: nVMX: Convert local exit_reason to u16 in ...enter_non_root_mode() Sean Christopherson
2020-03-13 13:55 ` Vitaly Kuznetsov
2020-03-13 14:00 ` David Laight
2020-03-17 5:29 ` Sean Christopherson
2020-03-17 17:40 ` Paolo Bonzini
2020-03-12 18:45 ` [PATCH 07/10] KVM: nVMX: Cast exit_reason to u16 to check for nested EXTERNAL_INTERRUPT Sean Christopherson
2020-03-13 13:56 ` Vitaly Kuznetsov
2020-03-12 18:45 ` [PATCH 08/10] KVM: nVMX: Rename exit_reason to vm_exit_reason for nested VM-Exit Sean Christopherson
2020-03-13 14:01 ` Vitaly Kuznetsov
2020-03-13 16:17 ` Sean Christopherson
2020-03-12 18:45 ` [PATCH 09/10] KVM: VMX: Cache vmx->exit_reason in local u16 in vmx_handle_exit_irqoff() Sean Christopherson
2020-03-13 14:09 ` Vitaly Kuznetsov
2020-03-17 17:50 ` Paolo Bonzini
2020-03-12 18:45 ` [PATCH 10/10] KVM: VMX: Convert vcpu_vmx.exit_reason to a union Sean Christopherson
2020-03-13 14:18 ` Vitaly Kuznetsov
2020-03-17 5:28 ` Sean Christopherson
2020-03-17 17:51 ` 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=87a74kpgl6.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=wanpengli@tencent.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 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.