diff options
author | Zachary Amsden <zamsden@redhat.com> | 2009-09-29 17:38:37 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-12-03 02:32:13 -0500 |
commit | 3230bb4707278dba25e24cd0a11ea7b2337678ee (patch) | |
tree | 9548dc371d338b1eb7ee93ef077c70a050cd303f /arch/x86/kvm/svm.c | |
parent | e6732a5af9dfcc87078706a1598df0efe5010f73 (diff) |
KVM: Fix hotplug of CPUs
Both VMX and SVM require per-cpu memory allocation, which is done at module
init time, for only online cpus.
Backend was not allocating enough structure for all possible CPUs, so
new CPUs coming online could not be hardware enabled.
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index d1036ce8917e..02a4269be645 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -482,7 +482,7 @@ static __init int svm_hardware_setup(void) | |||
482 | kvm_enable_efer_bits(EFER_SVME); | 482 | kvm_enable_efer_bits(EFER_SVME); |
483 | } | 483 | } |
484 | 484 | ||
485 | for_each_online_cpu(cpu) { | 485 | for_each_possible_cpu(cpu) { |
486 | r = svm_cpu_init(cpu); | 486 | r = svm_cpu_init(cpu); |
487 | if (r) | 487 | if (r) |
488 | goto err; | 488 | goto err; |
@@ -516,7 +516,7 @@ static __exit void svm_hardware_unsetup(void) | |||
516 | { | 516 | { |
517 | int cpu; | 517 | int cpu; |
518 | 518 | ||
519 | for_each_online_cpu(cpu) | 519 | for_each_possible_cpu(cpu) |
520 | svm_cpu_uninit(cpu); | 520 | svm_cpu_uninit(cpu); |
521 | 521 | ||
522 | __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER); | 522 | __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER); |