Skip to contentSkip to conversation

xenalyze: Make sure that the shadow information structs are packed

PATCH New George Dunlap 1 participant 1 message Jun 6, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenalyze: Make sure that the shadow information structs are packed

# HG changeset patch
# User George Dunlap <[email protected]>
# Date 1370525135 -3600
# Node ID e9dc6fd0b1be1a3b1bc77efca93f71ec2deb2ea3
# Parent 71eeac989efca6a590051edc3dd132df1bd55f7b
xenalyze: Make sure that the shadow information structs are packed

As they are in the hypervisor code, just to make sure everything is the same.

xenalyze.c +11 -11
@@ -5618,17 +5618,17 @@ void shadow_emulate_process(struct recor
             unsigned gl1e, write_val;
             unsigned va;
             unsigned flags:29, emulation_count:3;
-        } gpl2;
+        } __attribute__((packed)) gpl2;
         struct {
             unsigned long long gl1e, write_val;
             unsigned va;
             unsigned flags:29, emulation_count:3;
-        } gpl3;
+        } __attribute__((packed)) gpl3;
         struct {
             unsigned long long gl1e, write_val;
             unsigned long long va;
             unsigned flags:29, emulation_count:3;
-        } gpl4;
+        } __attribute__((packed)) gpl4;
     } *r = (typeof(r))ri->d;
  
     union shadow_event sevt = { .event = ri->event };
@@ -5720,12 +5720,12 @@ void shadow_parse_other(struct record_in
            64-bit... :-/ */
         struct {
             unsigned int gfn, va;
-        } gpl2;
+        } __attribute__((packed)) gpl2;
 #endif
         struct {
             unsigned long long gfn;
             unsigned int va;
-        } gpl3;
+        } __attribute__((packed)) gpl3;
         struct {
             unsigned long long gfn, va;
         } gpl4;
@@ -5924,15 +5924,15 @@ void shadow_fixup_process(struct record_
            so put it first for alignment sake. */
         struct {
             unsigned int gl1e, va, flags;
-        } gpl2;
+        } __attribute__((packed)) gpl2;
         struct {
             unsigned long long gl1e;
             unsigned int va, flags;
-        } gpl3;
+        } __attribute__((packed)) gpl3;
         struct {
             unsigned long long gl1e, va;
             unsigned int flags;
-        } gpl4;
+        } __attribute__((packed)) gpl4;
     } *r = (typeof(r))ri->d;
     union shadow_event sevt = { .event = ri->event };
     int rec_gpl = sevt.paging_levels + 2;
@@ -6112,15 +6112,15 @@ void shadow_propagate_process(struct rec
            so put it first for alignment sake. */
         struct {
             unsigned int gl1e, va, flags;
-        } gpl2;
+        } __attribute__((packed)) gpl2;
         struct {
             unsigned long long gl1e;
             unsigned int va, flags;
-        } gpl3;
+        } __attribute__((packed)) gpl3;
         struct {
             unsigned long long gl1e, va;
             unsigned int flags;
-        } gpl4;
+        } __attribute__((packed)) gpl4;
     } *r = (typeof(r))ri->d;
     union shadow_event sevt = { .event = ri->event };
     int rec_gpl = sevt.paging_levels + 2;