Discussion:
[Valgrind-developers] vex: r3398 - /trunk/priv/guest_ppc_toIR.c
s***@valgrind.org
2017-06-20 17:55:14 UTC
Permalink
Author: mjw
Date: Tue Jun 20 18:55:13 2017
New Revision: 3398

Log:
Bug 381274 powerpc too chatty even with --sigill-diagnostics=no.

Even with valgrind --sigill-diagnostics=no (or -q) guest_ppc_toIR.c
will report various cases why it didn't handle an instruction. e.g.

disInstr(ppc): found the Power 8 instruction 0x10000508 that can't be
handled by Valgrind on this host. This instruction requires a host
that supports Power 8 instructions.

After which valgrind will generate a SIGILL. But in case the user uses
-q or --sigill-diagnostics=no they aren't interested in that diagnostics.
For example openssl will try some power 8 instructions while initializing
and catch the SIGILL if not supported without issue.

Guard those cases with if (sigill_diag) like the generic decode_failure.

Modified:
trunk/priv/guest_ppc_toIR.c

Modified: trunk/priv/guest_ppc_toIR.c
==============================================================================
--- trunk/priv/guest_ppc_toIR.c (original)
+++ trunk/priv/guest_ppc_toIR.c Tue Jun 20 18:55:13 2017
@@ -29356,62 +29356,70 @@

decode_noF:
vassert(!allow_F);
- vex_printf("disInstr(ppc): found the Floating Point instruction 0x%x that\n"
- "can't be handled by Valgrind on this host. This instruction\n"
- "requires a host that supports Floating Point instructions.\n",
- theInstr);
+ if (sigill_diag)
+ vex_printf("disInstr(ppc): found the Floating Point instruction 0x%x that\n"
+ "can't be handled by Valgrind on this host. This instruction\n"
+ "requires a host that supports Floating Point instructions.\n",
+ theInstr);
goto not_supported;
decode_noV:
vassert(!allow_V);
- vex_printf("disInstr(ppc): found an AltiVec or an e500 instruction 0x%x\n"
- "that can't be handled by Valgrind. If this instruction is an\n"
- "Altivec instruction, Valgrind must be run on a host that supports"
- "AltiVec instructions. If the application was compiled for e500, then\n"
- "unfortunately Valgrind does not yet support e500 instructions.\n",
- theInstr);
+ if (sigill_diag)
+ vex_printf("disInstr(ppc): found an AltiVec or an e500 instruction 0x%x\n"
+ "that can't be handled by Valgrind. If this instruction is an\n"
+ "Altivec instruction, Valgrind must be run on a host that supports"
+ "AltiVec instructions. If the application was compiled for e500, then\n"
+ "unfortunately Valgrind does not yet support e500 instructions.\n",
+ theInstr);
goto not_supported;
decode_noVX:
vassert(!allow_VX);
- vex_printf("disInstr(ppc): found the instruction 0x%x that is defined in the\n"
- "Power ISA 2.06 ABI but can't be handled by Valgrind on this host.\n"
- "This instruction \nrequires a host that supports the ISA 2.06 ABI.\n",
- theInstr);
+ if (sigill_diag)
+ vex_printf("disInstr(ppc): found the instruction 0x%x that is defined in the\n"
+ "Power ISA 2.06 ABI but can't be handled by Valgrind on this host.\n"
+ "This instruction \nrequires a host that supports the ISA 2.06 ABI.\n",
+ theInstr);
goto not_supported;
decode_noFX:
vassert(!allow_FX);
- vex_printf("disInstr(ppc): found the General Purpose-Optional instruction 0x%x\n"
- "that can't be handled by Valgrind on this host. This instruction\n"
- "requires a host that supports the General Purpose-Optional instructions.\n",
- theInstr);
+ if (sigill_diag)
+ vex_printf("disInstr(ppc): found the General Purpose-Optional instruction 0x%x\n"
+ "that can't be handled by Valgrind on this host. This instruction\n"
+ "requires a host that supports the General Purpose-Optional instructions.\n",
+ theInstr);
goto not_supported;
decode_noGX:
vassert(!allow_GX);
- vex_printf("disInstr(ppc): found the Graphics-Optional instruction 0x%x\n"
- "that can't be handled by Valgrind on this host. This instruction\n"
- "requires a host that supports the Graphic-Optional instructions.\n",
- theInstr);
+ if (sigill_diag)
+ vex_printf("disInstr(ppc): found the Graphics-Optional instruction 0x%x\n"
+ "that can't be handled by Valgrind on this host. This instruction\n"
+ "requires a host that supports the Graphic-Optional instructions.\n",
+ theInstr);
goto not_supported;
decode_noDFP:
vassert(!allow_DFP);
- vex_printf("disInstr(ppc): found the decimal floating point (DFP) instruction 0x%x\n"
- "that can't be handled by Valgrind on this host. This instruction\n"
- "requires a host that supports DFP instructions.\n",
- theInstr);
+ if (sigill_diag)
+ vex_printf("disInstr(ppc): found the decimal floating point (DFP) instruction 0x%x\n"
+ "that can't be handled by Valgrind on this host. This instruction\n"
+ "requires a host that supports DFP instructions.\n",
+ theInstr);
goto not_supported;
decode_noP8:
vassert(!allow_isa_2_07);
- vex_printf("disInstr(ppc): found the Power 8 instruction 0x%x that can't be handled\n"
- "by Valgrind on this host. This instruction requires a host that\n"
- "supports Power 8 instructions.\n",
- theInstr);
+ if (sigill_diag)
+ vex_printf("disInstr(ppc): found the Power 8 instruction 0x%x that can't be handled\n"
+ "by Valgrind on this host. This instruction requires a host that\n"
+ "supports Power 8 instructions.\n",
+ theInstr);
goto not_supported;

decode_noP9:
vassert(!allow_isa_3_0);
- vex_printf("disInstr(ppc): found the Power 9 instruction 0x%x that can't be handled\n"
- "by Valgrind on this host. This instruction requires a host that\n"
- "supports Power 9 instructions.\n",
- theInstr);
+ if (sigill_diag)
+ vex_printf("disInstr(ppc): found the Power 9 instruction 0x%x that can't be handled\n"
+ "by Valgrind on this host. This instruction requires a host that\n"
+ "supports Power 9 instructions.\n",
+ theInstr);
goto not_supported;

decode_failure:

Loading...