Sean Christopherson 65e3b446bc KVM: x86/mmu: Document the "rules" for using host_pfn_mapping_level()
Add a comment to document how host_pfn_mapping_level() can be used safely,
as the line between safe and dangerous is quite thin.  E.g. if KVM were
to ever support in-place promotion to create huge pages, consuming the
level is safe if the caller holds mmu_lock and checks that there's an
existing _leaf_ SPTE, but unsafe if the caller only checks that there's a
non-leaf SPTE.

Opportunistically tweak the existing comments to explicitly document why
KVM needs to use READ_ONCE().

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220715232107.3775620-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-07-28 13:22:23 -04:00
..
2022-05-23 17:51:12 -07:00
2022-04-11 18:04:27 +02:00
2022-04-14 14:09:43 +02:00
2022-05-27 15:25:10 -07:00
2022-05-23 17:51:12 -07:00
2022-06-05 10:55:23 -07:00
2021-12-11 09:09:45 +01:00
2022-05-26 12:09:50 -07:00