x86/mm: Add an early PGT_validated exit in _get_page_type()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 16 Jun 2022 11:08:02 +0000 (12:08 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 22 Jun 2022 10:26:36 +0000 (11:26 +0100)
commit15d93068e3484cb14006e935734a1e6088f228fd
tree7939a91ea45c5d5b26bf249e658ac203ff99d132
parent9d067857d1ff6805608aac4d9c0ea1c848b2e637
x86/mm: Add an early PGT_validated exit in _get_page_type()

This is a continuation of the cleanup and commenting in:
  9186e96b199e ("x86/pv: Clean up _get_page_type()")
  8cc5036bc385 ("x86/pv: Fix ABAC cmpxchg() race in _get_page_type()")

With the re-arranged and newly commented logic, it's now obvious that the
second half of _get_page_type() only has work to do for page validation.

Introduce an early exit for PGT_validated.  This makes the fastpath marginally
faster, and simplifies the subsequent logic as it no longer needs to exclude
the fully validated case.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c