]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 511329 - Darwin and FreeBSD: Move setting of carry flag out of ML_(do_syscall_for...
authorPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 29 Oct 2025 21:09:08 +0000 (22:09 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 29 Oct 2025 21:16:46 +0000 (22:16 +0100)
Remove guest_SETC and GENOFFSET

NEWS
VEX/auxprogs/genoffsets.c
VEX/priv/guest_amd64_helpers.c
VEX/priv/guest_x86_helpers.c
VEX/pub/libvex_guest_amd64.h
VEX/pub/libvex_guest_arm64.h
VEX/pub/libvex_guest_x86.h
coregrind/m_syswrap/syswrap-main.c

diff --git a/NEWS b/NEWS
index 2ecf886a20db5044f053021a3efe7b1af2ff68eb..526969ebfa035cb1f81c70e112bb0f8f4c49c44d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,8 @@ than mailing the developers (or mailing lists) directly -- bugs that
 are not entered into bugzilla tend to get forgotten about or ignored.
 
 487055  memcheck/tests/x86-linux/scalar fails running in Docker
+511329  Darwin and FreeBSD: Move setting of carry flag out of
+        ML_(do_syscall_for_client_WRK)
 
 To see details of a given bug, visit
   https://bugs.kde.org/show_bug.cgi?id=XXXXXX
index 07ff09be7d6fba0fb5b1ecd147faf09afffc6027..914dbee747969f5ff7c780c94816effb024d3c3e 100644 (file)
@@ -98,7 +98,6 @@ void foo ( void )
    GENOFFSET(X86,x86,FS);
    GENOFFSET(X86,x86,GS);
    GENOFFSET(X86,x86,SS);
-   GENOFFSET(X86,x86,SETC);
 
    // amd64
    GENOFFSET(AMD64,amd64,RAX);
@@ -118,7 +117,6 @@ void foo ( void )
    GENOFFSET(AMD64,amd64,R14);
    GENOFFSET(AMD64,amd64,R15);
    GENOFFSET(AMD64,amd64,RIP);
-   GENOFFSET(AMD64,amd64,SETC);
 
    // ppc32
    GENOFFSET(PPC32,ppc32,GPR0);
@@ -174,7 +172,6 @@ void foo ( void )
    GENOFFSET(ARM64,arm64,X8);
    GENOFFSET(ARM64,arm64,XSP);
    GENOFFSET(ARM64,arm64,PC);
-   GENOFFSET(ARM64,arm64,SETC);
 
    // s390x
    GENOFFSET(S390X,s390x,r2);
index ca33f7c8182141820bba76cf3e1c0fb594926a3b..b8fa52460c7bd87bff9b5c913ff1b568c55d8851 100644 (file)
@@ -4820,8 +4820,6 @@ void LibVEX_GuestAMD64_initialise ( /*OUT*/VexGuestAMD64State* vex_state )
 
    vex_state->guest_EMNOTE = EmNote_NONE;
 
-   vex_state->guest_SETC = 0;
-
    /* These should not ever be either read or written, but we
       initialise them anyway. */
    vex_state->guest_CMSTART = 0;
index 90722d7673db265965d0287e18c482c7560a4955..f744ff53ee30fb89dd182e27a202289c073fab61 100644 (file)
@@ -2914,8 +2914,6 @@ void LibVEX_GuestX86_initialise ( /*OUT*/VexGuestX86State* vex_state )
    vex_state->guest_SC_CLASS = 0;
    vex_state->guest_IP_AT_SYSCALL = 0;
 
-   vex_state->guest_SETC = 0;
-
    vex_state->padding1 = 0;
    vex_state->padding2 = 0;
 }
index e96b6b0f3fd1592e9e20caa0d5d86df7f9c6a3dc..1e2ca5dc64930191549bba1fa5972f5e46ea6193 100644 (file)
@@ -131,10 +131,7 @@ typedef
 
       /* Emulation notes */
       UInt  guest_EMNOTE;
-      /* Used by Darwin and FreeBSD when setting the carry flag from
-       * ML_(do_syscall_for_client_WRK). Needed to determine how
-       * to restart interrupted syscalls. */
-      UInt guest_SETC;
+      UInt  pad2;
 
       /* Translation-invalidation area description.  Not used on amd64
          (there is no invalidate-icache insn), but needed so as to
index 30317dae65f91d92f5824c10fdcd72006fc9373c..35b417348eaa08072abaf361ca04f66f6d7fa493 100644 (file)
@@ -168,18 +168,12 @@ typedef
 
       /* Used for FreeBSD syscall dispatching. */
       ULong guest_SC_CLASS;
-      /* Used for FreeBSD client syscall when putting the carry flag
-         value into VEX. */
-      UInt guest_SETC;
-      UInt pad_end_0;
       /* Padding to make it have an 16-aligned size */
-      /* UInt  pad_end_1; */
-      /* ULong pad_end_2; */
+      ULong pad_end_1;
 
    }
    VexGuestARM64State;
 
-
 /*---------------------------------------------------------------*/
 /*--- Utility functions for ARM64 guest stuff.                ---*/
 /*---------------------------------------------------------------*/
index 80916a2bab55f78d5645274dac44e506c7712d85..baf13f402caa45c06be2862969ba332331fe8eea 100644 (file)
@@ -219,11 +219,10 @@ typedef
          been interrupted by a signal. */
       UInt guest_IP_AT_SYSCALL;
 
-      UInt guest_SETC;
-
       /* Padding to make it have an 16-aligned size */
       UInt padding1;
       UInt padding2;
+      UInt padding3;
    }
    VexGuestX86State;
 
index 64fa3c325b8b2c7e8e04af2bb420bb31420fecd2..49c264c40e231e39a76bfd7caa1e5ed933fd6111 100644 (file)
@@ -3355,18 +3355,6 @@ VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid,
 #    error "Unknown OS"
 #  endif
 
-#if defined(VGO_freebsd) || defined(VGO_darwin)
-  if (outside_range)
-  {
-     if (th_regs->vex.guest_SETC)
-     {
-        outside_range = False;
-        in_complete_to_committed = True;
-     }
-  }
-#endif
-
-
    /* Figure out what the state of the syscall was by examining the
       (real) IP at the time of the signal, and act accordingly. */
    if (outside_range) {