# git rev-parse -q --verify c790c3d2b0ec5979d83451d0688d1cd07e23d8ba^{commit} c790c3d2b0ec5979d83451d0688d1cd07e23d8ba already have revision, skipping fetch # git checkout -q -f -B kisskb c790c3d2b0ec5979d83451d0688d1cd07e23d8ba # git clean -qxdf # < git log -1 # commit c790c3d2b0ec5979d83451d0688d1cd07e23d8ba # 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 # Signed-off-by: Michael Ellerman # Link: https://lore.kernel.org/r/20190520105520.22274-1-mpe@ellerman.id.au # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-ld --version # < git log --format=%s --max-count=1 c790c3d2b0ec5979d83451d0688d1cd07e23d8ba # < make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next-rand_powerpc-randconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- randconfig KCONFIG_SEED=0x4C624E00 # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_CPU_BIG_ENDIAN=y # Added to kconfig CONFIG_PPC64=y # Added to kconfig CONFIG_PPC_DISABLE_WERROR=y # Added to kconfig CONFIG_SECTION_MISMATCH_WARN_ONLY=y # Added to kconfig CONFIG_PREVENT_FIRMWARE_BUILD=y # Added to kconfig CONFIG_CC_STACKPROTECTOR_STRONG=n # Added to kconfig CONFIG_GCC_PLUGINS=n # Added to kconfig CONFIG_LD_HEAD_STUB_CATCH=y # Added to kconfig CONFIG_TRIM_UNUSED_KSYMS=n # Added to kconfig CONFIG_UBSAN=n # yes \n | make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next-rand_powerpc-randconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- oldconfig yes: standard output: Broken pipe # make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next-rand_powerpc-randconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:204:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1852:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2591:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/arch/powerpc/kernel/iommu.c:136:30: warning: 'fail_iommu_bus_notifier' defined but not used [-Wunused-variable] /kisskb/src/mm/hugetlb.c: In function 'alloc_pool_huge_page': /kisskb/src/mm/hugetlb.c:1497:5: warning: 'page' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/infiniband/sw/siw/siw_qp_rx.c: In function 'siw_rqe_get': /kisskb/src/include/linux/spinlock.h:393:2: warning: 'flags' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/infiniband/sw/siw/siw_qp_rx.c:335:16: note: 'flags' was declared here /kisskb/src/drivers/tty/serial/8250/8250_core.c: In function 'serial_unlink_irq_chain': /kisskb/src/drivers/tty/serial/8250/8250_core.c:248:18: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/bridge/br_netlink.c: In function 'br_process_vlan_info': /kisskb/src/net/bridge/br_netlink.c:587:10: warning: 'err' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/mac80211/mlme.c: In function 'ieee80211_handle_pwr_constr.isra.19': /kisskb/src/net/mac80211/mlme.c:1573:6: warning: 'pwr_level_cisco' may be used uninitialized in this function [-Wuninitialized] WARNING: vmlinux.o(.text.unlikely+0x78c): Section mismatch in reference from the function .smp_setup_pacas() to the function .init.text:.allocate_paca() The function .smp_setup_pacas() references the function __init .allocate_paca(). This is often because .smp_setup_pacas lacks a __init annotation or the annotation of .allocate_paca is wrong. WARNING: vmlinux.o (.PPC.EMB.apuinfo): unexpected non-allocatable section. Did you forget to use "ax"/"aw" in a .S file? Note that for example contains section definitions for use in .S files. WARNING: 4 bad relocations c0000000000188d2 R_PPC64_ADDR16_HIGHEST .head.text+0x00000000000188ec c0000000000188d6 R_PPC64_ADDR16_HI .head.text+0x00000000000188ec c0000000000188da R_PPC64_ADDR16_HIGHER .head.text+0x00000000000188ec c0000000000188de R_PPC64_ADDR16_LO .head.text+0x00000000000188ec INFO: Uncompressed kernel (size 0x1895c40) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x1900000) Image Name: Linux-5.4.0-rc2-gc790c3d2b0ec Created: Wed Oct 30 23:10:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 8760079 Bytes = 8554.76 KiB = 8.35 MiB Load Address: 00000000 Entry Point: 00000000 Completed OK # rm -rf /kisskb/build/powerpc-next-rand_powerpc-randconfig_powerpc-gcc4.6 # Build took: 0:01:10.845231