mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] xen, pvh: fix unbootable VMs (PVH + KASAN - AMD_MEM_ENCRYPT)
@ 2024-08-02 15:42 Alexey Dobriyan
  2024-08-02 15:42 ` [PATCH 2/3] x86/cpu: fix unbootable VMs by inlining memcmp() in hypervisor_cpuid_base() Alexey Dobriyan
  2024-08-02 15:42 ` [PATCH 3/3] xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh() Alexey Dobriyan
  0 siblings, 2 replies; 5+ messages in thread
From: Alexey Dobriyan @ 2024-08-02 15:42 UTC (permalink / raw)
  To: jgross, boris.ostrovsky, tglx, mingo, bp, dave.hansen
  Cc: adobriyan, linux-kernel, x86, hpa

Uninstrument arch/x86/platform/pvh/enlighten.c: KASAN has not been setup
_this_ early in the boot process.

Steps to reproduce:

	make allnoconfig
	make sure CONFIG_AMD_MEM_ENCRYPT is disabled
		AMD_MEM_ENCRYPT independently uninstruments lib/string.o
		so PVH boot code calls into uninstrumented memset() and
		memcmp() which can make the bug disappear depending on
		the compiler.
	enable CONFIG_PVH
	enable CONFIG_KASAN
	enable serial console
		this is fun exercise if you never done it from nothing :^)

	make

	qemu-system-x86_64	\
		-enable-kvm	\
		-cpu host	\
		-smp cpus=1	\
		-m 4096		\
		-serial stdio	\
		-kernel vmlinux \
		-append 'console=ttyS0 ignore_loglevel'

Messages on serial console will easily tell OK kernel from unbootable
kernel. In bad case qemu hangs in an infinite loop stroboscoping
"SeaBIOS" message.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/platform/pvh/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/platform/pvh/Makefile b/arch/x86/platform/pvh/Makefile
index 5dec5067c9fb..c43fb7964dc4 100644
--- a/arch/x86/platform/pvh/Makefile
+++ b/arch/x86/platform/pvh/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 OBJECT_FILES_NON_STANDARD_head.o := y
+KASAN_SANITIZE := n
 
 obj-$(CONFIG_PVH) += enlighten.o
 obj-$(CONFIG_PVH) += head.o
-- 
2.45.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-15 13:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-02 15:42 [PATCH 1/3] xen, pvh: fix unbootable VMs (PVH + KASAN - AMD_MEM_ENCRYPT) Alexey Dobriyan
2024-08-02 15:42 ` [PATCH 2/3] x86/cpu: fix unbootable VMs by inlining memcmp() in hypervisor_cpuid_base() Alexey Dobriyan
2024-08-15 13:32   ` Jürgen Groß
2024-08-02 15:42 ` [PATCH 3/3] xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh() Alexey Dobriyan
2024-08-15 13:33   ` Jürgen Groß

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®