Skip to content

Commit

Permalink
KVM: SVM: move feature detection to hardware setup code
Browse files Browse the repository at this point in the history
By moving the SVM feature detection from the each_cpu code to the hardware
setup code it runs only once. As an additional advance the feature check is now
available earlier in the module setup process.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed Apr 27, 2008
1 parent 9457a71 commit 33bd6a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ static void svm_hardware_enable(void *garbage)
svm_data->asid_generation = 1;
svm_data->max_asid = cpuid_ebx(SVM_CPUID_FUNC) - 1;
svm_data->next_asid = svm_data->max_asid + 1;
svm_features = cpuid_edx(SVM_CPUID_FUNC);

asm volatile ("sgdt %0" : "=m"(gdt_descr));
gdt = (struct desc_struct *)gdt_descr.address;
Expand Down Expand Up @@ -411,6 +410,9 @@ static __init int svm_hardware_setup(void)
if (r)
goto err_2;
}

svm_features = cpuid_edx(SVM_CPUID_FUNC);

return 0;

err_2:
Expand Down

0 comments on commit 33bd6a0

Please sign in to comment.