aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/hvm.c
diff options
context:
space:
mode:
authorRazvan Cojocaru <rzvncj@gmail.com>2013-01-17 12:27:00 +0000
committerRazvan Cojocaru <rzvncj@gmail.com>2013-01-17 12:27:00 +0000
commit41333c800cf5fd34229f06b338ef3ff9a2fd3bde (patch)
tree85a7dbbfa2a6aae8ff0aaed3bdded750d4c06234 /xen/arch/x86/hvm/hvm.c
parentd564b6fe9de6c19158d64d714d3bef9261f5b2e1 (diff)
downloadxen-41333c800cf5fd34229f06b338ef3ff9a2fd3bde.tar.gz
xen-41333c800cf5fd34229f06b338ef3ff9a2fd3bde.tar.bz2
xen-41333c800cf5fd34229f06b338ef3ff9a2fd3bde.zip
mem_event: Add support for MEM_EVENT_REASON_MSR
Add the new MEM_EVENT_REASON_MSR event type. Works similarly to the other register events, except event.gla always contains the MSR address (in addition to event.gfn, which holds the value). MEM_EVENT_REASON_MSR does not honour the HVMPME_onchangeonly bit, as doing so would complicate the hvm_msr_write_intercept() switch-based handling of writes for different MSR addresses, with little added benefit. Signed-off-by: Razvan Cojocaru <rzvncj@gmail.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen/arch/x86/hvm/hvm.c')
-rw-r--r--xen/arch/x86/hvm/hvm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e8e27926cc..4b8c60adce 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2934,6 +2934,8 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
hvm_cpuid(1, &cpuid[0], &cpuid[1], &cpuid[2], &cpuid[3]);
mtrr = !!(cpuid[3] & cpufeat_mask(X86_FEATURE_MTRR));
+ hvm_memory_event_msr(msr, msr_content);
+
switch ( msr )
{
case MSR_EFER:
@@ -3869,6 +3871,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
break;
case HVM_PARAM_MEMORY_EVENT_INT3:
case HVM_PARAM_MEMORY_EVENT_SINGLE_STEP:
+ case HVM_PARAM_MEMORY_EVENT_MSR:
if ( d == current->domain )
{
rc = -EPERM;
@@ -4492,6 +4495,14 @@ void hvm_memory_event_cr4(unsigned long value, unsigned long old)
value, old, 0, 0);
}
+void hvm_memory_event_msr(unsigned long msr, unsigned long value)
+{
+ hvm_memory_event_traps(current->domain->arch.hvm_domain
+ .params[HVM_PARAM_MEMORY_EVENT_MSR],
+ MEM_EVENT_REASON_MSR,
+ value, ~value, 1, msr);
+}
+
int hvm_memory_event_int3(unsigned long gla)
{
uint32_t pfec = PFEC_page_present;