]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 486180 - [Valgrind][MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SY...
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 20 Mar 2026 06:28:09 +0000 (07:28 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 25 Mar 2026 18:45:28 +0000 (19:45 +0100)
This change completely removes IP_AT_SYSCALL.

It used to be used during syscall handling to get the IP in the case
of a syscall restart. Now all platforms use simplys
 "IP -= size of op syscall".

It was also used by s390 for extension handling, That now uses
VG_(get_IP)(tid);

24 files changed:
VEX/auxprogs/genoffsets.c
VEX/priv/guest_amd64_helpers.c
VEX/priv/guest_arm64_helpers.c
VEX/priv/guest_arm_helpers.c
VEX/priv/guest_mips_helpers.c
VEX/priv/guest_ppc_helpers.c
VEX/priv/guest_ppc_toIR.c
VEX/priv/guest_s390_helpers.c
VEX/priv/guest_s390_toIR.c
VEX/priv/guest_x86_helpers.c
VEX/priv/guest_x86_toIR.c
VEX/priv/host_s390_defs.c
VEX/pub/libvex_basictypes.h
VEX/pub/libvex_guest_amd64.h
VEX/pub/libvex_guest_arm.h
VEX/pub/libvex_guest_arm64.h
VEX/pub/libvex_guest_mips32.h
VEX/pub/libvex_guest_mips64.h
VEX/pub/libvex_guest_ppc32.h
VEX/pub/libvex_guest_ppc64.h
VEX/pub/libvex_guest_s390x.h
VEX/pub/libvex_guest_x86.h
VEX/pub/libvex_ir.h
memcheck/mc_machine.c

index 914dbee747969f5ff7c780c94816effb024d3c3e..c4bb262c5eaeb1082b483912ef446ab100a5a8b0 100644 (file)
@@ -183,7 +183,6 @@ void foo ( void )
    GENOFFSET(S390X,s390x,r15);
    GENOFFSET(S390X,s390x,IA);
    GENOFFSET(S390X,s390x,SYSNO);
-   GENOFFSET(S390X,s390x,IP_AT_SYSCALL);
    GENOFFSET(S390X,s390x,fpc);
    GENOFFSET(S390X,s390x,CC_OP);
    GENOFFSET(S390X,s390x,CC_DEP1);
index 7a9b38abde6bb9f773e0d4e448dc69943d98acbc..a5f5420b7c7dac7fee7d2d28b3938be5af24a5d6 100644 (file)
@@ -4837,7 +4837,6 @@ void LibVEX_GuestAMD64_initialise ( /*OUT*/VexGuestAMD64State* vex_state )
    vex_state->guest_SC_CLASS = 0;
    vex_state->guest_GS_CONST = 0;
 
-   vex_state->guest_IP_AT_SYSCALL = 0;
    vex_state->guest_TLSBASE = 0;
 }
 
@@ -4911,7 +4910,7 @@ VexGuestLayout
 
           /* Describe any sections to be regarded by Memcheck as
              'always-defined'. */
-          .n_alwaysDefd = 16,
+          .n_alwaysDefd = 15,
 
           /* flags thunk: OP and NDEP are always defd, whereas DEP1
              and DEP2 have to be tracked.  See detailed comment in
@@ -4939,8 +4938,7 @@ VexGuestLayout
                  /* 11 */ ALWAYSDEFD(guest_SSEROUND),
                  /* 12 */ ALWAYSDEFD(guest_CMSTART),
                  /* 13 */ ALWAYSDEFD(guest_CMLEN),
-                 /* 14 */ ALWAYSDEFD(guest_SC_CLASS),
-                 /* 15 */ ALWAYSDEFD(guest_IP_AT_SYSCALL)
+                 /* 14 */ ALWAYSDEFD(guest_SC_CLASS)
                }
         };
 
index d6a03fe364428c533079d2cac1f6dea0bac01e51..5068a1a6758556935c44126331706a15ddf7bf69 100644 (file)
@@ -2109,7 +2109,6 @@ void LibVEX_GuestARM64_initialise ( /*OUT*/VexGuestARM64State* vex_state )
 //ZZ    vex_state->guest_CMSTART = 0;
 //ZZ    vex_state->guest_CMLEN   = 0;
 //ZZ    vex_state->guest_NRADDR  = 0;
-//ZZ    vex_state->guest_IP_AT_SYSCALL = 0;
 //ZZ 
 //ZZ    vex_state->guest_D0  = 0;
 //ZZ    vex_state->guest_D1  = 0;
@@ -2240,7 +2239,7 @@ VexGuestLayout
 
           /* Describe any sections to be regarded by Memcheck as
              'always-defined'. */
-          .n_alwaysDefd = 9,
+          .n_alwaysDefd = 8,
 
           /* flags thunk: OP is always defd, whereas DEP1 and DEP2
              have to be tracked.  See detailed comment in gdefs.h on
@@ -2253,8 +2252,7 @@ VexGuestLayout
                  /* 4 */ ALWAYSDEFD(guest_CMSTART),
                  /* 5 */ ALWAYSDEFD(guest_CMLEN),
                  /* 6 */ ALWAYSDEFD(guest_NRADDR),
-                 /* 7 */ ALWAYSDEFD(guest_IP_AT_SYSCALL),
-                 /* 8 */ ALWAYSDEFD(guest_TPIDR_EL0)
+                 /* 7 */ ALWAYSDEFD(guest_TPIDR_EL0)
                }
         };
 
index f5734057173671e612b72cb0ce948fbdabd3061a..3478d0c8a66e92c5b00d6eb47ba9f68b3dbb4ad6 100644 (file)
@@ -1291,7 +1291,7 @@ void LibVEX_GuestARM_initialise ( /*OUT*/VexGuestARMState* vex_state )
    vex_state->guest_CMSTART = 0;
    vex_state->guest_CMLEN   = 0;
    vex_state->guest_NRADDR  = 0;
-   vex_state->guest_IP_AT_SYSCALL = 0;
+   vex_state->padding1      = 0;
 
    vex_state->guest_D0  = 0;
    vex_state->guest_D1  = 0;
@@ -1423,7 +1423,7 @@ VexGuestLayout
 
           /* Describe any sections to be regarded by Memcheck as
              'always-defined'. */
-          .n_alwaysDefd = 10,
+          .n_alwaysDefd = 9,
 
           /* flags thunk: OP is always defd, whereas DEP1 and DEP2
              have to be tracked.  See detailed comment in gdefs.h on
@@ -1436,9 +1436,8 @@ VexGuestLayout
                  /* 4 */ ALWAYSDEFD(guest_CMSTART),
                  /* 5 */ ALWAYSDEFD(guest_CMLEN),
                  /* 6 */ ALWAYSDEFD(guest_NRADDR),
-                 /* 7 */ ALWAYSDEFD(guest_IP_AT_SYSCALL),
-                 /* 8 */ ALWAYSDEFD(guest_TPIDRURO),
-                 /* 9 */ ALWAYSDEFD(guest_ITSTATE)
+                 /* 7 */ ALWAYSDEFD(guest_TPIDRURO),
+                 /* 8 */ ALWAYSDEFD(guest_ITSTATE)
                }
         };
 
index f7e6f39d2b4b5e4c9628df64f108de35a76e5f99..164dddebee53696d6e5628b0767c6a68b2cfedee 100644 (file)
@@ -187,8 +187,6 @@ void LibVEX_GuestMIPS32_initialise( /*OUT*/ VexGuestMIPS32State * vex_state)
    vex_state->guest_w1.w64[1] = 0;
    vex_state->guest_w2.w64[0] = 0;
    vex_state->guest_w2.w64[1] = 0;
-
-   vex_state->guest_IP_AT_SYSCALL = 0;
 }
 
 void LibVEX_GuestMIPS64_initialise ( /*OUT*/ VexGuestMIPS64State * vex_state )
@@ -296,8 +294,6 @@ void LibVEX_GuestMIPS64_initialise ( /*OUT*/ VexGuestMIPS64State * vex_state )
    vex_state->guest_LLaddr = 0xFFFFFFFFFFFFFFFFULL;
    vex_state->guest_LLdata = 0;
 
-   vex_state->guest_IP_AT_SYSCALL = 0;
-
    vex_state->guest_MSACSR = 0;
 }
 
index 106f57e738952e3e7be5246f48425bb01cb9e2bc..a48164a16ad40be4018009d2d11dc96ba913123f 100644 (file)
@@ -2825,7 +2825,6 @@ void LibVEX_GuestPPC32_initialise ( /*OUT*/VexGuestPPC32State* vex_state )
    for (i = 0; i < VEX_GUEST_PPC32_REDIR_STACK_SIZE; i++)
       vex_state->guest_REDIR_STACK[i] = 0;
 
-   vex_state->guest_IP_AT_SYSCALL = 0;
    vex_state->guest_SPRG3_RO = 0;
    vex_state->guest_PPR = 0x4ULL << 50;  // medium priority
    vex_state->guest_PSPB = 0x100;  // an arbitrary non-zero value to start with
@@ -3002,7 +3001,6 @@ void LibVEX_GuestPPC64_initialise ( /*OUT*/VexGuestPPC64State* vex_state )
    for (i = 0; i < VEX_GUEST_PPC64_REDIR_STACK_SIZE; i++)
       vex_state->guest_REDIR_STACK[i] = 0;
 
-   vex_state->guest_IP_AT_SYSCALL = 0;
    vex_state->guest_SPRG3_RO = 0;
    vex_state->guest_TFHAR  = 0;
    vex_state->guest_TFIAR  = 0;
@@ -3136,7 +3134,7 @@ VexGuestLayout
 
           /* Describe any sections to be regarded by Memcheck as
              'always-defined'. */
-          .n_alwaysDefd = 12,
+          .n_alwaysDefd = 11,
 
           .alwaysDefd 
          = { /*  0 */ ALWAYSDEFD32(guest_CIA),
@@ -3149,8 +3147,7 @@ VexGuestLayout
              /*  7 */ ALWAYSDEFD32(guest_NRADDR_GPR2),
              /*  8 */ ALWAYSDEFD32(guest_REDIR_SP),
              /*  9 */ ALWAYSDEFD32(guest_REDIR_STACK),
-             /* 10 */ ALWAYSDEFD32(guest_IP_AT_SYSCALL),
-             /* 11 */ ALWAYSDEFD32(guest_C_FPCC)
+              /* 10 */ ALWAYSDEFD32(guest_C_FPCC)
             }
         };
 
@@ -3178,7 +3175,7 @@ VexGuestLayout
 
           /* Describe any sections to be regarded by Memcheck as
              'always-defined'. */
-          .n_alwaysDefd = 12,
+          .n_alwaysDefd = 11,
 
           .alwaysDefd 
          = { /*  0 */ ALWAYSDEFD64(guest_CIA),
@@ -3191,8 +3188,7 @@ VexGuestLayout
              /*  7 */ ALWAYSDEFD64(guest_NRADDR_GPR2),
              /*  8 */ ALWAYSDEFD64(guest_REDIR_SP),
              /*  9 */ ALWAYSDEFD64(guest_REDIR_STACK),
-             /* 10 */ ALWAYSDEFD64(guest_IP_AT_SYSCALL),
-             /* 11 */ ALWAYSDEFD64(guest_C_FPCC)
+              /* 10 */ ALWAYSDEFD64(guest_C_FPCC)
             }
         };
 
index 231e914e5d6a644a9c27c9761cfbc1d54657a3e9..0d747868c79a854e840b4663627556ea197c501a 100644 (file)
@@ -316,7 +316,6 @@ static Bool OV32_CA32_supported = False;
              offsetof(VexGuestPPC32State, _x))
 
 #define OFFB_CIA         offsetofPPCGuestState(guest_CIA)
-#define OFFB_IP_AT_SYSCALL offsetofPPCGuestState(guest_IP_AT_SYSCALL)
 #define OFFB_SPRG3_RO    offsetofPPCGuestState(guest_SPRG3_RO)
 #define OFFB_LR          offsetofPPCGuestState(guest_LR)
 #define OFFB_CTR         offsetofPPCGuestState(guest_CTR)
@@ -520,7 +519,6 @@ typedef enum {
     PPC_GST_EMWARN, // Emulation warnings
     PPC_GST_CMSTART,// For icbi: start of area to invalidate
     PPC_GST_CMLEN,  // For icbi: length of area to invalidate
-    PPC_GST_IP_AT_SYSCALL, // the CIA of the most recently executed SC insn
     PPC_GST_SPRG3_RO, // SPRG3
     PPC_GST_TFHAR,  // Transactional Failure Handler Address Register
     PPC_GST_TFIAR,  // Transactional Failure Instruction Address Register
@@ -3659,10 +3657,6 @@ static void putGST ( PPC_GST reg, IRExpr* src )
    IRType ty_src = typeOfIRExpr(irsb->tyenv,src );
    vassert( reg < PPC_GST_MAX );
    switch (reg) {
-   case PPC_GST_IP_AT_SYSCALL: 
-      vassert( ty_src == ty );
-      stmt( IRStmt_Put( OFFB_IP_AT_SYSCALL, src ) );
-      break;
    case PPC_GST_CIA: 
       vassert( ty_src == ty );
       stmt( IRStmt_Put( OFFB_CIA, src ) );
@@ -10790,11 +10784,6 @@ static Bool dis_syslink ( UInt prefix, UInt theInstr,
       return False;
    }
 
-   /* Copy CIA into the IP_AT_SYSCALL pseudo-register, so that on Darwin
-      Valgrind can back the guest up to this instruction if it needs
-      to restart the syscall. */
-   putGST( PPC_GST_IP_AT_SYSCALL, getGST( PPC_GST_CIA ) );
-
    /* It's important that all ArchRegs carry their up-to-date value
       at this point.  So we declare an end-of-block here, which
       forces any TempRegs caching ArchRegs to be flushed. */
index 2a7f7a0502e5e2253a37942ae919bbdec5934dff..75e93e275b3793d8e2535d2d0a4ce34a6c8da96c 100644 (file)
@@ -120,7 +120,7 @@ VexGuestLayout s390xGuest_layout = {
 
    /* Describe any sections to be regarded by Memcheck as
       'always-defined'. */
-   .n_alwaysDefd = 9,
+   .n_alwaysDefd = 8,
 
    /* Flags thunk: OP and NDEP are always defined, whereas DEP1
       and DEP2 have to be tracked.  See detailed comment in
@@ -131,10 +131,9 @@ VexGuestLayout s390xGuest_layout = {
       /*  2 */ ALWAYSDEFD(guest_EMNOTE),    /* generic */
       /*  3 */ ALWAYSDEFD(guest_CMSTART),   /* generic */
       /*  4 */ ALWAYSDEFD(guest_CMLEN),     /* generic */
-      /*  5 */ ALWAYSDEFD(guest_IP_AT_SYSCALL), /* generic */
-      /*  6 */ ALWAYSDEFD(guest_IA),        /* control reg */
-      /*  7 */ ALWAYSDEFD(guest_fpc),       /* control reg */
-      /*  8 */ ALWAYSDEFD(guest_counter),   /* internal usage register */
+      /*  5 */ ALWAYSDEFD(guest_IA),        /* control reg */
+      /*  6 */ ALWAYSDEFD(guest_fpc),       /* control reg */
+      /*  7 */ ALWAYSDEFD(guest_counter),   /* internal usage register */
    }
 };
 
index 9c68d5b2d0e321dae4575000019a355d1ec65669..8ad8358edfd7cce7c27b812f103bb9e9e557f55d 100644 (file)
@@ -482,10 +482,6 @@ system_call(IRExpr *sysno)
    /* Store the system call number in the pseudo register. */
    stmt(IRStmt_Put(S390X_GUEST_OFFSET(guest_SYSNO), sysno));
 
-   /* Store the current IA into guest_IP_AT_SYSCALL. libvex_ir.h says so. */
-   stmt(IRStmt_Put(S390X_GUEST_OFFSET(guest_IP_AT_SYSCALL),
-                   mkU64(guest_IA_curr_instr)));
-
    put_IA(mkaddr_expr(guest_IA_next_instr));
 
    /* It's important that all ArchRegs carry their up-to-date value
@@ -506,10 +502,6 @@ extension(ULong id, ULong variant)
    ULong ext_id = id | (variant << S390_EXT_ID_NBITS);
    stmt(IRStmt_Put(S390X_GUEST_OFFSET(guest_SYSNO), mkU64(ext_id)));
 
-   /* Store the current IA into guest_IP_AT_SYSCALL. */
-   stmt(IRStmt_Put(S390X_GUEST_OFFSET(guest_IP_AT_SYSCALL),
-                   mkU64(guest_IA_curr_instr)));
-
    put_IA(mkaddr_expr(guest_IA_next_instr));
 
    dis_res->whatNext    = Dis_StopHere;
index f744ff53ee30fb89dd182e27a202289c073fab61..c51104be7e0d2297232ae526cd88d2675268f233 100644 (file)
@@ -2912,10 +2912,6 @@ void LibVEX_GuestX86_initialise ( /*OUT*/VexGuestX86State* vex_state )
 
    vex_state->guest_NRADDR   = 0;
    vex_state->guest_SC_CLASS = 0;
-   vex_state->guest_IP_AT_SYSCALL = 0;
-
-   vex_state->padding1 = 0;
-   vex_state->padding2 = 0;
 }
 
 
@@ -2988,7 +2984,7 @@ VexGuestLayout
 
           /* Describe any sections to be regarded by Memcheck as
              'always-defined'. */
-          .n_alwaysDefd = 24,
+          .n_alwaysDefd = 23,
 
           /* flags thunk: OP and NDEP are always defd, whereas DEP1
              and DEP2 have to be tracked.  See detailed comment in
@@ -3016,8 +3012,7 @@ VexGuestLayout
                  /* 19 */ ALWAYSDEFD(guest_SSEROUND),
                  /* 20 */ ALWAYSDEFD(guest_CMSTART),
                  /* 21 */ ALWAYSDEFD(guest_CMLEN),
-                 /* 22 */ ALWAYSDEFD(guest_SC_CLASS),
-                 /* 23 */ ALWAYSDEFD(guest_IP_AT_SYSCALL)
+                 /* 22 */ ALWAYSDEFD(guest_SC_CLASS)
                }
         };
 
index 166d5afaa7b5de3873fa0287ad4c3275651e7861..cd78a2992c9620268e1f5645433ab403d0a316df 100644 (file)
@@ -277,9 +277,6 @@ static IRSB* irsb;
 #define OFFB_CMLEN     offsetof(VexGuestX86State,guest_CMLEN)
 #define OFFB_NRADDR    offsetof(VexGuestX86State,guest_NRADDR)
 
-#define OFFB_IP_AT_SYSCALL offsetof(VexGuestX86State,guest_IP_AT_SYSCALL)
-
-
 /*------------------------------------------------------------*/
 /*--- Helper bits and pieces for deconstructing the        ---*/
 /*--- x86 insn stream.                                     ---*/
@@ -13689,8 +13686,6 @@ DisResult disInstr_X86_WRK (
          goto decode_failure;
       }
 
-      stmt( IRStmt_Put( OFFB_IP_AT_SYSCALL,
-                        mkU32(guest_EIP_curr_instr) ) );
       jmp_lit(&dres, jump_kind, ((Addr32)guest_EIP_bbstart)+delta);
       vassert(dres.whatNext == Dis_StopHere);
       DIP("int $0x%x\n", d32);
@@ -15392,11 +15387,6 @@ DisResult disInstr_X86_WRK (
             thread will jump to address zero, which is probably
             fatal. 
          */
-
-         /* Note where we are, so we can back up the guest to this
-            point if the syscall needs to be restarted. */
-         stmt( IRStmt_Put( OFFB_IP_AT_SYSCALL,
-                           mkU32(guest_EIP_curr_instr) ) );
          jmp_lit(&dres, Ijk_Sys_sysenter, 0/*bogus next EIP value*/);
          vassert(dres.whatNext == Dis_StopHere);
          DIP("sysenter");
@@ -15549,8 +15539,6 @@ DisResult disInstr_X86_WRK (
       }
 
       case 0x05: /* AMD's syscall */
-         stmt( IRStmt_Put( OFFB_IP_AT_SYSCALL,
-                           mkU32(guest_EIP_curr_instr) ) );
          jmp_lit(&dres, Ijk_Sys_syscall, ((Addr32)guest_EIP_bbstart)+delta);
          vassert(dres.whatNext == Dis_StopHere);
          DIP("syscall\n");
index 1495b26338514a39c0c8b9d003964e150704ee25..adeb9443cad51a010033fcfe9432ebe376a0e71c 100644 (file)
@@ -5931,7 +5931,6 @@ s390_guest_regname_WRK(UInt offset, const HChar *prefix)
          { SPECIAL_REG(guest, NRADDR)  },
          { SPECIAL_REG(guest, CMSTART) },
          { SPECIAL_REG(guest, CMLEN)   },
-         { SPECIAL_REG(guest, IP_AT_SYSCALL) },
          { SPECIAL_REG(guest, EMNOTE) },
          { SPECIAL_REG(host, EvC_COUNTER)  },
          { SPECIAL_REG(host, EvC_FAILADDR) },
index 67bc1a9b2aa774847e483fe86df72e2b810fa6f8..c694f8dce51026653b052c2ae66af24895d793dc 100644 (file)
@@ -205,7 +205,6 @@ typedef  unsigned long HWord;
 #   error "Vex: Fatal: Can't establish the host architecture"
 #endif
 
-
 #endif /* ndef __LIBVEX_BASICTYPES_H */
 
 /*---------------------------------------------------------------*/
index 2f5cd37d17a4cf17d7bf6976c386b8b9820ad52b..42a62131e881f293562251ad1c4a70d62fe582b1 100644 (file)
@@ -161,20 +161,20 @@ typedef
          of the %fs-const hack for amd64-linux/solaris). */
       ULong guest_GS_CONST;
 
-      /* Needed for Darwin (but mandated for all guest architectures):
-         RIP at the last syscall insn (int 0x80/81/82, sysenter,
-         syscall).  Used when backing up to restart a syscall that has
-         been interrupted by a signal. */
-      ULong guest_IP_AT_SYSCALL;
-
       /* Used on FreeBSD as part of a mechanism to allow signal handlers
            to use TLS. */
       ULong guest_TLSBASE;
 
+      UInt padding1;
+      UInt padding2;
+
       /* Add padding here to make it have an 16-aligned size */
    }
    VexGuestAMD64State;
 
+#if defined(__LP64__)
+_Static_assert(sizeof(VexGuestAMD64State)%16 == 0, "sizeof VexGuestAMD64State is not a multiple of 16");
+#endif
 
 
 /*---------------------------------------------------------------*/
index a540f2b410bc24959c498c7744646647fb3fc0d2..93cc13acb89d9c52c970a296bf0c95a8731c545b 100644 (file)
@@ -104,12 +104,8 @@ typedef
          replace-style ones. */
       UInt guest_NRADDR;
 
-      /* Needed for Darwin (but mandated for all guest architectures):
-         program counter at the last syscall insn (int 0x80/81/82,
-         sysenter, syscall, svc).  Used when backing up to restart a
-         syscall that has been interrupted by a signal. */
       /* 124 */
-      UInt guest_IP_AT_SYSCALL;
+      UInt padding1;
 
       /* VFP state.  D0 .. D15 must be 8-aligned. */
       /* 128 */
@@ -198,6 +194,7 @@ typedef
    }
    VexGuestARMState;
 
+_Static_assert(sizeof(VexGuestARMState)%16 == 0, "sizeof VexGuestX86State is not a multiple of 16");
 
 /*---------------------------------------------------------------*/
 /*--- Utility functions for ARM guest stuff.                  ---*/
index 35b417348eaa08072abaf361ca04f66f6d7fa493..7e50acfbcd23e3eff410cfef4cce95ace32aa3ab 100644 (file)
@@ -144,12 +144,6 @@ typedef
          replace-style ones. */
       ULong guest_NRADDR;
 
-      /* Needed for Darwin (but mandated for all guest architectures):
-         program counter at the last syscall insn (int 0x80/81/82,
-         sysenter, syscall, svc).  Used when backing up to restart a
-         syscall that has been interrupted by a signal. */
-      ULong guest_IP_AT_SYSCALL;
-
       /* The complete FPCR.  Default value seems to be zero.  We
          ignore all bits except 23 and 22, which are the rounding
          mode.  The guest is unconstrained in what values it can write
@@ -169,11 +163,16 @@ typedef
       /* Used for FreeBSD syscall dispatching. */
       ULong guest_SC_CLASS;
       /* Padding to make it have an 16-aligned size */
-      ULong pad_end_1;
+      //UInt pad_end_1;
 
    }
    VexGuestARM64State;
 
+#if defined(__LP64__)
+_Static_assert((sizeof(VexGuestARM64State)%16)== 0, "sizeof VexGuestARM64State is not a multiple of 16");
+#endif
+
+
 /*---------------------------------------------------------------*/
 /*--- Utility functions for ARM64 guest stuff.                ---*/
 /*---------------------------------------------------------------*/
index c43ac2f225e04583f2443deeddf74f058e423563..d738fba346bfa09c4f0934904eeb58628c16f34b 100644 (file)
@@ -188,11 +188,14 @@ typedef
 
       /*  1016 */ UInt guest_MSACSR;
 
-      /*  1020 */ UInt guest_IP_AT_SYSCALL;
+      /*  1020 */ UInt _padding3;
 
       /*  1024 */ ULong guest_LLdata64;
-      /*  1032 */ ULong _padding3;
+      /*  1032 */ ULong _padding4;
 } VexGuestMIPS32State;
+
+_Static_assert(sizeof(VexGuestMIPS32State)%16 == 0, "sizeof VexGuestMIPS32State is not a multiple of 16");
+
 /*---------------------------------------------------------------*/
 /*--- Utility functions for MIPS32 guest stuff.               ---*/
 /*---------------------------------------------------------------*/
index 1ee2c183279b3acb0a26cf6146953436e5cdaa1a..d057f31b6700566e8fc89798db3128d8aeec7c6c 100644 (file)
@@ -184,11 +184,13 @@ typedef
       /* 1144 */ UInt guest_MSACSR;
 
       /* 1148 */ UInt _padding2;
-      /* 1152 */ ULong guest_IP_AT_SYSCALL;
-      /* 1160 */ ULong _padding3;
 
 } VexGuestMIPS64State;
 
+#if defined(__LP64__)
+_Static_assert(sizeof(VexGuestMIPS64State)%16 == 0, "sizeof VexGuestMIPS64State is not a multiple of 16");
+#endif
+
 /*---------------------------------------------------------------*/
 /*--- Utility functions for MIPS64 guest stuff.               ---*/
 /*---------------------------------------------------------------*/
index 98dffec6bc3bfd5f56025fbd579e80aeac59d556..a83722cf328ef75717b6582482622034ea1e3763 100644 (file)
@@ -235,66 +235,65 @@ typedef
       /* 1220 */ UInt guest_REDIR_SP;
       /* 1224 */ UInt guest_REDIR_STACK[VEX_GUEST_PPC32_REDIR_STACK_SIZE];
 
-      /* Needed for Darwin (but mandated for all guest architectures):
-         CIA at the last SC insn.  Used when backing up to restart a
-         syscall that has been interrupted by a signal. */
-      /* 1352 */ UInt guest_IP_AT_SYSCALL;
-
       /* SPRG3, which AIUI is readonly in user space.  Needed for
          threading on AIX. */
-      /* 1356 */ UInt guest_SPRG3_RO;
-      /* 1360 */ UInt  padding1;
-      /* 1364 */ ULong guest_TFHAR;     // Transaction Failure Handler Address Register
-      /* 1372 */ ULong guest_TEXASR;    // Transaction EXception And Summary Register
-      /* 1380 */ ULong guest_TFIAR;     // Transaction Failure Instruction Address Register
-      /* 1388 */ ULong guest_PPR;       // Program Priority register
-      /* 1396 */ UInt  guest_TEXASRU;   // Transaction EXception And Summary Register Upper
-      /* 1400 */ UInt  guest_PSPB;      // Problem State Priority Boost register
-      /* 1404 */ ULong guest_DSCR;      // Data Stream Control register
+      /* 1352 */ UInt guest_SPRG3_RO;
+      /* 1356 */ UInt  padding1;
+      /* 1360 */ ULong guest_TFHAR;     // Transaction Failure Handler Address Register
+      /* 1368 */ ULong guest_TEXASR;    // Transaction EXception And Summary Register
+      /* 1376 */ ULong guest_TFIAR;     // Transaction Failure Instruction Address Register
+      /* 1384 */ ULong guest_PPR;       // Program Priority register
+      /* 1392 */ UInt  guest_TEXASRU;   // Transaction EXception And Summary Register Upper
+      /* 1396 */ UInt  guest_PSPB;      // Problem State Priority Boost register
+      /* 1400 */ ULong guest_DSCR;      // Data Stream Control register
 
       /* ISA 3.1 Accumulators.  There are eight accumulators each contains four
          128-bit rows.  Declare each acculator and row explicitly, then use a
          helper to map ACC[i][row] to the explicitly declared entry.
          Technically not supported in 32-bit mode but needs to be defined. */
-      /* 1412 */   U128  guest_ACC_0_r0;
-      /* 1428 */   U128  guest_ACC_0_r1;
-      /* 1444 */   U128  guest_ACC_0_r2;
-      /* 1460 */   U128  guest_ACC_0_r3;
-      /* 1476 */   U128  guest_ACC_1_r0;
-      /* 1492 */   U128  guest_ACC_1_r1;
-      /* 1508 */   U128  guest_ACC_1_r2;
-      /* 1524 */   U128  guest_ACC_1_r3;
-      /* 1540 */   U128  guest_ACC_2_r0;
-      /* 1556 */   U128  guest_ACC_2_r1;
-      /* 1572 */   U128  guest_ACC_2_r2;
-      /* 1588 */   U128  guest_ACC_2_r3;
-      /* 1604 */   U128  guest_ACC_3_r0;
-      /* 1620 */   U128  guest_ACC_3_r1;
-      /* 1636 */   U128  guest_ACC_3_r2;
-      /* 1652 */   U128  guest_ACC_3_r3;
-      /* 1668 */   U128  guest_ACC_4_r0;
-      /* 1684 */   U128  guest_ACC_4_r1;
-      /* 1700 */   U128  guest_ACC_4_r2;
-      /* 1716 */   U128  guest_ACC_4_r3;
-      /* 1732 */   U128  guest_ACC_5_r0;
-      /* 1748 */   U128  guest_ACC_5_r1;
-      /* 1780 */   U128  guest_ACC_5_r2;
-      /* 1796 */   U128  guest_ACC_5_r3;
-      /* 1812 */   U128  guest_ACC_6_r0;
-      /* 1828 */   U128  guest_ACC_6_r1;
-      /* 1844 */   U128  guest_ACC_6_r2;
-      /* 1860 */   U128  guest_ACC_6_r3;
-      /* 1876 */   U128  guest_ACC_7_r0;
-      /* 1892 */   U128  guest_ACC_7_r1;
-      /* 1908 */   U128  guest_ACC_7_r2;
-      /* 1924 */   U128  guest_ACC_7_r3;
+      /* 1408 */   U128  guest_ACC_0_r0;
+      /* 1424 */   U128  guest_ACC_0_r1;
+      /* 1440 */   U128  guest_ACC_0_r2;
+      /* 1456 */   U128  guest_ACC_0_r3;
+      /* 1474 */   U128  guest_ACC_1_r0;
+      /* 1488 */   U128  guest_ACC_1_r1;
+      /* 1504 */   U128  guest_ACC_1_r2;
+      /* 1520 */   U128  guest_ACC_1_r3;
+      /* 1536 */   U128  guest_ACC_2_r0;
+      /* 1552 */   U128  guest_ACC_2_r1;
+      /* 1568 */   U128  guest_ACC_2_r2;
+      /* 1584 */   U128  guest_ACC_2_r3;
+      /* 1600 */   U128  guest_ACC_3_r0;
+      /* 1616 */   U128  guest_ACC_3_r1;
+      /* 1632 */   U128  guest_ACC_3_r2;
+      /* 1648 */   U128  guest_ACC_3_r3;
+      /* 1664 */   U128  guest_ACC_4_r0;
+      /* 1680 */   U128  guest_ACC_4_r1;
+      /* 1696 */   U128  guest_ACC_4_r2;
+      /* 1712 */   U128  guest_ACC_4_r3;
+      /* 1728 */   U128  guest_ACC_5_r0;
+      /* 1744 */   U128  guest_ACC_5_r1;
+      /* 1776 */   U128  guest_ACC_5_r2;
+      /* 1792 */   U128  guest_ACC_5_r3;
+      /* 1808 */   U128  guest_ACC_6_r0;
+      /* 1824 */   U128  guest_ACC_6_r1;
+      /* 1840 */   U128  guest_ACC_6_r2;
+      /* 1856 */   U128  guest_ACC_6_r3;
+      /* 1872 */   U128  guest_ACC_7_r0;
+      /* 1888 */   U128  guest_ACC_7_r1;
+      /* 1904 */   U128  guest_ACC_7_r2;
+      /* 1920 */   U128  guest_ACC_7_r3;
 
    /* Padding to make it have an 16-aligned size */
-      /* 1940 */   UInt guest_syscall_flag;
-      /* 1944 *    UInt  padding2; */
+      /* 1936 */   UInt guest_syscall_flag;
+      /* 1940 */   UInt padding2;
+      /* 1944 */   UInt padding3;
+      /* 1948 */   UInt padding4;
+
    }
    VexGuestPPC32State;
 
+_Static_assert(sizeof(VexGuestPPC32State)%16 == 0, "sizeof VexGuesPPC32State is not a multiple of 16");
 
 /*---------------------------------------------------------------*/
 /*--- Utility functions for PPC32 guest stuff.                ---*/
index cea6679286fd7cbad6628922a9017b37e656f0ee..295e984d5e93dbcc021b2de8f79a78c74364d13d 100644 (file)
@@ -276,21 +276,17 @@ typedef
       /* 1380 */ ULong guest_REDIR_SP;
       /* 1388 */ ULong guest_REDIR_STACK[VEX_GUEST_PPC64_REDIR_STACK_SIZE];
 
-      /* Needed for Darwin: CIA at the last SC insn.  Used when backing up
-         to restart a syscall that has been interrupted by a signal. */
-      /* 1648 */ ULong guest_IP_AT_SYSCALL;
-
       /* SPRG3, which AIUI is readonly in user space.  Needed for
          threading on AIX. */
-      /* 1656 */ ULong guest_SPRG3_RO;
+      /* 1648 */ ULong guest_SPRG3_RO;
 
-      /* 1664 */ ULong guest_TFHAR;     // Transaction Failure Handler Address Register
-      /* 1672 */ ULong guest_TEXASR;    // Transaction EXception And Summary Register
-      /* 1680 */ ULong guest_TFIAR;     // Transaction Failure Instruction Address Register
-      /* 1688 */ ULong guest_PPR;       // Program Priority register
-      /* 1696 */ UInt  guest_TEXASRU;   // Transaction EXception And Summary Register Upper
-      /* 1700 */ UInt  guest_PSPB;      // Problem State Priority Boost register
-      /* 1704 */ ULong guest_DSCR;      // Data Stream Control register
+      /* 1656 */ ULong guest_TFHAR;     // Transaction Failure Handler Address Register
+      /* 1664 */ ULong guest_TEXASR;    // Transaction EXception And Summary Register
+      /* 1672 */ ULong guest_TFIAR;     // Transaction Failure Instruction Address Register
+      /* 1680 */ ULong guest_PPR;       // Program Priority register
+      /* 1688 */ UInt  guest_TEXASRU;   // Transaction EXception And Summary Register Upper
+      /* 1692 */ UInt  guest_PSPB;      // Problem State Priority Boost register
+      /* 1696 */ ULong guest_DSCR;      // Data Stream Control register
 
       /* Historical note, Initial ACC support was implemented to use a separate
          register file, but in practice (ISA 3.1) the hardware implementation
@@ -302,48 +298,47 @@ typedef
       /* The guest_ACC_entries must be in order and sequential.  The helper
          routines get_ACC_entry(), write_ACC_entry() calculate the offset of
          the ACC entry based on a address of guest_ACC_0_r0.  */
-      /* 1712 */   U128  guest_ACC_0_r0;
-      /* 1728 */   U128  guest_ACC_0_r1;
-      /* 1744 */   U128  guest_ACC_0_r2;
-      /* 1760 */   U128  guest_ACC_0_r3;
-      /* 1776 */   U128  guest_ACC_1_r0;
-      /* 1792 */   U128  guest_ACC_1_r1;
-      /* 1808 */   U128  guest_ACC_1_r2;
-      /* 1824 */   U128  guest_ACC_1_r3;
-      /* 1840 */   U128  guest_ACC_2_r0;
-      /* 1856 */   U128  guest_ACC_2_r1;
-      /* 1872 */   U128  guest_ACC_2_r2;
-      /* 1888 */   U128  guest_ACC_2_r3;
-      /* 1904 */   U128  guest_ACC_3_r0;
-      /* 1920 */   U128  guest_ACC_3_r1;
-      /* 1936 */   U128  guest_ACC_3_r2;
-      /* 1952 */   U128  guest_ACC_3_r3;
-      /* 1968 */   U128  guest_ACC_4_r0;
-      /* 1984 */   U128  guest_ACC_4_r1;
-      /* 2000 */   U128  guest_ACC_4_r2;
-      /* 2016 */   U128  guest_ACC_4_r3;
-      /* 2032 */   U128  guest_ACC_5_r0;
-      /* 2048 */   U128  guest_ACC_5_r1;
-      /* 2064 */   U128  guest_ACC_5_r2;
-      /* 2080 */   U128  guest_ACC_5_r3;
-      /* 2096 */   U128  guest_ACC_6_r0;
-      /* 2112 */   U128  guest_ACC_6_r1;
-      /* 2128 */   U128  guest_ACC_6_r2;
-      /* 2144 */   U128  guest_ACC_6_r3;
-      /* 2160 */   U128  guest_ACC_7_r0;
-      /* 2176 */   U128  guest_ACC_7_r1;
-      /* 2192 */   U128  guest_ACC_7_r2;
-      /* 2208 */   U128  guest_ACC_7_r3;
-
-      /* 2224 */   UInt guest_syscall_flag;
-      /* 2228 */   UInt padding1;
-      /* 2232 */   UInt padding2;
-      /* 2236 */   UInt padding3;
+      /* 1704 */   U128  guest_ACC_0_r0;
+      /* 1720 */   U128  guest_ACC_0_r1;
+      /* 1736 */   U128  guest_ACC_0_r2;
+      /* 1752 */   U128  guest_ACC_0_r3;
+      /* 1768 */   U128  guest_ACC_1_r0;
+      /* 1784 */   U128  guest_ACC_1_r1;
+      /* 1800 */   U128  guest_ACC_1_r2;
+      /* 1816 */   U128  guest_ACC_1_r3;
+      /* 1832 */   U128  guest_ACC_2_r0;
+      /* 1848 */   U128  guest_ACC_2_r1;
+      /* 1864 */   U128  guest_ACC_2_r2;
+      /* 1880 */   U128  guest_ACC_2_r3;
+      /* 1896 */   U128  guest_ACC_3_r0;
+      /* 1912 */   U128  guest_ACC_3_r1;
+      /* 1928 */   U128  guest_ACC_3_r2;
+      /* 1944 */   U128  guest_ACC_3_r3;
+      /* 1960 */   U128  guest_ACC_4_r0;
+      /* 1976 */   U128  guest_ACC_4_r1;
+      /* 1992 */   U128  guest_ACC_4_r2;
+      /* 2008 */   U128  guest_ACC_4_r3;
+      /* 2024 */   U128  guest_ACC_5_r0;
+      /* 2040 */   U128  guest_ACC_5_r1;
+      /* 2056 */   U128  guest_ACC_5_r2;
+      /* 2072 */   U128  guest_ACC_5_r3;
+      /* 2088 */   U128  guest_ACC_6_r0;
+      /* 2104 */   U128  guest_ACC_6_r1;
+      /* 2120 */   U128  guest_ACC_6_r2;
+      /* 2136 */   U128  guest_ACC_6_r3;
+      /* 2152 */   U128  guest_ACC_7_r0;
+      /* 2168 */   U128  guest_ACC_7_r1;
+      /* 2184 */   U128  guest_ACC_7_r2;
+      /* 2200 */   U128  guest_ACC_7_r3;
+
+      /* 2216 */   UInt guest_syscall_flag;
       /* Padding to make it have an 16-aligned size */
-      /* 2222    UInt  padding0; */
    }
    VexGuestPPC64State;
 
+#if defined(__LP64__)
+_Static_assert((sizeof(VexGuestPPC64State)%16)== 0, "sizeof VexGuestPPC64State is not a multiple of 16");
+#endif
 
 /*---------------------------------------------------------------*/
 /*--- Utility functions for PPC64 guest stuff.                ---*/
index c805dc0c0a823216da0c0eb591c3eb6f5ffcf26f..7abb88d01bf9be66d894135ab632fc3a937cf14a 100644 (file)
@@ -157,26 +157,22 @@ typedef struct {
    /*  776 */  ULong guest_CMSTART;
    /*  784 */  ULong guest_CMLEN;
 
-   /* Used when backing up to restart a syscall that has
-      been interrupted by a signal. See also comment in
-      libvex_ir.h */
-   /*  792 */  ULong guest_IP_AT_SYSCALL;
-
    /* Emulation notes; see comments in libvex_emnote.h */
-   /*  800 */  UInt guest_EMNOTE;
+   /*  792 */  UInt guest_EMNOTE;
 
    /* For translation chaining */
-   /*  804 */  UInt  host_EvC_COUNTER;
-   /*  808 */  ULong host_EvC_FAILADDR;
+   /*  796 */  UInt  host_EvC_COUNTER;
+   /*  800 */  ULong host_EvC_FAILADDR;
 
 /*------------------------------------------------------------*/
 /*--- Force alignment to 16 bytes                          ---*/
 /*------------------------------------------------------------*/
-   /*  816 */  UChar padding[0];
+   /*  808 */  ULong padding;
 
    /*  816 */  /* This is the size of the guest state */
 } VexGuestS390XState;
 
+_Static_assert((sizeof(VexGuestS390XState)%16)== 0, "sizeof VexGuestS390XState is not a multiple of 16");
 
 /*------------------------------------------------------------*/
 /*--- Function prototypes                                  ---*/
index baf13f402caa45c06be2862969ba332331fe8eea..cb6f35fc10b6da5e61f7efc163ea1a2c336c8870 100644 (file)
@@ -191,6 +191,7 @@ typedef
       UShort guest_FS;
       UShort guest_GS;
       UShort guest_SS;
+      UInt paddingSeg;
       /* LDT/GDT stuff. */
       ULong  guest_LDT; /* host addr, a VexGuestX86SegDescr* */
       ULong  guest_GDT; /* host addr, a VexGuestX86SegDescr* */
@@ -213,11 +214,6 @@ typedef
       /* Used for Darwin syscall dispatching. */
       UInt guest_SC_CLASS;
 
-      /* Needed for Darwin (but mandated for all guest architectures):
-         EIP at the last syscall insn (int 0x80/81/82, sysenter,
-         syscall).  Used when backing up to restart a syscall that has
-         been interrupted by a signal. */
-      UInt guest_IP_AT_SYSCALL;
 
       /* Padding to make it have an 16-aligned size */
       UInt padding1;
@@ -226,6 +222,8 @@ typedef
    }
    VexGuestX86State;
 
+_Static_assert(sizeof(VexGuestX86State)%16 == 0, "sizeof VexGuestX86State is not a multiple of 16");
+
 #define VEX_GUEST_X86_LDT_NENT /*64*/ 8192 /* use complete LDT */
 #define VEX_GUEST_X86_GDT_NENT /*16*/ 8192 /* use complete GDT */
 
index 3a1f92f45c16db716b1af81f4c090ecf2f57a848..d2c77a07ff0dc7cd92b946a7d5072971800a1196 100644 (file)
@@ -2493,18 +2493,6 @@ extern Bool eqIRAtom ( const IRExpr*, const IRExpr* );
 
    In the case of Ijk_EmFail, the exit is fatal (Vex-generated code
    cannot continue) and so the jump destination can be anything.
-
-   Re Ijk_Sys_ (syscall jumps): the guest state must have a
-   pseudo-register guest_IP_AT_SYSCALL, which is the size of a guest
-   word.  Front ends should set this to be the IP at the most recently
-   executed kernel-entering (system call) instruction.  This makes it
-   very much easier (viz, actually possible at all) to back up the
-   guest to restart a syscall that has been interrupted by a signal.
-
-   Re Ijk_Extension: the guest state must have the pseudo-register
-   guest_IP_AT_SYSCALL, which is also used for Ijk_Sys_*.  Front ends
-   must set this to the current instruction address before jumping to
-   an extension handler.
 */
 typedef
    enum {
index 1d5c5c19f6521823c966396281bc86ff871a679f..f798e0e512d36a0915eba4c0087fd3b61e0383d5 100644 (file)
@@ -173,7 +173,6 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
    if (o == GOF(CTR) && sz == 8) return o;
 
    if (o == GOF(CIA)       && sz == 8) return -1;
-   if (o == GOF(IP_AT_SYSCALL) && sz == 8) return -1; /* slot unused */
    if (o == GOF(FPROUND)   && sz == 1) return -1;
    if (o == GOF(DFPROUND)  && sz == 1) return -1;
    if (o == GOF(C_FPCC)    && sz == 1) return -1;
@@ -452,7 +451,6 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
    if (o == GOF(CTR) && sz == 4) return o;
 
    if (o == GOF(CIA)       && sz == 4) return -1;
-   if (o == GOF(IP_AT_SYSCALL) && sz == 4) return -1; /* slot unused */
    if (o == GOF(FPROUND)   && sz == 1) return -1;
    if (o == GOF(DFPROUND)  && sz == 1) return -1;
    if (o == GOF(C_FPCC)    && sz == 1) return -1;
@@ -646,7 +644,6 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
    if (o == GOF(CC_NDEP) && sz == 8) return -1; /* slot used for %BH */
    if (o == GOF(DFLAG)   && sz == 8) return -1; /* slot used for %CH */
    if (o == GOF(RIP)     && sz == 8) return -1; /* slot unused */
-   if (o == GOF(IP_AT_SYSCALL) && sz == 8) return -1; /* slot unused */
    if (o == GOF(TLSBASE) && sz == 8) return -1; /* slot unused */
    if (o == GOF(IDFLAG)  && sz == 8) return -1; /* slot used for %DH */
    if (o == GOF(ACFLAG)  && sz == 8) return -1; /* slot unused */
@@ -762,7 +759,6 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
    if (o == GOF(CC_NDEP) && sz == 4) return -1; /* slot used for %BH */
    if (o == GOF(DFLAG)   && sz == 4) return -1; /* slot used for %CH */
    if (o == GOF(EIP)     && sz == 4) return -1; /* slot unused */
-   if (o == GOF(IP_AT_SYSCALL) && sz == 4) return -1; /* slot unused */
    if (o == GOF(IDFLAG)  && sz == 4) return -1; /* slot used for %DH */
    if (o == GOF(ACFLAG)  && sz == 4) return -1; /* slot unused */
    if (o == GOF(CMSTART) && sz == 4) return -1; /* slot unused */
@@ -887,7 +883,6 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
    if (o == GOF(CMSTART)  && sz == 8) return -1;
    if (o == GOF(CMLEN)    && sz == 8) return -1;
    if (o == GOF(NRADDR)   && sz == 8) return -1;
-   if (o == GOF(IP_AT_SYSCALL) && sz == 8) return -1;
    if (o == GOF(fpc)      && sz == 4) return -1;
    if (o == GOF(IA)       && sz == 8) return -1;
    if (o == (GOF(IA) + 4) && sz == 4) return -1;