Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103749
b: refs/heads/master
c: 0da1db7
h: refs/heads/master
i:
  103747: 01502e0
v: v3
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed Jul 20, 2008
1 parent 4ec9ef3 commit b0d1a5c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 180c12fb22bd17c7187ae1bce023d24a42b2980c
refs/heads/master: 0da1db75a2feca54564add30828bab658982481c
34 changes: 22 additions & 12 deletions trunk/arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,11 @@ static int has_svm(void)

static void svm_hardware_disable(void *garbage)
{
struct svm_cpu_data *svm_data
= per_cpu(svm_data, raw_smp_processor_id());

if (svm_data) {
uint64_t efer;
uint64_t efer;

wrmsrl(MSR_VM_HSAVE_PA, 0);
rdmsrl(MSR_EFER, efer);
wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK);
per_cpu(svm_data, raw_smp_processor_id()) = NULL;
__free_page(svm_data->save_area);
kfree(svm_data);
}
wrmsrl(MSR_VM_HSAVE_PA, 0);
rdmsrl(MSR_EFER, efer);
wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK);
}

static void svm_hardware_enable(void *garbage)
Expand Down Expand Up @@ -323,6 +315,19 @@ static void svm_hardware_enable(void *garbage)
page_to_pfn(svm_data->save_area) << PAGE_SHIFT);
}

static void svm_cpu_uninit(int cpu)
{
struct svm_cpu_data *svm_data
= per_cpu(svm_data, raw_smp_processor_id());

if (!svm_data)
return;

per_cpu(svm_data, raw_smp_processor_id()) = NULL;
__free_page(svm_data->save_area);
kfree(svm_data);
}

static int svm_cpu_init(int cpu)
{
struct svm_cpu_data *svm_data;
Expand Down Expand Up @@ -460,6 +465,11 @@ static __init int svm_hardware_setup(void)

static __exit void svm_hardware_unsetup(void)
{
int cpu;

for_each_online_cpu(cpu)
svm_cpu_uninit(cpu);

__free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER);
iopm_base = 0;
}
Expand Down

0 comments on commit b0d1a5c

Please sign in to comment.