]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
PowerPC, dcbf instruction
authorCarl Love <cel@linux.ibm.com>
Wed, 23 Oct 2024 23:25:23 +0000 (18:25 -0500)
committerCarl Love <carll@us.ibm.com>
Thu, 24 Oct 2024 00:51:39 +0000 (19:51 -0500)
ISA 2.7 and ISA 3.0 "accepts" L = 0 to 3, ISA 3.1 "accepts: L = 0 to 7.
Removed the L field check so valgrind will match the real hardware.  For
the purposes of Valgrind the dcbf instruction is a NOP anyway so it will
not change the behavior of Valgrind.

NEWS
VEX/priv/guest_ppc_toIR.c

diff --git a/NEWS b/NEWS
index b375fa2687ce93259ce7f1a036350c660964ce6d..acefe24188c6d787d849e75db74848ad251c6d80 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -81,6 +81,8 @@ are not entered into bugzilla tend to get forgotten about or ignored.
         FUSE_COMPATIBLE_MAY_BLOCK
 493970  s390x: Store/restore FPC upon helper call causes slowdown
 494252  s390x: incorrect disassembly for LOCHI and friends
+495278  PowerPC instruction dcbf should allow the L field values of 4, 6 on
+        ISA 3.0 and earlier, just ignore the value
 n-i-bz  Improve messages for sigaltstack errors, use specific
         stack_t member names
 
index d05cce394d88bdd7ed15f66167c19090b4644ba2..94930aa1c9a9ae086a0d70a8174d872f70b9e220 100644 (file)
@@ -12145,7 +12145,10 @@ static Bool dis_cache_manage ( UInt prefix, UInt theInstr,
    UChar opc1    = ifieldOPC(theInstr);
    UChar b21to25 = ifieldRegDS(theInstr);
    /* The L-field is 2 bits in ISA 3.0 and earlier and 3 bits in ISA 3.1 */
-   UChar flag_L  = IFIELD(theInstr, 21, (allow_isa_3_1 ? 3 : 2));
+   /* Relaxed the test to mach actual hardware, accept all L values from 0 to 7.
+      The hardware ignores the L value if not supported.      10/23/2024
+      UChar flag_L  = IFIELD(theInstr, 21, (allow_isa_3_1 ? 3 : 2));  */
+
    UChar rA_addr = ifieldRegA(theInstr);
    UChar rB_addr = ifieldRegB(theInstr);
    UInt  opc2    = ifieldOPClo10(theInstr);
@@ -12203,15 +12206,19 @@ static Bool dis_cache_manage ( UInt prefix, UInt theInstr,
          dcbf ra, rb, 0          dcbf
          dcbf ra, rb, 1          dcbf local
          dcbf ra, rb, 3          dcbf local primary
-         dcbf ra, rb, 4          dcbf block fjush to persistent storage    isa 3.1
-         dcbf ra, rb, 6          dcbf block store to persistent storage    isa 3.1
- */
-               if (!((flag_L == 0 || flag_L == 1 || flag_L == 3)
-               || ((flag_L == 4 || flag_L == 6) && allow_isa_3_1 == True)))
+         dcbf ra, rb, 4          dcbf block fjush to persistent storage isa 3.1
+         dcbf ra, rb, 6          dcbf block store to persistent storage isa 3.1
+         Relaxed requirement to allow all L values from 0 to 7 to match the
+         operation of the real hardware.  The real hardware accepts the
+         unsupported L values.      10/23/2024
+
+         if (!((flag_L == 0 || flag_L == 1 || flag_L == 3)
+           || ((flag_L == 4 || flag_L == 6) && allow_isa_3_1 == True)))
          {
             vex_printf("dis_cache_manage(ppc)(dcbf,flag_L)\n");
             return False;
          }
+      */
       /* nop as far as vex is concerned */
       break;