diff options
author | Steven Maresca <steve@zentific.com> | 2012-09-17 17:55:12 +0100 |
---|---|---|
committer | Steven Maresca <steve@zentific.com> | 2012-09-17 17:55:12 +0100 |
commit | 07d4afd9088f80d5e86d0c6e9a4301adf6d57578 (patch) | |
tree | c86d7a831b84f61d695d87b42c634722cbe0b8cc /xen/arch/x86/hvm/hvm.c | |
parent | 3208d778be3a3a8a021e7eced3d24aa1eefe9c74 (diff) | |
download | xen-07d4afd9088f80d5e86d0c6e9a4301adf6d57578.tar.gz xen-07d4afd9088f80d5e86d0c6e9a4301adf6d57578.tar.bz2 xen-07d4afd9088f80d5e86d0c6e9a4301adf6d57578.zip |
mem_event: fix regression affecting CR3, CR4 memory events
This is a patch repairing a regression in code previously functional
in 4.1.x. It appears that, during some refactoring work, calls to
hvm_memory_event_cr3 and hvm_memory_event_cr4 were lost.
These functions were originally called in mov_to_cr() of vmx.c, but
the commit http://xenbits.xen.org/hg/xen-unstable.hg/rev/1276926e3795
abstracted the original code into generic functions up a level in
hvm.c, dropping these calls in the process.
Signed-off-by: Steven Maresca <steve@zentific.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/hvm/hvm.c')
-rw-r--r-- | xen/arch/x86/hvm/hvm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index dfabe20b08..d69e41976f 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1742,6 +1742,7 @@ int hvm_set_cr3(unsigned long value) { struct vcpu *v = current; struct page_info *page; + unsigned long old; if ( hvm_paging_enabled(v) && !paging_mode_hap(v->domain) && (value != v->arch.hvm_vcpu.guest_cr[3]) ) @@ -1759,8 +1760,10 @@ int hvm_set_cr3(unsigned long value) HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx", value); } + old=v->arch.hvm_vcpu.guest_cr[3]; v->arch.hvm_vcpu.guest_cr[3] = value; paging_update_cr3(v); + hvm_memory_event_cr3(value, old); return X86EMUL_OKAY; bad_cr3: @@ -1802,6 +1805,7 @@ int hvm_set_cr4(unsigned long value) v->arch.hvm_vcpu.guest_cr[4] = value; hvm_update_guest_cr(v, 4); + hvm_memory_event_cr4(value, old_cr); /* * Modifying CR4.{PSE,PAE,PGE,SMEP}, or clearing CR4.PCIDE |