# git gc Expanding reachable commits in commit graph: 80664 Expanding reachable commits in commit graph: 180537 Expanding reachable commits in commit graph: 280497 Expanding reachable commits in commit graph: 386994 Expanding reachable commits in commit graph: 494868 Expanding reachable commits in commit graph: 595315 Expanding reachable commits in commit graph: 710123 Expanding reachable commits in commit graph: 827469 Expanding reachable commits in commit graph: 946347 Expanding reachable commits in commit graph: 1054839 Expanding reachable commits in commit graph: 1175181 Expanding reachable commits in commit graph: 1308224 Expanding reachable commits in commit graph: 1309149, done. Writing out commit graph in 4 passes: 59% (3121374/5236596) Writing out commit graph in 4 passes: 60% (3141958/5236596) Writing out commit graph in 4 passes: 61% (3194324/5236596) Writing out commit graph in 4 passes: 62% (3246690/5236596) Writing out commit graph in 4 passes: 63% (3299056/5236596) Writing out commit graph in 4 passes: 64% (3351422/5236596) Writing out commit graph in 4 passes: 65% (3403788/5236596) Writing out commit graph in 4 passes: 66% (3456154/5236596) Writing out commit graph in 4 passes: 67% (3508520/5236596) Writing out commit graph in 4 passes: 68% (3560886/5236596) Writing out commit graph in 4 passes: 69% (3613252/5236596) Writing out commit graph in 4 passes: 70% (3665618/5236596) Writing out commit graph in 4 passes: 71% (3717984/5236596) Writing out commit graph in 4 passes: 71% (3733162/5236596) Writing out commit graph in 4 passes: 72% (3770350/5236596) Writing out commit graph in 4 passes: 73% (3822716/5236596) Writing out commit graph in 4 passes: 74% (3875082/5236596) Writing out commit graph in 4 passes: 75% (3927447/5236596) Writing out commit graph in 4 passes: 76% (3979813/5236596) Writing out commit graph in 4 passes: 77% (4032179/5236596) Writing out commit graph in 4 passes: 78% (4084545/5236596) Writing out commit graph in 4 passes: 79% (4136911/5236596) Writing out commit graph in 4 passes: 80% (4189277/5236596) Writing out commit graph in 4 passes: 81% (4241643/5236596) Writing out commit graph in 4 passes: 82% (4294009/5236596) Writing out commit graph in 4 passes: 83% (4346375/5236596) Writing out commit graph in 4 passes: 84% (4398741/5236596) Writing out commit graph in 4 passes: 85% (4451107/5236596) Writing out commit graph in 4 passes: 86% (4503473/5236596) Writing out commit graph in 4 passes: 87% (4555839/5236596) Writing out commit graph in 4 passes: 88% (4608205/5236596) Writing out commit graph in 4 passes: 89% (4660571/5236596) Writing out commit graph in 4 passes: 90% (4712937/5236596) Writing out commit graph in 4 passes: 91% (4765303/5236596) Writing out commit graph in 4 passes: 92% (4817669/5236596) Writing out commit graph in 4 passes: 93% (4870035/5236596) Writing out commit graph in 4 passes: 94% (4922401/5236596) Writing out commit graph in 4 passes: 95% (4974767/5236596) Writing out commit graph in 4 passes: 96% (5027133/5236596) Writing out commit graph in 4 passes: 97% (5079499/5236596) Writing out commit graph in 4 passes: 98% (5131865/5236596) Writing out commit graph in 4 passes: 99% (5184231/5236596) Writing out commit graph in 4 passes: 100% (5236596/5236596) Writing out commit graph in 4 passes: 100% (5236596/5236596), done. # git rev-parse -q --verify a373830f96db288a3eb43a8692b6bcd0bd88dfe1^{commit} a373830f96db288a3eb43a8692b6bcd0bd88dfe1 already have revision, skipping fetch # git checkout -q -f -B kisskb a373830f96db288a3eb43a8692b6bcd0bd88dfe1 # git clean -qxdf # < git log -1 # commit a373830f96db288a3eb43a8692b6bcd0bd88dfe1 # Author: Gautam Menghani # Date: Mon Oct 28 14:34:09 2024 +0530 # # KVM: PPC: Book3S HV: Mask off LPCR_MER for a vCPU before running it to avoid spurious interrupts # # Running a L2 vCPU (see [1] for terminology) with LPCR_MER bit set and no # pending interrupts results in that L2 vCPU getting an infinite flood of # spurious interrupts. The 'if check' in kvmhv_run_single_vcpu() sets the # LPCR_MER bit if there are pending interrupts. # # The spurious flood problem can be observed in 2 cases: # 1. Crashing the guest while interrupt heavy workload is running # a. Start a L2 guest and run an interrupt heavy workload (eg: ipistorm) # b. While the workload is running, crash the guest (make sure kdump # is configured) # c. Any one of the vCPUs of the guest will start getting an infinite # flood of spurious interrupts. # # 2. Running LTP stress tests in multiple guests at the same time # a. Start 4 L2 guests. # b. Start running LTP stress tests on all 4 guests at same time. # c. In some time, any one/more of the vCPUs of any of the guests will # start getting an infinite flood of spurious interrupts. # # The root cause of both the above issues is the same: # 1. A NMI is sent to a running vCPU that has LPCR_MER bit set. # 2. In the NMI path, all registers are refreshed, i.e, H_GUEST_GET_STATE # is called for all the registers. # 3. When H_GUEST_GET_STATE is called for LPCR, the vcpu->arch.vcore->lpcr # of that vCPU at L1 level gets updated with LPCR_MER set to 1, and this # new value is always used whenever that vCPU runs, regardless of whether # there was a pending interrupt. # 4. Since LPCR_MER is set, the vCPU in L2 always jumps to the external # interrupt handler, and this cycle never ends. # # Fix the spurious flood by masking off the LPCR_MER bit before running a # L2 vCPU to ensure that it is not set if there are no pending interrupts. # # [1] Terminology: # 1. L0 : PAPR hypervisor running in HV mode # 2. L1 : Linux guest (logical partition) running on top of L0 # 3. L2 : KVM guest running on top of L1 # # Fixes: ec0f6639fa88 ("KVM: PPC: Book3S HV nestedv2: Ensure LPCR_MER bit is passed to the L0") # Cc: stable@vger.kernel.org # v6.8+ # Signed-off-by: Gautam Menghani # Signed-off-by: Madhavan Srinivasan # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 a373830f96db288a3eb43a8692b6bcd0bd88dfe1 # make -s -j 32 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc64_defconfig_powerpc-gcc8.1 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux- ppc64_defconfig # < make -s -j 32 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc64_defconfig_powerpc-gcc8.1 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 32 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc64_defconfig_powerpc-gcc8.1 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig # make -s -j 32 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc64_defconfig_powerpc-gcc8.1 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux- Completed OK # rm -rf /kisskb/build/powerpc-fixes_ppc64_defconfig_powerpc-gcc8.1 # Build took: 0:06:56.092836