public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: Use this_cpu_ptr() in kvm_user_return_msr_cpu_online
@ 2024-08-19  5:59 Li Chen
  2024-08-23 23:47 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Li Chen @ 2024-08-19  5:59 UTC (permalink / raw)
  To: kvm, Sean Christopherson, Paolo Bonzini, Thomas Gleixner

From: Li Chen <chenl311@chinatelecom.cn>

Use this_cpu_ptr() instead of open coding the equivalent in
kvm_user_return_msr_cpu_online.

Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
---
 arch/x86/kvm/x86.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 70219e4069874..ffdf251bfef5b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -413,8 +413,7 @@ EXPORT_SYMBOL_GPL(kvm_find_user_return_msr);
 
 static void kvm_user_return_msr_cpu_online(void)
 {
-	unsigned int cpu = smp_processor_id();
-	struct kvm_user_return_msrs *msrs = per_cpu_ptr(user_return_msrs, cpu);
+	struct kvm_user_return_msrs *msrs = this_cpu_ptr(user_return_msrs);
 	u64 value;
 	int i;
 
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: x86: Use this_cpu_ptr() in kvm_user_return_msr_cpu_online
  2024-08-19  5:59 [PATCH] KVM: x86: Use this_cpu_ptr() in kvm_user_return_msr_cpu_online Li Chen
@ 2024-08-23 23:47 ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2024-08-23 23:47 UTC (permalink / raw)
  To: Sean Christopherson, kvm, Paolo Bonzini, Thomas Gleixner, Li Chen

On Mon, 19 Aug 2024 13:59:27 +0800, Li Chen wrote:
> Use this_cpu_ptr() instead of open coding the equivalent in
> kvm_user_return_msr_cpu_online.
> 
> 

Applied to kvm-x86 misc, thanks!  I'm quite annoyed with myself that I missed
that one when sending the patch for commit 15e1c3d65975 ("KVM: x86: Use
this_cpu_ptr() instead of per_cpu_ptr(smp_processor_id())").

[1/1] KVM: x86: Use this_cpu_ptr() in kvm_user_return_msr_cpu_online
      https://github.com/kvm-x86/linux/commit/e0183a42e3bc

--
https://github.com/kvm-x86/linux/tree/next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-23 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19  5:59 [PATCH] KVM: x86: Use this_cpu_ptr() in kvm_user_return_msr_cpu_online Li Chen
2024-08-23 23:47 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox