From: Florian Krohm Date: Fri, 14 Feb 2014 08:55:32 +0000 (+0000) Subject: Fix comments and code snippets that were making incorrect claims about X-Git-Tag: svn/VALGRIND_3_10_1^2~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a8a504011556d028fdc43263ae78d4a91fc88c6;p=thirdparty%2Fvalgrind.git Fix comments and code snippets that were making incorrect claims about the alignment requirement of the guest state, shadow areas, and register spill area sizes. The size of these areas ought to be a multiple of 16 bytes. git-svn-id: svn://svn.valgrind.org/vex/trunk@2818 --- diff --git a/VEX/priv/guest_arm_helpers.c b/VEX/priv/guest_arm_helpers.c index 72040ea31b..ddaf3355eb 100644 --- a/VEX/priv/guest_arm_helpers.c +++ b/VEX/priv/guest_arm_helpers.c @@ -1030,10 +1030,6 @@ void LibVEX_GuestARM_initialise ( /*OUT*/VexGuestARMState* vex_state ) vex_state->guest_ITSTATE = 0; vex_state->padding1 = 0; - vex_state->padding2 = 0; - vex_state->padding3 = 0; - vex_state->padding4 = 0; - vex_state->padding5 = 0; } diff --git a/VEX/priv/guest_x86_helpers.c b/VEX/priv/guest_x86_helpers.c index d29d2eef91..fe808b0b8f 100644 --- a/VEX/priv/guest_x86_helpers.c +++ b/VEX/priv/guest_x86_helpers.c @@ -2764,11 +2764,7 @@ void LibVEX_GuestX86_initialise ( /*OUT*/VexGuestX86State* vex_state ) vex_state->guest_SC_CLASS = 0; vex_state->guest_IP_AT_SYSCALL = 0; - Int i; - for (i = 0; i < sizeof(vex_state->padding) - / sizeof(vex_state->padding[0]); i++) { - vex_state->padding[i] = 0; - } + vex_state->padding1 = 0; } diff --git a/VEX/priv/host_generic_reg_alloc2.c b/VEX/priv/host_generic_reg_alloc2.c index 2b6d07475c..ac853a508d 100644 --- a/VEX/priv/host_generic_reg_alloc2.c +++ b/VEX/priv/host_generic_reg_alloc2.c @@ -399,9 +399,9 @@ HInstrArray* doRegisterAllocation ( not at each insn processed. */ Bool do_sanity_check; - vassert(0 == (guest_sizeB % 32)); - vassert(0 == (LibVEX_N_SPILL_BYTES % 32)); - vassert(0 == (N_SPILL64S % 4)); + vassert(0 == (guest_sizeB % 16)); + vassert(0 == (LibVEX_N_SPILL_BYTES % 16)); + vassert(0 == (N_SPILL64S % 2)); /* The live range numbers are signed shorts, and so limiting the number of insns to 15000 comfortably guards against them diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h index e4daa79446..4cc6156f99 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -521,7 +521,7 @@ extern void LibVEX_ShowAllocStats ( void ); typedef struct { /* Total size of the guest state, in bytes. Must be - 8-aligned. */ + 16-aligned. */ Int total_sizeB; /* Whereabouts is the stack pointer? */ Int offset_SP; diff --git a/VEX/pub/libvex_guest_arm.h b/VEX/pub/libvex_guest_arm.h index b4edef72d6..b7fcea7be8 100644 --- a/VEX/pub/libvex_guest_arm.h +++ b/VEX/pub/libvex_guest_arm.h @@ -193,12 +193,8 @@ typedef */ UInt guest_ITSTATE; - /* Padding to make it have an 32-aligned size */ + /* Padding to make it have an 16-aligned size */ UInt padding1; - UInt padding2; - UInt padding3; - UInt padding4; - UInt padding5; } VexGuestARMState; diff --git a/VEX/pub/libvex_guest_arm64.h b/VEX/pub/libvex_guest_arm64.h index de762140ac..81cac6472c 100644 --- a/VEX/pub/libvex_guest_arm64.h +++ b/VEX/pub/libvex_guest_arm64.h @@ -158,7 +158,7 @@ typedef does get set when required. */ UInt guest_FPSR; - /* Padding to make it have an 32-aligned size */ + /* Padding to make it have an 16-aligned size */ UInt pad_end_0; ULong pad_end_1; } diff --git a/VEX/pub/libvex_guest_mips32.h b/VEX/pub/libvex_guest_mips32.h index a49c646d52..95c2a58374 100644 --- a/VEX/pub/libvex_guest_mips32.h +++ b/VEX/pub/libvex_guest_mips32.h @@ -148,7 +148,7 @@ typedef ULong guest_ac2; /* 344 */ ULong guest_ac3; /* 352 */ - UInt padding[6]; + UInt padding[2]; } VexGuestMIPS32State; /*---------------------------------------------------------------*/ /*--- Utility functions for MIPS32 guest stuff. ---*/ diff --git a/VEX/pub/libvex_guest_mips64.h b/VEX/pub/libvex_guest_mips64.h index 9d03386b33..bbf43854dc 100644 --- a/VEX/pub/libvex_guest_mips64.h +++ b/VEX/pub/libvex_guest_mips64.h @@ -145,7 +145,7 @@ typedef ULong host_EvC_FAILADDR; /* 600 */ UInt host_EvC_COUNTER; /* 608 */ UInt guest_COND; /* 612 */ - UInt padding[6]; + UInt padding[2]; } VexGuestMIPS64State; /*---------------------------------------------------------------*/ diff --git a/VEX/pub/libvex_guest_ppc32.h b/VEX/pub/libvex_guest_ppc32.h index 669cc15b95..66789be3c9 100644 --- a/VEX/pub/libvex_guest_ppc32.h +++ b/VEX/pub/libvex_guest_ppc32.h @@ -242,7 +242,7 @@ typedef /* 1368 */ ULong guest_TEXASR; // Transaction EXception And Summary Register /* 1376 */ ULong guest_TFIAR; // Transaction Failure Instruction Address Register - /* Padding to make it have an 8-aligned size */ + /* Padding to make it have an 16-aligned size */ /* 1384 */ UInt padding2; } diff --git a/VEX/pub/libvex_guest_s390x.h b/VEX/pub/libvex_guest_s390x.h index d540c3c005..c074e921d7 100644 --- a/VEX/pub/libvex_guest_s390x.h +++ b/VEX/pub/libvex_guest_s390x.h @@ -148,11 +148,11 @@ typedef struct { /* 424 */ ULong host_EvC_FAILADDR; /*------------------------------------------------------------*/ -/*--- Force alignment to 32 bytes ---*/ +/*--- Force alignment to 16 bytes ---*/ /*------------------------------------------------------------*/ - /* 432 */ UChar padding[16]; + /* 432 */ UChar padding[0]; - /* 448 */ /* This is the size of the guest state */ + /* 432 */ /* This is the size of the guest state */ } VexGuestS390XState; diff --git a/VEX/pub/libvex_guest_x86.h b/VEX/pub/libvex_guest_x86.h index 6c99bc97a2..597143f90d 100644 --- a/VEX/pub/libvex_guest_x86.h +++ b/VEX/pub/libvex_guest_x86.h @@ -220,8 +220,8 @@ typedef been interrupted by a signal. */ UInt guest_IP_AT_SYSCALL; - /* Padding to make it have an 32-aligned size */ - UInt padding[5]; + /* Padding to make it have an 16-aligned size */ + UInt padding1; } VexGuestX86State;