x86/pat: Introduce lookup_address_in_pgd_attr()
authorJuergen Gross <jgross@suse.com>
Fri, 12 Apr 2024 15:12:55 +0000 (17:12 +0200)
committerIngo Molnar <mingo@kernel.org>
Sun, 14 Apr 2024 20:16:26 +0000 (22:16 +0200)
commitceb647b4b529fdeca9021cd34486f5a170746bda
tree6258196558b74b4201f88911fac08290790eb091
parent72374d71c31596c7442ac0db9a9327d0e062e941
x86/pat: Introduce lookup_address_in_pgd_attr()

Add lookup_address_in_pgd_attr() doing the same as the already
existing lookup_address_in_pgd(), but returning the effective settings
of the NX and RW bits of all walked page table levels, too.

This will be needed in order to match hardware behavior when looking
for effective access rights, especially for detecting writable code
pages.

In order to avoid code duplication, let lookup_address_in_pgd() call
lookup_address_in_pgd_attr() with dummy parameters.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240412151258.9171-2-jgross@suse.com
arch/x86/include/asm/pgtable_types.h
arch/x86/mm/pat/set_memory.c