linux/arch/x86/kvm/mmu
Maciej S. Szmigiero f5756029ee KVM: x86: Use nr_memslot_pages to avoid traversing the memslots array
There is no point in recalculating from scratch the total number of pages
in all memslots each time a memslot is created or deleted.  Use KVM's
cached nr_memslot_pages to compute the default max number of MMU pages.

Note that even with nr_memslot_pages capped at ULONG_MAX we can't safely
multiply it by KVM_PERMILLE_MMU_PAGES (20) since this operation can
possibly overflow an unsigned long variable.

Write this "* 20 / 1000" operation as "/ 50" instead to avoid such
overflow.

Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
[sean: use common KVM field and rework changelog accordingly]
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <d14c5a24535269606675437d5602b7dac4ad8c0e.1638817640.git.maciej.szmigiero@oracle.com>
2021-12-08 04:24:29 -05:00
..
mmu_audit.c KVM: x86/mmu: Rename __gfn_to_rmap to gfn_to_rmap 2021-08-06 07:52:58 -04:00
mmu_internal.h KVM: x86/mmu: clean up prefetch/prefault/speculative naming 2021-10-22 05:19:26 -04:00
mmu.c KVM: x86: Use nr_memslot_pages to avoid traversing the memslots array 2021-12-08 04:24:29 -05:00
mmutrace.h KVM: MMU: change tracepoints arguments to kvm_page_fault 2021-10-01 03:44:52 -04:00
page_track.c KVM: cleanup allocation of rmaps and page tracking data 2021-10-22 05:19:25 -04:00
paging_tmpl.h KVM: x86/mmu: Retry page fault if root is invalidated by memslot update 2021-12-02 04:12:12 -05:00
paging.h KVM: x86/mmu: Do not apply HPA (memory encryption) mask to GPAs 2021-07-14 12:17:56 -04:00
spte.c KVM: x86/mmu: clean up prefetch/prefault/speculative naming 2021-10-22 05:19:26 -04:00
spte.h KVM: x86/mmu: clean up prefetch/prefault/speculative naming 2021-10-22 05:19:26 -04:00
tdp_iter.c KVM: x86/mmu: Store the address space ID in the TDP iterator 2021-03-16 14:16:34 -04:00
tdp_iter.h KVM: x86/mmu: Store the address space ID in the TDP iterator 2021-03-16 14:16:34 -04:00
tdp_mmu.c KVM: x86/mmu: Remove spurious TLB flushes in TDP MMU zap collapsible path 2021-11-30 03:09:25 -05:00
tdp_mmu.h KVM: x86/mmu: Remove spurious TLB flushes in TDP MMU zap collapsible path 2021-11-30 03:09:25 -05:00