logo       

[PATCH 1/8] KVM: Use boot_cpu_data instead of current_cpu_data: msg#00244

emulators.kvm.devel

Subject: [PATCH 1/8] KVM: Use boot_cpu_data instead of current_cpu_data

current_cpu_data invokes smp_processor_id(), which is inadvisable when
preemption is enabled. Switch to boot_cpu_data instead.

Resolves sourceforge bug 1621401.

Signed-off-by: Avi Kivity <avi@xxxxxxxxxxxx>

Index: linux-2.6/drivers/kvm/svm.c
===================================================================
--- linux-2.6.orig/drivers/kvm/svm.c
+++ linux-2.6/drivers/kvm/svm.c
@@ -246,7 +246,7 @@ static int has_svm(void)
{
uint32_t eax, ebx, ecx, edx;

- if (current_cpu_data.x86_vendor != X86_VENDOR_AMD) {
+ if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
printk(KERN_INFO "has_svm: not amd\n");
return 0;
}


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise