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);
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);
vex_state->guest_SC_CLASS = 0;
vex_state->guest_GS_CONST = 0;
- vex_state->guest_IP_AT_SYSCALL = 0;
vex_state->guest_TLSBASE = 0;
}
/* 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
/* 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)
}
};
//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;
/* 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
/* 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)
}
};
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;
/* 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
/* 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)
}
};
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 )
vex_state->guest_LLaddr = 0xFFFFFFFFFFFFFFFFULL;
vex_state->guest_LLdata = 0;
- vex_state->guest_IP_AT_SYSCALL = 0;
-
vex_state->guest_MSACSR = 0;
}
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
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;
/* Describe any sections to be regarded by Memcheck as
'always-defined'. */
- .n_alwaysDefd = 12,
+ .n_alwaysDefd = 11,
.alwaysDefd
= { /* 0 */ ALWAYSDEFD32(guest_CIA),
/* 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)
}
};
/* Describe any sections to be regarded by Memcheck as
'always-defined'. */
- .n_alwaysDefd = 12,
+ .n_alwaysDefd = 11,
.alwaysDefd
= { /* 0 */ ALWAYSDEFD64(guest_CIA),
/* 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)
}
};
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)
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
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 ) );
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. */
/* 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
/* 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 */
}
};
/* 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
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;
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;
}
/* 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
/* 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)
}
};
#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. ---*/
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);
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");
}
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");
{ 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) },
# error "Vex: Fatal: Can't establish the host architecture"
#endif
-
#endif /* ndef __LIBVEX_BASICTYPES_H */
/*---------------------------------------------------------------*/
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
/*---------------------------------------------------------------*/
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 */
}
VexGuestARMState;
+_Static_assert(sizeof(VexGuestARMState)%16 == 0, "sizeof VexGuestX86State is not a multiple of 16");
/*---------------------------------------------------------------*/
/*--- Utility functions for ARM guest stuff. ---*/
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
/* 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. ---*/
/*---------------------------------------------------------------*/
/* 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. ---*/
/*---------------------------------------------------------------*/
/* 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. ---*/
/*---------------------------------------------------------------*/
/* 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. ---*/
/* 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
/* 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. ---*/
/* 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 ---*/
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* */
/* 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;
}
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 */
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 {
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;
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;
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 */
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 */
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;