aboutsummaryrefslogtreecommitdiff
path: root/lib/memory-notifier-error-inject.c
diff options
context:
space:
mode:
authorSean Christopherson <[email protected]>2023-08-08 16:31:32 -0700
committerSean Christopherson <[email protected]>2023-08-17 11:32:07 -0700
commitf3cebc75e7425d6949d726bb8e937095b0aef025 (patch)
treec9c883538959abf1917fd9c77f074c3b0ad7c628 /lib/memory-notifier-error-inject.c
parent4c08e737f056fec930b416a2bd37ed266d724f95 (diff)
KVM: SVM: Set target pCPU during IRTE update if target vCPU is running
Update the target pCPU for IOMMU doorbells when updating IRTE routing if KVM is actively running the associated vCPU. KVM currently only updates the pCPU when loading the vCPU (via avic_vcpu_load()), and so doorbell events will be delayed until the vCPU goes through a put+load cycle (which might very well "never" happen for the lifetime of the VM). To avoid inserting a stale pCPU, e.g. due to racing between updating IRTE routing and vCPU load/put, get the pCPU information from the vCPU's Physical APIC ID table entry (a.k.a. avic_physical_id_cache in KVM) and update the IRTE while holding ir_list_lock. Add comments with --verbose enabled to explain exactly what is and isn't protected by ir_list_lock. Fixes: 411b44ba80ab ("svm: Implements update_pi_irte hook to setup posted interrupt") Reported-by: dengqiao.joey <[email protected]> Cc: [email protected] Cc: Alejandro Jimenez <[email protected]> Cc: Joao Martins <[email protected]> Cc: Maxim Levitsky <[email protected]> Cc: Suravee Suthikulpanit <[email protected]> Tested-by: Alejandro Jimenez <[email protected]> Reviewed-by: Joao Martins <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions