Commit 878940b
committed
KVM: VMX: Retry APIC-access page reload if invalidation is in-progress
Re-request an APIC-access page reload if there is a relevant mmu_notifier
invalidation in-progress when KVM retrieves the backing pfn, i.e. stall
vCPUs until the backing pfn for the APIC-access page is "officially"
stable. Relying on the primary MMU to not make changes after invoking
->invalidate_range() works, e.g. any additional changes to a PRESENT PTE
would also trigger an ->invalidate_range(), but using ->invalidate_range()
to fudge around KVM not honoring past and in-progress invalidations is a
bit hacky.
Honoring invalidations will allow using KVM's standard mmu_notifier hooks
to detect APIC-access page reloads, which will in turn allow removing
KVM's implementation of ->invalidate_range() (the APIC-access page case is
a true one-off).
Opportunistically add a comment to explain why doing nothing if a memslot
isn't found is functionally correct.
Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Link: https://lore.kernel.org/r/20230602011518.787006-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent c3a1e11 commit 878940b
1 file changed
Lines changed: 45 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6714 | 6714 | | |
6715 | 6715 | | |
6716 | 6716 | | |
6717 | | - | |
| 6717 | + | |
| 6718 | + | |
| 6719 | + | |
| 6720 | + | |
| 6721 | + | |
| 6722 | + | |
6718 | 6723 | | |
6719 | 6724 | | |
6720 | 6725 | | |
| |||
6726 | 6731 | | |
6727 | 6732 | | |
6728 | 6733 | | |
6729 | | - | |
6730 | | - | |
| 6734 | + | |
| 6735 | + | |
| 6736 | + | |
| 6737 | + | |
| 6738 | + | |
| 6739 | + | |
| 6740 | + | |
| 6741 | + | |
| 6742 | + | |
| 6743 | + | |
| 6744 | + | |
| 6745 | + | |
| 6746 | + | |
| 6747 | + | |
| 6748 | + | |
| 6749 | + | |
| 6750 | + | |
| 6751 | + | |
| 6752 | + | |
| 6753 | + | |
| 6754 | + | |
| 6755 | + | |
| 6756 | + | |
| 6757 | + | |
| 6758 | + | |
| 6759 | + | |
6731 | 6760 | | |
6732 | 6761 | | |
6733 | | - | |
| 6762 | + | |
| 6763 | + | |
| 6764 | + | |
| 6765 | + | |
| 6766 | + | |
| 6767 | + | |
| 6768 | + | |
| 6769 | + | |
| 6770 | + | |
| 6771 | + | |
| 6772 | + | |
6734 | 6773 | | |
6735 | 6774 | | |
| 6775 | + | |
6736 | 6776 | | |
6737 | 6777 | | |
6738 | 6778 | | |
6739 | 6779 | | |
6740 | | - | |
| 6780 | + | |
6741 | 6781 | | |
6742 | 6782 | | |
6743 | 6783 | | |
| |||
0 commit comments