From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Borislav Petkov <bp@alien8.de>
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>,
Juergen Gross <jgross@suse.com>,
Alexey Dobriyan <adobriyan@gmail.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Jan Beulich <jbeulich@suse.com>, Brian Gerst <brgerst@gmail.com>,
kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v10 0/4] x86/pvh: fix unbootable VMs again (PVH + KASAN)
Date: Tue, 22 Sep 2026 19:13:35 -0300 [thread overview]
Message-ID: <3ed7ea3908233ef72660ddfa1f92e914@igalia.com> (raw)
In-Reply-To: <20260922035815.GFarH819yHRX8WWnG9@fat_crate.local>
On 2026-09-22 00:58, Borislav Petkov wrote:
> On Mon, Sep 21, 2026 at 10:36:31PM -0300, Mauricio Faria de Oliveira wrote:
>> The issue of unbootable VMs with CONFIG_PVH due to CONFIG_KASAN is back.
>>
>> Booting directly from vmlinux (instead of bzImage) now fails with gcc-14/15
>> (but works with gcc-12/13) if CONFIG_KASAN_GENERIC is set, on Ubuntu 25.10.
>>
>> The PVH code is required/supposed not to use the KASAN memory access check
>> in the kernel entry point as KASAN has not yet been setup, or an exception
>> is hit and the boot fails.
>>
>> This was previously described and addressed with __builtin_mem{cmp,set}():
>> - commit 661362e3dcab ("xen, pvh: fix unbootable VMs (PVH + KASAN - AMD_MEM_ENCRYPT)")
>> - commit 416a33c9afce ("x86/cpu: fix unbootable VMs by inlining memcmp() in hypervisor_cpuid_base()")
>> - commit fbe5a6dfe492 ("xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()")
>>
>> However, even with __builtin the compiler may decide to use the out of line
>> function instead of the inline implementation. So, that does not really fix
>> the issue unconditionally; see details below.
>
> So, this whole deal doesn't sound to me like we need to backport it to stable
> - it rather looks more like fixing some configs which want to enable KASAN on
> PVH guests.
>
> In that case, I'll queue this for 7.4.
>
> If this needs to go to stable, then there better be a pretty good reason for
> it.
>
> Right?
I think that is fine, yes. Even though it's a boot failure, actually
hitting it depends on all of: CONFIG_KASAN, CONFIG_PVH, booting from the
PVH entry point, _plus_ a compiler version that triggers it.
Nonetheless, this may be picked up for stable due to the Fixes: tags,
but I can provide backports as needed.
BTW, I just realized that the title of patch 4/4 is missing memset().
Would you mind adding it, please? Or I can send v11.
-x86/cpuid: fix unbootable VMs by really inlining memcmp() in
cpuid_base_hypervisor() and xen_prepare_pvh()
+x86/cpuid: fix unbootable VMs by really inlining memcmp() and memset()
in cpuid_base_hypervisor() and xen_prepare_pvh()
Thanks,
--
Mauricio
next prev parent reply other threads:[~2026-09-22 22:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 1:36 Mauricio Faria de Oliveira
2026-09-22 1:36 ` [PATCH v10 1/4] x86/boot: comment out and document redundant "cc" clobber in memcmp() Mauricio Faria de Oliveira
2026-09-23 5:52 ` [tip: x86/boot] x86/boot: Remove redundant "cc" clobber in memcmp() and document it tip-bot2 for Mauricio Faria de Oliveira
2026-09-22 1:36 ` [PATCH v10 2/4] x86/asm, x86/boot: expose inline memcmp() Mauricio Faria de Oliveira
2026-09-23 5:52 ` [tip: x86/boot] x86/asm, x86/boot: Carve out inline memcmp() into a separate header tip-bot2 for Mauricio Faria de Oliveira
2026-09-22 1:36 ` [PATCH v10 3/4] x86/asm: group inline string functions Mauricio Faria de Oliveira
2026-09-23 5:52 ` [tip: x86/boot] x86/asm: Group " tip-bot2 for Mauricio Faria de Oliveira
2026-09-22 1:36 ` [PATCH v10 4/4] x86/cpuid: fix unbootable VMs by really inlining memcmp() in cpuid_base_hypervisor() and xen_prepare_pvh() Mauricio Faria de Oliveira
2026-09-23 5:52 ` [tip: x86/boot] x86/pvh: Really inline memcmp() and memset() to fix unbootable VMs tip-bot2 for Mauricio Faria de Oliveira
2026-09-22 3:58 ` [PATCH v10 0/4] x86/pvh: fix unbootable VMs again (PVH + KASAN) Borislav Petkov
2026-09-22 22:13 ` Mauricio Faria de Oliveira [this message]
2026-09-23 1:12 ` Borislav Petkov
2026-09-23 12:41 ` Mauricio Faria de Oliveira
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=3ed7ea3908233ef72660ddfa1f92e914@igalia.com \
--to=mfo@igalia.com \
--cc=adobriyan@gmail.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.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®