aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2008-02-24 04:20:43 -0500
committerAvi Kivity <avi@qumranet.com>2008-04-27 04:53:26 -0400
commit2d3ad1f40c841bd3e97d30d423eea53915d085dc (patch)
tree39f4a5a7814cc306d002366e1af922d32b7713c5 /arch/x86/kvm/vmx.c
parent05da45583de9b383dc81dd695fe248431d6c9f2b (diff)
KVM: Prefix control register accessors with kvm_ to avoid namespace pollution
Names like 'set_cr3()' look dangerously close to affecting the host. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f46ad03c2521..50345032974d 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1683,7 +1683,7 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu)
1683 vmx->vcpu.arch.rmode.active = 0; 1683 vmx->vcpu.arch.rmode.active = 0;
1684 1684
1685 vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val(); 1685 vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val();
1686 set_cr8(&vmx->vcpu, 0); 1686 kvm_set_cr8(&vmx->vcpu, 0);
1687 msr = 0xfee00000 | MSR_IA32_APICBASE_ENABLE; 1687 msr = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
1688 if (vmx->vcpu.vcpu_id == 0) 1688 if (vmx->vcpu.vcpu_id == 0)
1689 msr |= MSR_IA32_APICBASE_BSP; 1689 msr |= MSR_IA32_APICBASE_BSP;
@@ -2026,22 +2026,22 @@ static int handle_cr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2026 switch (cr) { 2026 switch (cr) {
2027 case 0: 2027 case 0:
2028 vcpu_load_rsp_rip(vcpu); 2028 vcpu_load_rsp_rip(vcpu);
2029 set_cr0(vcpu, vcpu->arch.regs[reg]); 2029 kvm_set_cr0(vcpu, vcpu->arch.regs[reg]);
2030 skip_emulated_instruction(vcpu); 2030 skip_emulated_instruction(vcpu);
2031 return 1; 2031 return 1;
2032 case 3: 2032 case 3:
2033 vcpu_load_rsp_rip(vcpu); 2033 vcpu_load_rsp_rip(vcpu);
2034 set_cr3(vcpu, vcpu->arch.regs[reg]); 2034 kvm_set_cr3(vcpu, vcpu->arch.regs[reg]);
2035 skip_emulated_instruction(vcpu); 2035 skip_emulated_instruction(vcpu);
2036 return 1; 2036 return 1;
2037 case 4: 2037 case 4:
2038 vcpu_load_rsp_rip(vcpu); 2038 vcpu_load_rsp_rip(vcpu);
2039 set_cr4(vcpu, vcpu->arch.regs[reg]); 2039 kvm_set_cr4(vcpu, vcpu->arch.regs[reg]);
2040 skip_emulated_instruction(vcpu); 2040 skip_emulated_instruction(vcpu);
2041 return 1; 2041 return 1;
2042 case 8: 2042 case 8:
2043 vcpu_load_rsp_rip(vcpu); 2043 vcpu_load_rsp_rip(vcpu);
2044 set_cr8(vcpu, vcpu->arch.regs[reg]); 2044 kvm_set_cr8(vcpu, vcpu->arch.regs[reg]);
2045 skip_emulated_instruction(vcpu); 2045 skip_emulated_instruction(vcpu);
2046 if (irqchip_in_kernel(vcpu->kvm)) 2046 if (irqchip_in_kernel(vcpu->kvm))
2047 return 1; 2047 return 1;
@@ -2067,14 +2067,14 @@ static int handle_cr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2067 return 1; 2067 return 1;
2068 case 8: 2068 case 8:
2069 vcpu_load_rsp_rip(vcpu); 2069 vcpu_load_rsp_rip(vcpu);
2070 vcpu->arch.regs[reg] = get_cr8(vcpu); 2070 vcpu->arch.regs[reg] = kvm_get_cr8(vcpu);
2071 vcpu_put_rsp_rip(vcpu); 2071 vcpu_put_rsp_rip(vcpu);
2072 skip_emulated_instruction(vcpu); 2072 skip_emulated_instruction(vcpu);
2073 return 1; 2073 return 1;
2074 } 2074 }
2075 break; 2075 break;
2076 case 3: /* lmsw */ 2076 case 3: /* lmsw */
2077 lmsw(vcpu, (exit_qualification >> LMSW_SOURCE_DATA_SHIFT) & 0x0f); 2077 kvm_lmsw(vcpu, (exit_qualification >> LMSW_SOURCE_DATA_SHIFT) & 0x0f);
2078 2078
2079 skip_emulated_instruction(vcpu); 2079 skip_emulated_instruction(vcpu);
2080 return 1; 2080 return 1;