Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-5.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- Fix a bug where guests on P9 with interrupts passed through could get
stuck in synchronize_irq().

- Fix a bug in KVM on P8 where secondary threads entering a guest would
write outside their allocated stack.

- Fix a bug in KVM on P8 where secondary threads could confuse the host
offline code and cause the guest or host to crash.

Thanks to Cédric Le Goater.

* tag 'powerpc-5.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
KVM: PPC: Book3S HV: Make idle_kvm_start_guest() return 0 if it went to guest
KVM: PPC: Book3S HV: Fix stack handling in idle_kvm_start_guest()
powerpc/xive: Discard disabled interrupts in get_irqchip_state()

+19 -12
+17 -11
arch/powerpc/kvm/book3s_hv_rmhandlers.S
··· 255 255 * r3 contains the SRR1 wakeup value, SRR1 is trashed. 256 256 */ 257 257 _GLOBAL(idle_kvm_start_guest) 258 - ld r4,PACAEMERGSP(r13) 259 258 mfcr r5 260 259 mflr r0 261 - std r1,0(r4) 262 - std r5,8(r4) 263 - std r0,16(r4) 264 - subi r1,r4,STACK_FRAME_OVERHEAD 260 + std r5, 8(r1) // Save CR in caller's frame 261 + std r0, 16(r1) // Save LR in caller's frame 262 + // Create frame on emergency stack 263 + ld r4, PACAEMERGSP(r13) 264 + stdu r1, -SWITCH_FRAME_SIZE(r4) 265 + // Switch to new frame on emergency stack 266 + mr r1, r4 267 + std r3, 32(r1) // Save SRR1 wakeup value 265 268 SAVE_NVGPRS(r1) 266 269 267 270 /* ··· 315 312 beq kvm_no_guest 316 313 317 314 kvm_secondary_got_guest: 315 + 316 + // About to go to guest, clear saved SRR1 317 + li r0, 0 318 + std r0, 32(r1) 318 319 319 320 /* Set HSTATE_DSCR(r13) to something sensible */ 320 321 ld r6, PACA_DSCR_DEFAULT(r13) ··· 399 392 mfspr r4, SPRN_LPCR 400 393 rlwimi r4, r3, 0, LPCR_PECE0 | LPCR_PECE1 401 394 mtspr SPRN_LPCR, r4 402 - /* set up r3 for return */ 403 - mfspr r3,SPRN_SRR1 395 + // Return SRR1 wakeup value, or 0 if we went into the guest 396 + ld r3, 32(r1) 404 397 REST_NVGPRS(r1) 405 - addi r1, r1, STACK_FRAME_OVERHEAD 406 - ld r0, 16(r1) 407 - ld r5, 8(r1) 408 - ld r1, 0(r1) 398 + ld r1, 0(r1) // Switch back to caller stack 399 + ld r0, 16(r1) // Reload LR 400 + ld r5, 8(r1) // Reload CR 409 401 mtlr r0 410 402 mtcr r5 411 403 blr
+2 -1
arch/powerpc/sysdev/xive/common.c
··· 945 945 * interrupt to be inactive in that case. 946 946 */ 947 947 *state = (pq != XIVE_ESB_INVALID) && !xd->stale_p && 948 - (xd->saved_p || !!(pq & XIVE_ESB_VAL_P)); 948 + (xd->saved_p || (!!(pq & XIVE_ESB_VAL_P) && 949 + !irqd_irq_disabled(data))); 949 950 return 0; 950 951 default: 951 952 return -EINVAL;