All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mem_event: Return previous value of CR0/CR3/CR4 on change.
@ 2014-02-27 14:03 Andrew Cooper
  2014-02-27 14:03 ` [PATCH 2/2] [RFC] xen/console: Provide timestamps as an offset since boot Andrew Cooper
  2014-02-27 14:12 ` [PATCH 1/2] mem_event: Return previous value of CR0/CR3/CR4 on change Andrew Cooper
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Cooper @ 2014-02-27 14:03 UTC (permalink / raw)
  To: Xen-devel; +Cc: Tim Deegan, Keir Fraser, Jan Beulich, Tamas K Lengyel

From: Tamas K Lengyel <tamas.lengyel@zentific.com>

This patch extends the information returned for CR0/CR3/CR4 register
write events with the previous value of the register. The old value
was already passed to the trap processing function, just never placed
into the returned request. By returning this value, applications
subscribing the CR events obtain additional context about the event.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/hvm/hvm.c         |    4 ++++
 xen/include/public/mem_event.h |    6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 08fec34..9e85c13 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4808,6 +4808,10 @@ static int hvm_memory_event_traps(long p, uint32_t reason,
         req.gla = gla;
         req.gla_valid = 1;
     }
+    else
+    {
+        req.gla = old;
+    }
     
     mem_event_put_request(d, &d->mem_event->access, &req);
     
diff --git a/xen/include/public/mem_event.h b/xen/include/public/mem_event.h
index c9ed546..3831b41 100644
--- a/xen/include/public/mem_event.h
+++ b/xen/include/public/mem_event.h
@@ -40,9 +40,9 @@
 /* Reasons for the memory event request */
 #define MEM_EVENT_REASON_UNKNOWN     0    /* typical reason */
 #define MEM_EVENT_REASON_VIOLATION   1    /* access violation, GFN is address */
-#define MEM_EVENT_REASON_CR0         2    /* CR0 was hit: gfn is CR0 value */
-#define MEM_EVENT_REASON_CR3         3    /* CR3 was hit: gfn is CR3 value */
-#define MEM_EVENT_REASON_CR4         4    /* CR4 was hit: gfn is CR4 value */
+#define MEM_EVENT_REASON_CR0         2    /* CR0 was hit: gfn is new CR0 value, gla is previous */
+#define MEM_EVENT_REASON_CR3         3    /* CR3 was hit: gfn is new CR3 value, gla is previous */
+#define MEM_EVENT_REASON_CR4         4    /* CR4 was hit: gfn is new CR4 value, gla is previous */
 #define MEM_EVENT_REASON_INT3        5    /* int3 was hit: gla/gfn are RIP */
 #define MEM_EVENT_REASON_SINGLESTEP  6    /* single step was invoked: gla/gfn are RIP */
 #define MEM_EVENT_REASON_MSR         7    /* MSR was hit: gfn is MSR value, gla is MSR address;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-02-27 18:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-27 14:03 [PATCH 1/2] mem_event: Return previous value of CR0/CR3/CR4 on change Andrew Cooper
2014-02-27 14:03 ` [PATCH 2/2] [RFC] xen/console: Provide timestamps as an offset since boot Andrew Cooper
2014-02-27 16:21   ` Tim Deegan
2014-02-27 17:50     ` Andrew Cooper
2014-02-27 18:14       ` Andrew Cooper
2014-02-27 18:57   ` Don Slutz
2014-02-27 14:12 ` [PATCH 1/2] mem_event: Return previous value of CR0/CR3/CR4 on change Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.