From: Borislav Petkov <bp@alien8.de>
To: Laurent Wandrebeck <l.wandrebeck@quelquesmots.fr>,
Dave Hansen <dave.hansen@intel.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Oscar Salvador <osalvador@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] x86/mm: don't apply va_align to hugetlb mappings on AMD F15h
Date: Sat, 19 Sep 2026 10:53:16 -0700 [thread overview]
Message-ID: <20260919175316.GAaq7MDHnfhdJFPtsM@fat_crate.local> (raw)
In-Reply-To: <45dc4a4f62e49107de788b4be9a4039e0d772fa1.camel@quelquesmots.fr>
On Sat, Sep 19, 2026 at 10:47:46AM +0200, Laurent Wandrebeck wrote:
> Here’s the « v2 » patch I used instead, on top of 7.3-rc3.
> Works without problem (several hours uptime).
> If this looks ok to you,
I can't complain about that too much, but let's see what Dave thinks.
Dave?
> diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
> index 776ae6fa7f2d..a54f930e2c9a 100644
> --- a/arch/x86/kernel/sys_x86_64.c
> +++ b/arch/x86/kernel/sys_x86_64.c
> @@ -28,7 +28,7 @@
> */
> static unsigned long get_align_mask(struct file *filp)
> {
> - if (filp && is_file_hugepages(filp))
> + if (is_file_hugepages(filp))
> return huge_page_mask_align(filp);
> /* handle 32- and 64-bit case with a single conditional */
> if (va_align.flags < 0 || !(va_align.flags & (2 - mmap_is_ia32())))
> @@ -50,9 +50,13 @@ static unsigned long get_align_mask(struct file *filp)
> * value before calling vm_unmapped_area() or ORed directly to the
> * address.
> */
> -static unsigned long get_align_bits(void)
> +static unsigned long get_align_bits(struct file *filp)
> {
> - return va_align.bits & get_align_mask(NULL);
> + /* hugetlb mappings must stay on the huge page boundary. */
> + if (is_file_hugepages(filp))
> + return 0;
> +
> + return va_align.bits & get_align_mask(filp);
> }
>
> static int __init control_va_addr_alignment(char *str)
> @@ -157,7 +161,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len,
> }
> if (filp) {
> info.align_mask = get_align_mask(filp);
> - info.align_offset += get_align_bits();
> + info.align_offset += get_align_bits(filp);
> }
>
> return vm_unmapped_area(&info);
> @@ -222,7 +226,7 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr0,
>
> if (filp) {
> info.align_mask = get_align_mask(filp);
> - info.align_offset += get_align_bits();
> + info.align_offset += get_align_bits(filp);
> }
> addr = vm_unmapped_area(&info);
> if (!(addr & ~PAGE_MASK))
>
> --
> Laurent Wandrebeck <l.wandrebeck@quelquesmots.fr>
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2026-09-19 17:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 13:57 Laurent Wandrebeck
2026-08-28 17:07 ` Dave Hansen
2026-08-29 17:47 ` Borislav Petkov
[not found] ` <0B48BE2C-2E72-4961-91D9-35E215F537A9@quelquesmots.fr>
2026-08-29 18:51 ` Borislav Petkov
2026-09-01 8:12 ` Laurent Wandrebeck
2026-09-16 20:02 ` Borislav Petkov
2026-09-19 8:47 ` Laurent Wandrebeck
2026-09-19 17:53 ` Borislav Petkov [this message]
2026-09-21 16:19 ` Dave Hansen
2026-09-22 8:50 ` [PATCH v2] " Laurent Wandrebeck
2026-09-28 2:58 ` [tip: x86/urgent] x86/mm: Don't " tip-bot2 for Laurent Wandrebeck
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=20260919175316.GAaq7MDHnfhdJFPtsM@fat_crate.local \
--to=bp@alien8.de \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=l.wandrebeck@quelquesmots.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=osalvador@suse.de \
--cc=stable@vger.kernel.org \
--cc=tglx@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®