From: Carl Love Date: Wed, 7 Sep 2022 16:59:03 +0000 (-0500) Subject: PowerPC: Fix the L field for the sync and dcbf instructions. X-Git-Tag: VALGRIND_3_20_0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88b32483c6211f902848c2c944d72516c28af821;p=thirdparty%2Fvalgrind.git PowerPC: Fix the L field for the sync and dcbf instructions. The L field for the sync and dcbf instructions are three bits wide starting with ISA 3.1. The L field is two bits wide prior to ISA 3.1. Patch based on patches from Shivaprasad Bhat --- diff --git a/NEWS b/NEWS index b3c3590b90..a16cd82bd5 100644 --- a/NEWS +++ b/NEWS @@ -45,6 +45,8 @@ are not entered into bugzilla tend to get forgotten about or ignored. 454040 s390x: False-positive memcheck:cond in memmem on arch13 systems 456171 [PATCH] FreeBSD: Don't record address errors when accessing the 'kern.ps_strings' sysctl struct n-i-bz Implement vgdb invoker on FreeBSD +458845 PowerPC: The L field for the dcbf and sync instruction should be + 3 bits in ISA 3.1. To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c index 5da4ce7fad..41d7bf65c0 100644 --- a/VEX/priv/guest_ppc_toIR.c +++ b/VEX/priv/guest_ppc_toIR.c @@ -10821,7 +10821,8 @@ static Bool dis_memsync ( UInt prefix, UInt theInstr, /* X-Form, XL-Form */ UChar opc1 = ifieldOPC(theInstr); UInt b11to25 = IFIELD(theInstr, 11, 15); - UChar flag_L = IFIELD(theInstr, 21, 2); //ISA 3.0 + /* 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)); UInt b11to20 = IFIELD(theInstr, 11, 10); UInt M0 = IFIELD(theInstr, 11, 5); UChar rD_addr = ifieldRegDS(theInstr); @@ -12143,7 +12144,8 @@ static Bool dis_cache_manage ( UInt prefix, UInt theInstr, /* X-Form */ UChar opc1 = ifieldOPC(theInstr); UChar b21to25 = ifieldRegDS(theInstr); - UChar flag_L = IFIELD(theInstr, 21, 2); + /* 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)); UChar rA_addr = ifieldRegA(theInstr); UChar rB_addr = ifieldRegB(theInstr); UInt opc2 = ifieldOPClo10(theInstr);