# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1180601393 -3600
# Node ID dc25aedfa4f32977dcea0c91af6853b586cba27b
# Parent c9d66baad22b6f4cfd644b1272a8506372bb2947
hvm: Correctly hook VLAPIC MSR change notification for VMX into
save/restore path.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
xen/arch/x86/hvm/vlapic.c | 6 ++++++
xen/arch/x86/hvm/vmx/vmcs.c | 2 ++
xen/arch/x86/hvm/vmx/vmx.c | 5 +++--
xen/include/asm-x86/hvm/vmx/vmx.h | 1 +
4 files changed, 12 insertions(+), 2 deletions(-)
diff -r c9d66baad22b -r dc25aedfa4f3 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c Wed May 30 18:29:21 2007 +0100
+++ b/xen/arch/x86/hvm/vlapic.c Thu May 31 09:49:53 2007 +0100
@@ -32,6 +32,7 @@
#include <xen/lib.h>
#include <xen/sched.h>
#include <asm/current.h>
+#include <asm/hvm/vmx/vmx.h>
#include <public/hvm/ioreq.h>
#include <public/hvm/params.h>
@@ -710,6 +711,8 @@ void vlapic_msr_set(struct vlapic *vlapi
vlapic->hw.apic_base_msr = value;
+ vmx_vlapic_msr_changed(vlapic_vcpu(vlapic));
+
HVM_DBG_LOG(DBG_LEVEL_VLAPIC,
"apic base msr is 0x%016"PRIx64, vlapic->hw.apic_base_msr);
}
@@ -877,6 +880,9 @@ static int lapic_load_hidden(struct doma
return -EINVAL;
lapic_info(s);
+
+ vmx_vlapic_msr_changed(v);
+
return 0;
}
diff -r c9d66baad22b -r dc25aedfa4f3 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c Wed May 30 18:29:21 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c Thu May 31 09:49:53 2007 +0100
@@ -456,6 +456,8 @@ static void construct_vmcs(struct vcpu *
vmx_vmcs_exit(v);
paging_update_paging_modes(v); /* will update HOST & GUEST_CR3 as reqd */
+
+ vmx_vlapic_msr_changed(v);
}
int vmx_create_vmcs(struct vcpu *v)
diff -r c9d66baad22b -r dc25aedfa4f3 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c Wed May 30 18:29:21 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c Thu May 31 09:49:53 2007 +0100
@@ -2547,7 +2547,7 @@ static void vmx_install_vlapic_mapping(s
vmx_vmcs_exit(v);
}
-static void vmx_check_vlapic_msr(struct vcpu *v)
+void vmx_vlapic_msr_changed(struct vcpu *v)
{
struct vlapic *vlapic = vcpu_vlapic(v);
uint32_t ctl;
@@ -2555,12 +2555,14 @@ static void vmx_check_vlapic_msr(struct
if ( !cpu_has_vmx_virtualize_apic_accesses )
return;
+ vmx_vmcs_enter(v);
ctl = __vmread(SECONDARY_VM_EXEC_CONTROL);
ctl &= ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
if ( !vlapic_hw_disabled(vlapic) &&
(vlapic_base_address(vlapic) == APIC_DEFAULT_PHYS_BASE) )
ctl |= SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
__vmwrite(SECONDARY_VM_EXEC_CONTROL, ctl);
+ vmx_vmcs_exit(v);
}
static inline int vmx_do_msr_write(struct cpu_user_regs *regs)
@@ -2591,7 +2593,6 @@ static inline int vmx_do_msr_write(struc
break;
case MSR_IA32_APICBASE:
vlapic_msr_set(vcpu_vlapic(v), msr_content);
- vmx_check_vlapic_msr(v);
break;
default:
if ( !long_mode_do_msr_write(regs) )
diff -r c9d66baad22b -r dc25aedfa4f3 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h Wed May 30 18:29:21 2007 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h Thu May 31 09:49:53 2007 +0100
@@ -32,6 +32,7 @@ void vmx_intr_assist(void);
void vmx_intr_assist(void);
void vmx_do_resume(struct vcpu *);
void set_guest_time(struct vcpu *v, u64 gtime);
+void vmx_vlapic_msr_changed(struct vcpu *v);
/*
* Exit Reasons
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|