Skip to content

Commit

Permalink
serialize vmx_dump_cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
prekageo committed Oct 2, 2017
1 parent 2073142 commit caef215
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kern/vmx.c
Expand Up @@ -706,6 +706,8 @@ void vmx_ept_sync_individual_addr(struct vmx_vcpu *vcpu, gpa_t gpa)

#define STACK_DEPTH 12

static DEFINE_SPINLOCK(vmx_dump_cpu_lock);

/**
* vmx_dump_cpu - prints the CPU state
* @vcpu: VCPU to print
Expand All @@ -716,6 +718,8 @@ static void vmx_dump_cpu(struct vmx_vcpu *vcpu)
int i;
unsigned long *sp, val;

spin_lock(&vmx_dump_cpu_lock);

vmx_get_cpu(vcpu);
vcpu->regs[VCPU_REGS_RIP] = vmcs_readl(GUEST_RIP);
vcpu->regs[VCPU_REGS_RSP] = vmcs_readl(GUEST_RSP);
Expand Down Expand Up @@ -754,6 +758,8 @@ static void vmx_dump_cpu(struct vmx_vcpu *vcpu)
i * sizeof(long), val);

printk(KERN_INFO "vmx: --- End VCPU Dump ---\n");

spin_unlock(&vmx_dump_cpu_lock);
}

static u64 construct_eptp(unsigned long root_hpa)
Expand Down

0 comments on commit caef215

Please sign in to comment.