From: "tip-bot2 for Juergen Gross" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>, Ingo Molnar <mingo@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/mm] x86/pat: Restructure _lookup_address_cpa()
Date: Sun, 14 Apr 2024 20:31:00 -0000 [thread overview]
Message-ID: <171312666005.10875.4683532431046752245.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20240412151258.9171-4-jgross@suse.com>
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);
}
/*
next prev parent reply other threads:[~2024-04-14 20:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 15:12 [PATCH v2 0/4] x86: correctly handle NX and RW bit testing Juergen Gross
2024-04-12 15:12 ` [PATCH v2 1/4] x86/pat: introduce lookup_address_in_pgd_attr() Juergen Gross
2024-04-14 20:31 ` [tip: x86/mm] x86/pat: Introduce lookup_address_in_pgd_attr() tip-bot2 for Juergen Gross
2024-04-12 15:12 ` [PATCH v2 2/4] x86/mm: use lookup_address_in_pgd_attr() in show_fault_oops() Juergen Gross
2024-04-14 20:31 ` [tip: x86/mm] x86/mm: Use " tip-bot2 for Juergen Gross
2024-04-12 15:12 ` [PATCH v2 3/4] x86/pat: restructure _lookup_address_cpa() Juergen Gross
2024-04-14 20:31 ` tip-bot2 for Juergen Gross [this message]
2024-04-12 15:12 ` [PATCH v2 4/4] x86/pat: fix W^X violation false-positives when running as Xen PV guest Juergen Gross
2024-04-14 20:30 ` [tip: x86/mm] x86/pat: Fix " tip-bot2 for Juergen Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=171312666005.10875.4683532431046752245.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®