mirror of
https://github.com/torvalds/linux.git
synced 2024-12-02 09:01:34 +00:00
45121ad4a1
The PSP IRQ is edge-triggered (MSI or MSI-X) in all cases supported by
the psp module so clear the interrupt status register early in the
handler to prevent missed interrupts. sev_irq_handler() calls wake_up()
on a wait queue, which can result in a new command being submitted from
a different CPU. This then races with the clearing of isr and can result
in missed interrupts. A missed interrupt results in a command waiting
until it times out, which results in the psp being declared dead.
This is unlikely on bare metal, but has been observed when running
virtualized. In the cases where this is observed, sev->cmdresp_reg has
PSP_CMDRESP_RESP set which indicates that the command was processed
correctly but no interrupt was asserted.
The full sequence of events looks like this:
CPU 1: submits SEV cmd #1
CPU 1: calls wait_event_timeout()
CPU 0: enters psp_irq_handler()
CPU 0: calls sev_handler()->wake_up()
CPU 1: wakes up; finishes processing cmd #1
CPU 1: submits SEV cmd #2
CPU 1: calls wait_event_timeout()
PSP: finishes processing cmd #2; interrupt status is still set; no interrupt
CPU 0: clears intsts
CPU 0: exits psp_irq_handler()
CPU 1: wait_event_timeout() times out; psp_dead=true
Fixes:
|
||
---|---|---|
.. | ||
ccp-crypto-aes-cmac.c | ||
ccp-crypto-aes-galois.c | ||
ccp-crypto-aes-xts.c | ||
ccp-crypto-aes.c | ||
ccp-crypto-des3.c | ||
ccp-crypto-main.c | ||
ccp-crypto-rsa.c | ||
ccp-crypto-sha.c | ||
ccp-crypto.h | ||
ccp-debugfs.c | ||
ccp-dev-v3.c | ||
ccp-dev-v5.c | ||
ccp-dev.c | ||
ccp-dev.h | ||
ccp-dmaengine.c | ||
ccp-ops.c | ||
Kconfig | ||
Makefile | ||
platform-access.c | ||
platform-access.h | ||
psp-dev.c | ||
psp-dev.h | ||
sev-dev.c | ||
sev-dev.h | ||
sp-dev.c | ||
sp-dev.h | ||
sp-pci.c | ||
sp-platform.c | ||
tee-dev.c | ||
tee-dev.h |