[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ytg428sleo7uMRQt@google.com>
Date: Wed, 20 Jul 2022 17:18:19 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Chao Gao <chao.gao@...el.com>
Cc: Kechen Lu <kechenl@...dia.com>, kvm@...r.kernel.org,
pbonzini@...hat.com, vkuznets@...hat.com, somduttar@...dia.com,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v3 4/7] KVM: x86: Let userspace re-enable previously
disabled exits
On Wed, Jun 15, 2022, Chao Gao wrote:
> On Tue, Jun 14, 2022 at 06:16:19PM -0700, Kechen Lu wrote:
> > 7.14 KVM_CAP_S390_HPAGE_1M
> >diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> >index f31ebbb1b94f..7cc8ac550bc7 100644
> >--- a/arch/x86/kvm/x86.c
> >+++ b/arch/x86/kvm/x86.c
> >@@ -4201,11 +4201,10 @@ static inline bool kvm_can_mwait_in_guest(void)
> >
> > static u64 kvm_get_allowed_disable_exits(void)
> > {
> >- u64 r = KVM_X86_DISABLE_EXITS_HLT | KVM_X86_DISABLE_EXITS_PAUSE |
> >- KVM_X86_DISABLE_EXITS_CSTATE;
> >+ u64 r = KVM_X86_DISABLE_VALID_EXITS;
> >
> >- if(kvm_can_mwait_in_guest())
> >- r |= KVM_X86_DISABLE_EXITS_MWAIT;
> >+ if (!kvm_can_mwait_in_guest())
> >+ r &= ~KVM_X86_DISABLE_EXITS_MWAIT;
>
> This hunk looks like a fix to patch 3; it can be squashed into that patch.
It's not a fix, just an inversion of the logic to make it easier to maintain
going forward. I intentionally made the change in patch 4 so that adding the
kvm_get_allowed_disable_exits() is a more "pure" movement of code from the "check"
path to a common helper.
I agree it's kinda odd, but I still think splitting the changes is desirable.
Powered by blists - more mailing lists