Skip to content

Commit

Permalink
KVM: VAC: VMX: Rename vmxarea -> vmxon_vmcs
Browse files Browse the repository at this point in the history
  • Loading branch information
vsrinivas committed Aug 2, 2023
1 parent 24f1b26 commit 77679f4
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions arch/x86/kvm/vmx/vac.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
void vmclear_error(struct vmcs *vmcs, u64 phys_addr) {} // XXX Vac
void invept_error(unsigned long ext, u64 eptp, gpa_t gpa) {} // XXX VAC

static DEFINE_PER_CPU(struct vmcs *, vmxarea);
static DEFINE_PER_CPU(struct vmcs *, vmxon_vmcs);
/*
* We maintain a per-CPU linked-list of VMCS loaded on that CPU. This is needed
* when a CPU is brought down, and we need to VMCLEAR all VMCSs loaded on it.
Expand All @@ -19,14 +19,6 @@ static DEFINE_PER_CPU(struct list_head, loaded_vmcss_on_cpu);
DEFINE_PER_CPU(struct vmcs *, current_vmcs);
EXPORT_SYMBOL(current_vmcs);

void vac_set_vmxarea(struct vmcs *vmcs, int cpu) {
per_cpu(vmxarea, cpu) = vmcs;
}

struct vmcs *vac_get_vmxarea(int cpu) {
return per_cpu(vmxarea, cpu);
}

#ifdef CONFIG_KEXEC_CORE
void vac_crash_vmclear_local_loaded_vmcss(void)
{
Expand Down Expand Up @@ -149,8 +141,8 @@ static int kvm_cpu_vmxon(u64 vmxon_pointer)

static void free_kvm_area(int cpu)
{
free_page((unsigned long) per_cpu(vmxarea, cpu));
per_cpu(vmxarea, cpu) = NULL;
free_page((unsigned long) per_cpu(vmxon_vmcs, cpu));
per_cpu(vmxon_vmcs, cpu) = NULL;
}

/* Allocate root VMCS */
Expand Down Expand Up @@ -182,7 +174,7 @@ static int alloc_kvm_area(int cpu)
rdmsr(MSR_IA32_VMX_BASIC, vmx_msr_low, vmx_msr_high);
vmcs->hdr.revision_id = vmx_msr_low;

per_cpu(vmxarea, cpu) = vmcs;
per_cpu(vmxon_vmcs, cpu) = vmcs;
return 0;
}

Expand All @@ -204,7 +196,7 @@ int vmx_hardware_enable(void)

intel_pt_handle_vmx(1);

phys_addr = __pa(vac_get_vmxarea(cpu));
phys_addr = __pa(this_cpu_ptr(vmxon_vmcs));
r = kvm_cpu_vmxon(phys_addr);
if (r) {
intel_pt_handle_vmx(0);
Expand Down

0 comments on commit 77679f4

Please sign in to comment.