lkml.org 
[lkml]   [2024]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[tip: x86/mm] x86/pat: Restructure _lookup_address_cpa()
    The following commit has been merged into the x86/mm branch of tip:

    Commit-ID: 02eac06b820c3eae73e5736ae62f986d37fed991
    Gitweb: https://git.kernel.org/tip/02eac06b820c3eae73e5736ae62f986d37fed991
    Author: Juergen Gross <jgross@suse.com>
    AuthorDate: Fri, 12 Apr 2024 17:12:57 +02:00
    Committer: Ingo Molnar <mingo@kernel.org>
    CommitterDate: Sun, 14 Apr 2024 22:16:28 +02:00

    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: Juergen Gross <jgross@suse.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20240412151258.9171-4-jgross@suse.com
    ---
    arch/x86/mm/pat/set_memory.c | 11 +++++++----
    1 file changed, 7 insertions(+), 4 deletions(-)

    diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
    index bfa0aae..4ebccaf 100644
    --- a/arch/x86/mm/pat/set_memory.c
    +++ b/arch/x86/mm/pat/set_memory.c
    @@ -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);
    }

    /*
    \
     
     \ /
      Last update: 2024-05-27 16:40    [W:9.264 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site