From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: [PATCH] xenalyze: Make sure that the shadow information structs are packed Date: Thu, 6 Jun 2013 14:30:06 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: Simon Graham List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User George Dunlap # 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. Spotted-by: Simon Graham Signed-off-by: George Dunlap diff --git a/xenalyze.c b/xenalyze.c --- a/xenalyze.c +++ b/xenalyze.c @@ -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;