# 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-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 13fef872f8b33431ebb920915252cafc651092dd # < make -s -j 24 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc86xx_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc86xx_defconfig # make -s -j 24 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc86xx_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/kernel/futex.c: In function 'do_futex': /kisskb/src/kernel/futex.c:1658:17: warning: 'oldval' may be used uninitialized in this function [-Wmaybe-uninitialized] return oldval == cmparg; ^ /kisskb/src/kernel/futex.c:1633:6: note: 'oldval' was declared here int oldval, ret; ^ /kisskb/src/arch/powerpc/boot/dts/fsl/mvme7100.dts:140.22-142.4: Warning (pci_bridge): /pcie@f1008000: missing ranges for PCI bridge (or not a bridge) also defined at /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8641si-post.dtsi:97.7-122.3 /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8641si-post.dtsi:107.9-121.4: Warning (pci_bridge): /pcie@f1008000/pcie@0: missing ranges for PCI bridge (or not a bridge) /kisskb/src/arch/powerpc/boot/dts/fsl/mvme7100.dts:144.22-146.4: Warning (pci_bridge): /pcie@f1009000: missing ranges for PCI bridge (or not a bridge) also defined at /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8641si-post.dtsi:124.7-149.3 /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8641si-post.dtsi:134.9-148.4: Warning (pci_bridge): /pcie@f1009000/pcie@0: missing ranges for PCI bridge (or not a bridge) arch/powerpc/boot/dts/fsl/mvme7100.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge' /kisskb/src/arch/powerpc/boot/dts/fsl/mvme7100.dts:35.11-37.6: Warning (i2c_bus_reg): /soc@f1000000/i2c@3000/rtc@68: missing or empty reg property INFO: Uncompressed kernel (size 0xa4b0c4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xb00000) Image Name: Linux-5.2.0-rc1-g13fef872f8b3 Created: Thu May 23 20:34:01 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5082424 Bytes = 4963.30 KiB = 4.85 MiB Load Address: 00000000 Entry Point: 00000000 Completed OK # rm -rf /kisskb/build/powerpc-next_mpc86xx_defconfig_powerpc-gcc5 # Build took: 0:02:01.181225