aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/mem-phys-addr.py
diff options
context:
space:
mode:
authorSean Christopherson <[email protected]>2023-08-08 23:31:31 +0000
committerSean Christopherson <[email protected]>2023-08-17 18:31:37 +0000
commit4c08e737f056fec930b416a2bd37ed266d724f95 (patch)
tree8ab5a24ad447e097c18c69b86c01b00b38518a97 /tools/perf/scripts/python/mem-phys-addr.py
parentKVM: SVM: Use svm_get_lbr_vmcb() helper to handle writes to DEBUGCTL (diff)
downloadkernel-4c08e737f056fec930b416a2bd37ed266d724f95.tar.gz
kernel-4c08e737f056fec930b416a2bd37ed266d724f95.zip
KVM: SVM: Take and hold ir_list_lock when updating vCPU's Physical ID entry
Hoist the acquisition of ir_list_lock from avic_update_iommu_vcpu_affinity() to its two callers, avic_vcpu_load() and avic_vcpu_put(), specifically to encapsulate the write to the vCPU's entry in the AVIC Physical ID table. This will allow a future fix to pull information from the Physical ID entry when updating the IRTE, without potentially consuming stale information, i.e. without racing with the vCPU being (un)loaded. Add a comment to call out that ir_list_lock does NOT protect against multiple writers, specifically that reading the Physical ID entry in avic_vcpu_put() outside of the lock is safe. To preserve some semblance of independence from ir_list_lock, keep the READ_ONCE() in avic_vcpu_load() even though acuiring the spinlock effectively ensures the load(s) will be generated after acquiring the lock. Cc: [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 'tools/perf/scripts/python/mem-phys-addr.py')
0 files changed, 0 insertions, 0 deletions