Re: [PATCH] Code clean up for percpu_xxx() functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> All of the kvm usage is in preemption disabled contexts.

Thanks! So would you like to ack this patch? 

===
>From 8ca7e6e40d75eab598c4fb4f8d555299b747adfa Mon Sep 17 00:00:00 2001
From: Alex Shi <alex.shi@xxxxxxxxx>
Date: Thu, 20 Oct 2011 10:31:51 +0800
Subject: [PATCH 2/2] Change this_cpu_xxx to __this_cpu_xxx funcs

According to Avi, all of this_cpu_xx used in preempt disable context,
So change them to __this_cpu_xxx that without abundant preempt
protection.

Signed-off-by: Alex Shi <alex.shi@xxxxxxxxx>
---
 arch/x86/kvm/x86.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 5ff2516..432c4bc 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5024,15 +5024,15 @@ static DEFINE_PER_CPU(struct kvm_vcpu *, current_vcpu);
 
 static int kvm_is_in_guest(void)
 {
-	return this_cpu_read(current_vcpu) != NULL;
+	return __this_cpu_read(current_vcpu) != NULL;
 }
 
 static int kvm_is_user_mode(void)
 {
 	int user_mode = 3;
 
-	if (this_cpu_read(current_vcpu))
-		user_mode = kvm_x86_ops->get_cpl(this_cpu_read(current_vcpu));
+	if (__this_cpu_read(current_vcpu))
+		user_mode = kvm_x86_ops->get_cpl(__this_cpu_read(current_vcpu));
 
 	return user_mode != 0;
 }
@@ -5041,8 +5041,8 @@ static unsigned long kvm_get_guest_ip(void)
 {
 	unsigned long ip = 0;
 
-	if (this_cpu_read(current_vcpu))
-		ip = kvm_rip_read(this_cpu_read(current_vcpu));
+	if (__this_cpu_read(current_vcpu))
+		ip = kvm_rip_read(__this_cpu_read(current_vcpu));
 
 	return ip;
 }
-- 
1.6.3.3




--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux