From: Borislav Petkov <bp@alien8.de>
To: Brendan Jackman <jackmanb@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] x86/mm: harmonize return value of phys_pte_init()
Date: Thu, 27 Nov 2025 15:35:01 +0100 [thread overview]
Message-ID: <20251127143501.GAaShhlVTH5iQpCdPM@fat_crate.local> (raw)
In-Reply-To: <20251003-x86-init-cleanup-v1-2-f2b7994c2ad6@google.com>
On Fri, Oct 03, 2025 at 04:56:42PM +0000, Brendan Jackman wrote:
> In the case that they encounter pre-existing mappings, all the other
> phys_*_init()s include those pre-mapped PFNs in the returned value.
> Excluding those PFNs only when they are mapped at 4K seems like an
> error. So make it consistent.
>
> The other functions only include the existing mappings if the
> page_size_mask would have allowed creating those mappings.
> 4K pages can't be disabled by page_size_mask so that condition is not
> needed here; paddr_last can be assigned unconditionally before checking
> for existing mappings.
>
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---
> arch/x86/mm/init_64.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 9e45b371a6234b41bd7177b81b5d432341ae7214..968a5092dbd7ee3e7007fa0c769eff7d7ecb0ba3 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -492,6 +492,8 @@ phys_pte_init(pte_t *pte_page, unsigned long paddr, unsigned long paddr_end,
> continue;
> }
>
> + paddr_last = paddr_next;
> +
> /*
> * We will re-use the existing mapping.
> * Xen for example has some special requirements, like mapping
I don't understand: the other phys_*_init() things do:
if (!XXX_none())
...
paddr_last = paddr_next;
while you've raised the assignment above that test.
Also "seems like an error" needs a lot more poking at because if it is an
error, then its incarnation must be really nasty and subtle or it is not, and
then we don't care. And it has been that way for a while now...
But maybe I'm not seeing it from the right angle...
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2025-11-27 14:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-03 16:56 [PATCH 0/4] x86/mm: some cleanups for pagetable setup code Brendan Jackman
2025-10-03 16:56 ` [PATCH 1/4] x86/mm: delete disabled debug code Brendan Jackman
2025-11-27 13:39 ` [tip: x86/cleanups] x86/mm: Delete " tip-bot2 for Brendan Jackman
2025-10-03 16:56 ` [PATCH 2/4] x86/mm: harmonize return value of phys_pte_init() Brendan Jackman
2025-11-27 14:35 ` Borislav Petkov [this message]
2025-11-28 14:03 ` Brendan Jackman
2025-12-05 19:29 ` Dave Hansen
2025-12-07 2:39 ` Brendan Jackman
2025-10-03 16:56 ` [PATCH 3/4] x86/mm: drop unused return from pgtable setup functions Brendan Jackman
2025-10-03 16:56 ` [PATCH 4/4] x86/mm: simplify calculation of max_pfn_mapped Brendan Jackman
2025-10-21 13:06 ` [PATCH 0/4] x86/mm: some cleanups for pagetable setup code Brendan Jackman
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=20251127143501.GAaShhlVTH5iQpCdPM@fat_crate.local \
--to=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--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®