# git rev-parse -q --verify 13fef872f8b33431ebb920915252cafc651092dd^{commit} 13fef872f8b33431ebb920915252cafc651092dd already have revision, skipping fetch # git checkout -q -f -B kisskb 13fef872f8b33431ebb920915252cafc651092dd # git clean -qxdf # < git log -1 # commit 13fef872f8b33431ebb920915252cafc651092dd # Author: Michael Ellerman # Date: Mon May 20 20:55:20 2019 +1000 # # selftests/powerpc: Add a test of spectre_v2 mitigations # # This test uses the PMU to count branch prediction hits/misses for a # known loop, and compare the result to the reported spectre v2 # mitigation. # # This gives us a way of sanity checking that the reported mitigation is # actually in effect. # # Sample output for some cases, eg: # # Power9: # sysfs reports: 'Vulnerable' # PM_BR_PRED_CCACHE: result 368 running/enabled 5792777124 # PM_BR_MPRED_CCACHE: result 319 running/enabled 5792775546 # PM_BR_PRED_PCACHE: result 2147483281 running/enabled 5792773128 # PM_BR_MPRED_PCACHE: result 213604201 running/enabled 5792771640 # Miss percent 9 % # OK - Measured branch prediction rates match reported spectre v2 mitigation. # # sysfs reports: 'Mitigation: Indirect branch serialisation (kernel only)' # PM_BR_PRED_CCACHE: result 895 running/enabled 5780320920 # PM_BR_MPRED_CCACHE: result 822 running/enabled 5780312414 # PM_BR_PRED_PCACHE: result 2147482754 running/enabled 5780308836 # PM_BR_MPRED_PCACHE: result 213639731 running/enabled 5780307912 # Miss percent 9 % # OK - Measured branch prediction rates match reported spectre v2 mitigation. # # sysfs reports: 'Mitigation: Indirect branch cache disabled' # PM_BR_PRED_CCACHE: result 2147483649 running/enabled 20540186160 # PM_BR_MPRED_CCACHE: result 2147483649 running/enabled 20540180056 # PM_BR_PRED_PCACHE: result 0 running/enabled 20540176090 # PM_BR_MPRED_PCACHE: result 0 running/enabled 20540174182 # Miss percent 100 % # OK - Measured branch prediction rates match reported spectre v2 mitigation. # # Power8: # sysfs reports: 'Vulnerable' # PM_BR_PRED_CCACHE: result 2147483649 running/enabled 3505888142 # PM_BR_MPRED_CCACHE: result 9 running/enabled 3505882788 # Miss percent 0 % # OK - Measured branch prediction rates match reported spectre v2 mitigation. # # sysfs reports: 'Mitigation: Indirect branch cache disabled' # PM_BR_PRED_CCACHE: result 2147483649 running/enabled 16931421988 # PM_BR_MPRED_CCACHE: result 2147483649 running/enabled 16931416478 # Miss percent 100 % # OK - Measured branch prediction rates match reported spectre v2 mitigation. # success: spectre_v2 # # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux-ld --version # < git log --format=%s --max-count=1 13fef872f8b33431ebb920915252cafc651092dd # < make -s -j 24 ARCH=parisc O=/kisskb/build/powerpc-next_parisc-defconfig_parisc CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- defconfig # make -s -j 24 ARCH=parisc O=/kisskb/build/powerpc-next_parisc-defconfig_parisc CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- In file included from /kisskb/src/arch/parisc/math-emu/fcnvxf.c:51: /kisskb/src/arch/parisc/math-emu/fcnvxf.c: In function 'sgl_to_sgl_fcnvxf': /kisskb/src/arch/parisc/math-emu/cnv_float.h:63:52: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context] #define Int_isinexact_to_sgl(int_value) (int_value << 33 - SGL_EXP_LENGTH) ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fcnvxf.c:101:6: note: in expansion of macro 'Int_isinexact_to_sgl' if (Int_isinexact_to_sgl(src)) { ^~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/cnv_float.h:67:21: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context] if ((int_value << 34 - SGL_EXP_LENGTH) || Slow(sgl_value)) \ ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fcnvxf.c:112:5: note: in expansion of macro 'Sgl_roundnearest_from_int' Sgl_roundnearest_from_int(src,result); ^~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fcnvxf.c: In function 'dbl_to_sgl_fcnvxf': /kisskb/src/arch/parisc/math-emu/cnv_float.h:71:27: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context] ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB)) ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fcnvxf.c:257:6: note: in expansion of macro 'Dint_isinexact_to_sgl' if (Dint_isinexact_to_sgl(srcp1,srcp2)) { ^~~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/cnv_float.h:75:31: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context] if ((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) || \ ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fcnvxf.c:268:5: note: in expansion of macro 'Sgl_roundnearest_from_dint' Sgl_roundnearest_from_dint(srcp1,srcp2,result); ^~~~~~~~~~~~~~~~~~~~~~~~~~ Completed OK # rm -rf /kisskb/build/powerpc-next_parisc-defconfig_parisc # Build took: 0:01:15.476862