* [PATCH] KVM: VMX: Better name x2apic msr bitmaps
@ 2016-09-23 11:17 Wanpeng Li
2016-09-29 18:28 ` Radim Krčmář
0 siblings, 1 reply; 2+ messages in thread
From: Wanpeng Li @ 2016-09-23 11:17 UTC (permalink / raw)
To: linux-kernel, kvm; +Cc: Wanpeng Li, Paolo Bonzini, Radim Krčmář
Renames x2apic_apicv_inactive msr_bitmaps to x2apic and original
x2apic bitmaps to x2apic_apicv.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
arch/x86/kvm/vmx.c | 72 +++++++++++++++++++++++++++---------------------------
1 file changed, 36 insertions(+), 36 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index c6c22ff..2202319 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -925,10 +925,10 @@ static unsigned long *vmx_io_bitmap_a;
static unsigned long *vmx_io_bitmap_b;
static unsigned long *vmx_msr_bitmap_legacy;
static unsigned long *vmx_msr_bitmap_longmode;
+static unsigned long *vmx_msr_bitmap_legacy_x2apic_apicv;
+static unsigned long *vmx_msr_bitmap_longmode_x2apic_apicv;
static unsigned long *vmx_msr_bitmap_legacy_x2apic;
static unsigned long *vmx_msr_bitmap_longmode_x2apic;
-static unsigned long *vmx_msr_bitmap_legacy_x2apic_apicv_inactive;
-static unsigned long *vmx_msr_bitmap_longmode_x2apic_apicv_inactive;
static unsigned long *vmx_vmread_bitmap;
static unsigned long *vmx_vmwrite_bitmap;
@@ -2528,14 +2528,14 @@ static void vmx_set_msr_bitmap(struct kvm_vcpu *vcpu)
SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE)) {
if (enable_apicv && kvm_vcpu_apicv_active(vcpu)) {
if (is_long_mode(vcpu))
- msr_bitmap = vmx_msr_bitmap_longmode_x2apic;
+ msr_bitmap = vmx_msr_bitmap_longmode_x2apic_apicv;
else
- msr_bitmap = vmx_msr_bitmap_legacy_x2apic;
+ msr_bitmap = vmx_msr_bitmap_legacy_x2apic_apicv;
} else {
if (is_long_mode(vcpu))
- msr_bitmap = vmx_msr_bitmap_longmode_x2apic_apicv_inactive;
+ msr_bitmap = vmx_msr_bitmap_longmode_x2apic;
else
- msr_bitmap = vmx_msr_bitmap_legacy_x2apic_apicv_inactive;
+ msr_bitmap = vmx_msr_bitmap_legacy_x2apic;
}
} else {
if (is_long_mode(vcpu))
@@ -4694,14 +4694,14 @@ static void vmx_disable_intercept_for_msr(u32 msr, bool longmode_only)
static void vmx_enable_intercept_msr_read_x2apic(u32 msr, bool apicv_active)
{
if (apicv_active) {
- __vmx_enable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic,
+ __vmx_enable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic_apicv,
msr, MSR_TYPE_R);
- __vmx_enable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic,
+ __vmx_enable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic_apicv,
msr, MSR_TYPE_R);
} else {
- __vmx_enable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic_apicv_inactive,
+ __vmx_enable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic,
msr, MSR_TYPE_R);
- __vmx_enable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic_apicv_inactive,
+ __vmx_enable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic,
msr, MSR_TYPE_R);
}
}
@@ -4709,14 +4709,14 @@ static void vmx_enable_intercept_msr_read_x2apic(u32 msr, bool apicv_active)
static void vmx_disable_intercept_msr_read_x2apic(u32 msr, bool apicv_active)
{
if (apicv_active) {
- __vmx_disable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic,
+ __vmx_disable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic_apicv,
msr, MSR_TYPE_R);
- __vmx_disable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic,
+ __vmx_disable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic_apicv,
msr, MSR_TYPE_R);
} else {
- __vmx_disable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic_apicv_inactive,
+ __vmx_disable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic,
msr, MSR_TYPE_R);
- __vmx_disable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic_apicv_inactive,
+ __vmx_disable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic,
msr, MSR_TYPE_R);
}
}
@@ -4724,14 +4724,14 @@ static void vmx_disable_intercept_msr_read_x2apic(u32 msr, bool apicv_active)
static void vmx_disable_intercept_msr_write_x2apic(u32 msr, bool apicv_active)
{
if (apicv_active) {
- __vmx_disable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic,
+ __vmx_disable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic_apicv,
msr, MSR_TYPE_W);
- __vmx_disable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic,
+ __vmx_disable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic_apicv,
msr, MSR_TYPE_W);
} else {
- __vmx_disable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic_apicv_inactive,
+ __vmx_disable_intercept_for_msr(vmx_msr_bitmap_legacy_x2apic,
msr, MSR_TYPE_W);
- __vmx_disable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic_apicv_inactive,
+ __vmx_disable_intercept_for_msr(vmx_msr_bitmap_longmode_x2apic,
msr, MSR_TYPE_W);
}
}
@@ -6390,28 +6390,28 @@ static __init int hardware_setup(void)
if (!vmx_msr_bitmap_legacy)
goto out1;
- vmx_msr_bitmap_legacy_x2apic =
+ vmx_msr_bitmap_legacy_x2apic_apicv =
(unsigned long *)__get_free_page(GFP_KERNEL);
- if (!vmx_msr_bitmap_legacy_x2apic)
+ if (!vmx_msr_bitmap_legacy_x2apic_apicv)
goto out2;
- vmx_msr_bitmap_legacy_x2apic_apicv_inactive =
+ vmx_msr_bitmap_legacy_x2apic =
(unsigned long *)__get_free_page(GFP_KERNEL);
- if (!vmx_msr_bitmap_legacy_x2apic_apicv_inactive)
+ if (!vmx_msr_bitmap_legacy_x2apic)
goto out3;
vmx_msr_bitmap_longmode = (unsigned long *)__get_free_page(GFP_KERNEL);
if (!vmx_msr_bitmap_longmode)
goto out4;
- vmx_msr_bitmap_longmode_x2apic =
+ vmx_msr_bitmap_longmode_x2apic_apicv =
(unsigned long *)__get_free_page(GFP_KERNEL);
- if (!vmx_msr_bitmap_longmode_x2apic)
+ if (!vmx_msr_bitmap_longmode_x2apic_apicv)
goto out5;
- vmx_msr_bitmap_longmode_x2apic_apicv_inactive =
+ vmx_msr_bitmap_longmode_x2apic =
(unsigned long *)__get_free_page(GFP_KERNEL);
- if (!vmx_msr_bitmap_longmode_x2apic_apicv_inactive)
+ if (!vmx_msr_bitmap_longmode_x2apic)
goto out6;
vmx_vmread_bitmap = (unsigned long *)__get_free_page(GFP_KERNEL);
@@ -6502,13 +6502,13 @@ static __init int hardware_setup(void)
vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_EIP, false);
vmx_disable_intercept_for_msr(MSR_IA32_BNDCFGS, true);
- memcpy(vmx_msr_bitmap_legacy_x2apic,
+ memcpy(vmx_msr_bitmap_legacy_x2apic_apicv,
vmx_msr_bitmap_legacy, PAGE_SIZE);
- memcpy(vmx_msr_bitmap_longmode_x2apic,
+ memcpy(vmx_msr_bitmap_longmode_x2apic_apicv,
vmx_msr_bitmap_longmode, PAGE_SIZE);
- memcpy(vmx_msr_bitmap_legacy_x2apic_apicv_inactive,
+ memcpy(vmx_msr_bitmap_legacy_x2apic,
vmx_msr_bitmap_legacy, PAGE_SIZE);
- memcpy(vmx_msr_bitmap_longmode_x2apic_apicv_inactive,
+ memcpy(vmx_msr_bitmap_longmode_x2apic,
vmx_msr_bitmap_longmode, PAGE_SIZE);
set_bit(0, vmx_vpid_bitmap); /* 0 is reserved for host */
@@ -6586,15 +6586,15 @@ out9:
out8:
free_page((unsigned long)vmx_vmread_bitmap);
out7:
- free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic_apicv_inactive);
-out6:
free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic);
+out6:
+ free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic_apicv);
out5:
free_page((unsigned long)vmx_msr_bitmap_longmode);
out4:
- free_page((unsigned long)vmx_msr_bitmap_legacy_x2apic_apicv_inactive);
-out3:
free_page((unsigned long)vmx_msr_bitmap_legacy_x2apic);
+out3:
+ free_page((unsigned long)vmx_msr_bitmap_legacy_x2apic_apicv);
out2:
free_page((unsigned long)vmx_msr_bitmap_legacy);
out1:
@@ -6607,10 +6607,10 @@ out:
static __exit void hardware_unsetup(void)
{
+ free_page((unsigned long)vmx_msr_bitmap_legacy_x2apic_apicv);
free_page((unsigned long)vmx_msr_bitmap_legacy_x2apic);
- free_page((unsigned long)vmx_msr_bitmap_legacy_x2apic_apicv_inactive);
+ free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic_apicv);
free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic);
- free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic_apicv_inactive);
free_page((unsigned long)vmx_msr_bitmap_legacy);
free_page((unsigned long)vmx_msr_bitmap_longmode);
free_page((unsigned long)vmx_io_bitmap_b);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: VMX: Better name x2apic msr bitmaps
2016-09-23 11:17 [PATCH] KVM: VMX: Better name x2apic msr bitmaps Wanpeng Li
@ 2016-09-29 18:28 ` Radim Krčmář
0 siblings, 0 replies; 2+ messages in thread
From: Radim Krčmář @ 2016-09-29 18:28 UTC (permalink / raw)
To: Wanpeng Li; +Cc: linux-kernel, kvm, Wanpeng Li, Paolo Bonzini
2016-09-23 19:17+0800, Wanpeng Li:
> Renames x2apic_apicv_inactive msr_bitmaps to x2apic and original
> x2apic bitmaps to x2apic_apicv.
>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
Applied to kvm/queue, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-29 18:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-23 11:17 [PATCH] KVM: VMX: Better name x2apic msr bitmaps Wanpeng Li
2016-09-29 18:28 ` Radim Krčmář
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).