WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xenalyze: Handle all MMIO events

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xenalyze: Handle all MMIO events
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Mon, 22 Nov 2010 12:40:17 +0000
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: Mon, 22 Nov 2010 04:42:28 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
Use a generic mmio-assist post processor if no other post-process functions are
present.

This will make sure we catch not only APIC_ACCESS vmexits, but also NPF vmexits
(and any future hardware innovations).

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

diff -r 2a404c7a4fa2 -r 4e88187c91ba xenalyze.c
--- a/xenalyze.c        Mon Nov 22 12:38:56 2010 +0000
+++ b/xenalyze.c        Mon Nov 22 12:39:38 2010 +0000
@@ -1829,11 +1829,14 @@
     } interval;
 } P = { 0 };
 
+/* Function prototypes */
 char * pcpu_string(int pcpu);
 void process_generic(struct record_info *ri);
 void dump_generic(FILE *f, struct record_info *ri);
 ssize_t __read_record(int fd, struct trace_record *rec, loff_t offset);
 void error(enum error_level l, struct record_info *ri);
+void update_io_address(struct io_address ** list, unsigned int pa, int dir,
+                       tsc_t arc_cycles, unsigned int va);
 
 void cpumask_init(cpu_mask_t *c) {
     *c = 0UL;
@@ -3542,6 +3545,20 @@
 
 }
 
+/* Also called by shadow_mmio_postprocess */
+void enumerate_mmio(struct hvm_data *h)
+{
+    struct pf_xen_extra *e = &h->inflight.pf_xen;
+
+    if ( e->mmio_data_valid )
+        update_io_address(&h->summary.mmio, e->gpa, e->mmio_is_write, 
h->arc_cycles, e->va);
+}
+
+void hvm_mmio_assist_postprocess(struct hvm_data *h)
+{
+    if ( opt.with_mmio_enumeration )
+        enumerate_mmio(h);
+}
 
 #define HVM_IO_ASSIST_WRITE 0x200
 void hvm_mmio_assist_process(struct record_info *ri, struct hvm_data *h)
@@ -3594,6 +3611,11 @@
 
     if((e->gpa & 0xfffff000) == 0xfee00000)
         hvm_vlapic_handler(h);
+
+    /* Catch MMIOs that don't go through the shadow code */
+    if ( h->post_process == NULL )
+        h->post_process = hvm_mmio_assist_postprocess;
+        
 }
 
 void hvm_inj_virq_process(struct record_info *ri, struct hvm_data *h) {
@@ -4520,21 +4542,6 @@
     }
 }
 
-/* Also called by shadow_mmio_postprocess */
-void enumerate_mmio(struct hvm_data *h)
-{
-    struct pf_xen_extra *e = &h->inflight.pf_xen;
-
-    if ( e->mmio_data_valid )
-        update_io_address(&h->summary.mmio, e->gpa, e->mmio_is_write, 
h->arc_cycles, e->va);
-}
-
-void hvm_apic_access_postprocess(struct hvm_data *h)
-{
-    if ( opt.with_mmio_enumeration )
-        enumerate_mmio(h);
-}
-
 void hvm_npf_process(struct record_info *ri, struct hvm_data *h)
 {
     struct {
@@ -5040,8 +5047,6 @@
         case EXIT_REASON_EXCEPTION_NMI:
             h->post_process = hvm_exception_nmi_generic_postprocess;
             break;
-        case EXIT_REASON_APIC_ACCESS:
-            h->post_process = hvm_apic_access_postprocess;
         default:
             ;
         }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xenalyze: Handle all MMIO events, George Dunlap <=