From: Chao Gao <chao.gao@intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: <linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
<pbonzini@redhat.com>, <dapeng1.mi@linux.intel.com>
Subject: Re: [PATCH 1/2] KVM: x86: Deduplicate MSR interception enabling and disabling
Date: Wed, 25 Jun 2025 18:57:41 +0800 [thread overview]
Message-ID: <aFvWJY60b7NSXmVV@intel.com> (raw)
In-Reply-To: <aFsrHCZfB_R1Fao7@google.com>
>> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
>> index 5453478d1ca3..cc5f81afd8af 100644
>> --- a/arch/x86/kvm/svm/svm.c
>> +++ b/arch/x86/kvm/svm/svm.c
>> @@ -685,21 +685,21 @@ static bool msr_write_intercepted(struct kvm_vcpu *vcpu, u32 msr)
>> return svm_test_msr_bitmap_write(msrpm, msr);
>> }
>>
>> -void svm_disable_intercept_for_msr(struct kvm_vcpu *vcpu, u32 msr, int type)
>> +void svm_set_intercept_for_msr(struct kvm_vcpu *vcpu, u32 msr, int type, bool enable)
>
>I don't love "enable", because without the context of the wrapper to clarify the
>polarity, it might not be super obvious that "enable" means "enable interception".
>
>I'm leaning towards "set", which is also flawed, mainly because it conflicts with
>the "set" in the function name. But IMO, that's more of a problem with the function
>name.
>
>Anyone have a strong opinion one way or the other?
>
>> -void svm_enable_intercept_for_msr(struct kvm_vcpu *vcpu, u32 msr, int type)
>> +void svm_disable_intercept_for_msr(struct kvm_vcpu *vcpu, u32 msr, int type)
>
>The wrappers can be "static inline" in the header.
>
>If no one objects to s/enable/set (or has an alternative name), I'll apply this:
Looks good to me.
next prev parent reply other threads:[~2025-06-25 10:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 8:19 [PATCH 0/2] More cleanups to MSR interception code Chao Gao
2025-06-12 8:19 ` [PATCH 1/2] KVM: x86: Deduplicate MSR interception enabling and disabling Chao Gao
2025-06-12 11:25 ` Nikolay Borisov
2025-06-12 12:04 ` Chao Gao
2025-06-13 1:37 ` Mi, Dapeng
2025-06-16 2:20 ` Chao Gao
2025-06-24 22:44 ` Sean Christopherson
2025-06-24 22:47 ` Sean Christopherson
2025-06-25 10:57 ` Chao Gao [this message]
2025-06-12 8:19 ` [PATCH 2/2] KVM: SVM: Simplify MSR interception logic for IA32_XSS MSR Chao Gao
2025-06-13 1:39 ` Mi, Dapeng
2025-06-24 22:48 ` Sean Christopherson
2025-06-25 7:20 ` Binbin Wu
2025-06-25 22:25 ` [PATCH 0/2] More cleanups to MSR interception code Sean Christopherson
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=aFvWJY60b7NSXmVV@intel.com \
--to=chao.gao@intel.com \
--cc=dapeng1.mi@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.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
all inboxes | Powered by JetHome®