# git rev-parse -q --verify bbbca72352bb9484bc057c91a408332b35ee8f4c^{commit} bbbca72352bb9484bc057c91a408332b35ee8f4c already have revision, skipping fetch # git checkout -q -f -B kisskb bbbca72352bb9484bc057c91a408332b35ee8f4c # git clean -qxdf # < git log -1 # commit bbbca72352bb9484bc057c91a408332b35ee8f4c # Author: Vaibhav Jain # Date: Tue Jan 25 01:52:04 2022 +0530 # # powerpc/papr_scm: Implement initial support for injecting smart errors # # Presently PAPR doesn't support injecting smart errors on an # NVDIMM. This makes testing the NVDIMM health reporting functionality # difficult as simulating NVDIMM health related events need a hacked up # qemu version. # # To solve this problem this patch proposes simulating certain set of # NVDIMM health related events in papr_scm. Specifically 'fatal' health # state and 'dirty' shutdown state. These error can be injected via the # user-space 'ndctl-inject-smart(1)' command. With the proposed patch and # corresponding ndctl patches following command flow is expected: # # $ sudo ndctl list -DH -d nmem0 # ... # "health_state":"ok", # "shutdown_state":"clean", # ... # # inject unsafe shutdown and fatal health error # $ sudo ndctl inject-smart nmem0 -Uf # ... # "health_state":"fatal", # "shutdown_state":"dirty", # ... # # uninject all errors # $ sudo ndctl inject-smart nmem0 -N # ... # "health_state":"ok", # "shutdown_state":"clean", # ... # # The patch adds a new member 'health_bitmap_inject_mask' inside struct # papr_scm_priv which is then bitwise ANDed to the health bitmap fetched from the # hypervisor. The value for 'health_bitmap_inject_mask' is accessible from sysfs # at nmemX/papr/health_bitmap_inject. # # A new PDSM named 'SMART_INJECT' is proposed that accepts newly # introduced 'struct nd_papr_pdsm_smart_inject' as payload thats # exchanged between libndctl and papr_scm to indicate the requested # smart-error states. # # When the processing the PDSM 'SMART_INJECT', papr_pdsm_smart_inject() # constructs a pair or 'inject_mask' and 'clear_mask' bitmaps from the payload # and bit-blt it to the 'health_bitmap_inject_mask'. This ensures the after being # fetched from the hypervisor, the health_bitmap reflects requested smart-error # states. # # Signed-off-by: Vaibhav Jain # Signed-off-by: Shivaprasad G Bhat # Signed-off-by: Michael Ellerman # Link: https://lore.kernel.org/r/20220124202204.1488346-1-vaibhav@linux.ibm.com # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 bbbca72352bb9484bc057c91a408332b35ee8f4c # < make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc85xx_defconfig # Added to kconfig CONFIG_PPC_E500MC=y # Added to kconfig CONFIG_VIRTUALIZATION=y # Added to kconfig CONFIG_KVM_E500MC=y # Added to kconfig # < make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig .config:4324:warning: override: reassigning to symbol PPC_E500MC .config:4325:warning: override: reassigning to symbol VIRTUALIZATION # make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from /kisskb/src/include/linux/bitops.h:33, from /kisskb/src/include/linux/kernel.h:22, from /kisskb/src/include/linux/cpumask.h:10, from /kisskb/src/include/linux/smp.h:13, from /kisskb/src/include/linux/lockdep.h:14, from /kisskb/src/include/linux/mutex.h:17, from /kisskb/src/arch/powerpc/include/asm/kvm_ppc.h:15, from /kisskb/src/arch/powerpc/kvm/e500_emulate.c:12: /kisskb/src/arch/powerpc/include/asm/bitops.h: In function 'kvmppc_core_emulate_op_e500': /kisskb/src/arch/powerpc/include/asm/bitops.h:104:3: error: asm operand 2 probably doesn't match constraints [-Werror] 104 | asm volatile ( \ | ^~~ /kisskb/src/arch/powerpc/include/asm/bitops.h:126:1: note: in expansion of macro 'DEFINE_CLROP' 126 | DEFINE_CLROP(clear_bits, "") | ^~~~~~~~~~~~ /kisskb/src/arch/powerpc/include/asm/bitops.h:104:3: error: impossible constraint in 'asm' 104 | asm volatile ( \ | ^~~ /kisskb/src/arch/powerpc/include/asm/bitops.h:126:1: note: in expansion of macro 'DEFINE_CLROP' 126 | DEFINE_CLROP(clear_bits, "") | ^~~~~~~~~~~~ cc1: all warnings being treated as errors make[3]: *** [/kisskb/src/scripts/Makefile.build:288: arch/powerpc/kvm/e500_emulate.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [/kisskb/src/scripts/Makefile.build:550: arch/powerpc/kvm] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1831: arch/powerpc] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:219: __sub-make] Error 2 Command 'make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/powerpc-next_mpc85xx_defconfig+KVM_powerpc-gcc9 # Build took: 0:01:13.492440