Commit 02eac06b authored by Juergen Gross's avatar Juergen Gross Committed by Ingo Molnar

x86/pat: Restructure _lookup_address_cpa()

Modify _lookup_address_cpa() to no longer use lookup_address(), but
only lookup_address_in_pgd().

This is done in preparation of using lookup_address_in_pgd_attr().

No functional change intended.
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240412151258.9171-4-jgross@suse.com
parent d29dc517
......@@ -744,11 +744,14 @@ EXPORT_SYMBOL_GPL(lookup_address);
static pte_t *_lookup_address_cpa(struct cpa_data *cpa, unsigned long address,
unsigned int *level)
{
if (cpa->pgd)
return lookup_address_in_pgd(cpa->pgd + pgd_index(address),
address, level);
pgd_t *pgd;
if (!cpa->pgd)
pgd = pgd_offset_k(address);
else
pgd = cpa->pgd + pgd_index(address);
return lookup_address(address, level);
return lookup_address_in_pgd(pgd, address, level);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment