From nobody Tue Mar 3 03:15:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1771930317; cv=none; d=zohomail.com; s=zohoarc; b=hLe8TSuzPKszwYYWhmF3pm2RSBDJGVM0AYE8xoBNdj2nIN4ZHIHq7KyzIuo1q/DRXcFGC8/T0VF+I33XxFZn06GtKdkdf1nPWwOe7qi5sSbMeqUheSN+fF9QV0rtaCgMGJx17Sge2Ec3iOw41JO+TjPtbL8tvjCUqRiEpLk88h4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771930317; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/TXyyKPvyNOfr9WgduPAeT4QAKdPcNDxmEaL9+XY6V4=; b=j5Q4QwVQp/OF+Mw3ZlmPaycbQgvX0vDTGEgLZEznDhhz5xxMr5zKlX2yM6KI8GwRPzXtVOXU8r/RUiYsdWr470WSVvWaTHbLWLDkmRahgONCmREyIj8t2aFyKWqs8a9wzxjvNhc2f5MihtAeXwJCt6nEfJu2V+5TySPRR9gBIsM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 177193031773828.795656242868063; Tue, 24 Feb 2026 02:51:57 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1239796.1541204 (Exim 4.92) (envelope-from ) id 1vuq12-0004ec-Gv; Tue, 24 Feb 2026 10:51:44 +0000 Received: by outflank-mailman (output) from mailman id 1239796.1541204; Tue, 24 Feb 2026 10:51:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vuq12-0004eV-Dw; Tue, 24 Feb 2026 10:51:44 +0000 Received: by outflank-mailman (input) for mailman id 1239796; Tue, 24 Feb 2026 10:51:42 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vuq10-0004eP-NL for xen-devel@lists.xenproject.org; Tue, 24 Feb 2026 10:51:42 +0000 Received: from mail186-12.suw21.mandrillapp.com (mail186-12.suw21.mandrillapp.com [198.2.186.12]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ca2a8756-116e-11f1-9ccf-f158ae23cfc8; Tue, 24 Feb 2026 11:51:36 +0100 (CET) Received: from pmta10.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail186-12.suw21.mandrillapp.com (Mailchimp) with ESMTP id 4fKvfb3Cf0z705l4D for ; Tue, 24 Feb 2026 10:51:35 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id b23a52783cba4c85add3ee778284c931; Tue, 24 Feb 2026 10:51:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ca2a8756-116e-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1771930295; x=1772200295; bh=/TXyyKPvyNOfr9WgduPAeT4QAKdPcNDxmEaL9+XY6V4=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=hEGWuuJx06mnWuGy9jyOHEK4isposbcmixKNuQcw+IqljV8Qlq7z5tV0exdnEobli h/y3xvcjrJ5wJXPWLa+H5MN4SvoSwsyhUmR1Mh+UEp/HBLcHS+oh/kBbwunZPl4IHh jisEVSvVF5Rw13H6hMKTAdzNS9bbwWksyEGZZIyRQptOFwd+uSEt6uRYOt2ABkxEx6 zp/oNTd8m+RFTaW22Bu9sE1aUjWmyo3suFZOgWRV2zgcO7iF4IFzEqWbVwP1eFAR3O oKuWlWBY2YbmGsSpfywuZjZCGI6sJVGduUv3xTSe5ixGu3cn3GCxeFGJrNlK6uZAiV j6jx3Nr3y7D6w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1771930295; x=1772190795; i=teddy.astie@vates.tech; bh=/TXyyKPvyNOfr9WgduPAeT4QAKdPcNDxmEaL9+XY6V4=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=JdpH1BRdBB8Gb5jl5Lc22VcPvXAZIv5g0yXZCQ4ChEngdYBaE33vLyV0/+yBxJLSp DgXRCUUISFaTg7pS6OUHIHlzqXUV+UWk2ysd5sfe+5xs75nSAaFpbokg/RUsqOIUPK ANryeeHnTEj5WvAgFLm1uXqBfmkJImguXsfYqz+98ngKIwcVu/Iy14JsSHVRTVOEbq LP/EccPVCK/QWGe78GY8ylqiYfG4BdmIudNE07Lknz1WaQCAmERP1FBjVoLfCwp5Sm r7oQUtHuGLCbnEH7DYiJmtfzInr80WtEmvZJRBC5EJQnPGWy9ft/+ViFKyj/nL18y/ S8bsnLYY8ZoFA== From: "Teddy Astie" Subject: =?utf-8?Q?[RFC=20PATCH]=20x86/xen:=20Consider=20Xen=20PVH=20support=20in=20CONFIG=5FXEN=5FPVHVM?= X-Mailer: git-send-email 2.53.0 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1771930294336 To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: "Teddy Astie" , "Juergen Gross" , "Boris Ostrovsky" , "Oleksandr Tyshchenko" Message-Id: <7b17bfbb4b25a59514707f91546ce8c3a24369e0.1771929804.git.teddy.astie@vates.tech> X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.b23a52783cba4c85add3ee778284c931?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20260224:md Date: Tue, 24 Feb 2026 10:51:35 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity teddy.astie@vates.tech) (identity @mandrillapp.com) X-ZM-MESSAGEID: 1771930320110158500 Content-Type: text/plain; charset="utf-8" It's currently possible to build Linux with CONFIG_PVH|CONFIG_XEN_PVHVM and no CONFIG_XEN_PVH. That leads to inconsistent kernels that fails with "Missing xen PVH initialization" when booting using PVH boot method or display various errors and fail to initialize Xen PV drivers when booting with PVH-GRUB. platform_pci_unplug: Xen Platform PCI: unrecognised magic value ... # modprobe xen-blkfront modprobe: ERROR: could not insert 'xen_blkfront': No such device # modprobe xen-netfront modprobe: ERROR: could not insert 'xen_netfront': No such device When built without CONFIG_XEN_PVH, PVH-specific logic is disabled, hence wh= en booting with e.g PVH-OVMF, Linux assumes we are a HVM guest, even when we a= ren't actually one (in the "with HVM emulated devices" sense). As it is actually possible to boot Xen PVH without CONFIG_PVH; and that most Xen-related logic exist within CONFIG_XEN_PVHVM; consider PVH guests support within CONFIG_XEN_PVHVM instead of CONFIG_XEN_PVH. Keep CONFIG_XEN_PVH as a shortcut to enable PVH boot, ACPI support and PVHV= M. Signed-off-by: Teddy Astie --- Cc: Juergen Gross Cc: Boris Ostrovsky Cc: Oleksandr Tyshchenko A tentative patch, I'm not sure of the way of dealing with the KConfig part, keeping CONFIG_XEN_PVH as a shortcut is interesting, but there may be other options. There are widespreadly used Linux distributions that have a similar configu= ration to this one, thus exhibit this issue i.e fail to boot. I'm not sure which commit to target for a Fixes: note. arch/x86/xen/Makefile | 2 +- arch/x86/xen/enlighten_hvm.c | 2 -- arch/x86/xen/grant-table.c | 2 +- arch/x86/xen/xen-head.S | 8 ++++---- include/xen/xen.h | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile index a9ec8c9f5c5d..7fbe17c8ba89 100644 --- a/arch/x86/xen/Makefile +++ b/arch/x86/xen/Makefile @@ -33,7 +33,7 @@ obj-$(CONFIG_XEN_PV) +=3D irq.o obj-$(CONFIG_XEN_PV) +=3D multicalls.o obj-$(CONFIG_XEN_PV) +=3D xen-asm.o =20 -obj-$(CONFIG_XEN_PVH) +=3D enlighten_pvh.o +obj-$(CONFIG_XEN_PVHVM) +=3D enlighten_pvh.o =20 obj-$(CONFIG_EVENT_TRACING) +=3D trace.o =20 diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c index fe57ff85d004..38c2cdfdcc44 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -264,7 +264,6 @@ static bool __init msi_ext_dest_id(void) =20 static __init void xen_hvm_guest_late_init(void) { -#ifdef CONFIG_XEN_PVH /* Test for PVH domain (PVH boot path taken overrides ACPI flags). */ if (!xen_pvh && (x86_platform.legacy.rtc || !x86_platform.legacy.no_vga)) @@ -282,7 +281,6 @@ static __init void xen_hvm_guest_late_init(void) =20 machine_ops.emergency_restart =3D xen_emergency_restart; pv_info.name =3D "Xen PVH"; -#endif } =20 static uint32_t __init xen_platform_hvm(void) diff --git a/arch/x86/xen/grant-table.c b/arch/x86/xen/grant-table.c index 5f4060b5a40d..4d717c92b624 100644 --- a/arch/x86/xen/grant-table.c +++ b/arch/x86/xen/grant-table.c @@ -149,7 +149,7 @@ int arch_gnttab_init(unsigned long nr_shared, unsigned = long nr_status) return -ENOMEM; } =20 -#ifdef CONFIG_XEN_PVH +#ifdef CONFIG_XEN_PVHVM #include #include static int __init xen_pvh_gnttab_setup(void) diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S index 5dad6c51cdc3..e262caac3ca9 100644 --- a/arch/x86/xen/xen-head.S +++ b/arch/x86/xen/xen-head.S @@ -162,10 +162,10 @@ SYM_FUNC_END(xen_hypercall_intel) #else # define FEATURES_PV 0 #endif -#ifdef CONFIG_XEN_PVH -# define FEATURES_PVH (1 << XENFEAT_linux_rsdp_unrestricted) +#ifdef CONFIG_XEN_PVHVM +# define FEATURES_PVHVM (1 << XENFEAT_linux_rsdp_unrestricted) #else -# define FEATURES_PVH 0 +# define FEATURES_PVHVM 0 #endif #ifdef CONFIG_XEN_DOM0 # define FEATURES_DOM0 (1 << XENFEAT_dom0) @@ -173,7 +173,7 @@ SYM_FUNC_END(xen_hypercall_intel) # define FEATURES_DOM0 0 #endif ELFNOTE(Xen, XEN_ELFNOTE_SUPPORTED_FEATURES, - .long FEATURES_PV | FEATURES_PVH | FEATURES_DOM0) + .long FEATURES_PV | FEATURES_PVHVM | FEATURES_DOM0) ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic") ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1) =20 diff --git a/include/xen/xen.h b/include/xen/xen.h index f280c5dcf923..4d066fbf9714 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h @@ -16,7 +16,7 @@ extern enum xen_domain_type xen_domain_type; #define xen_domain_type XEN_NATIVE #endif =20 -#ifdef CONFIG_XEN_PVH +#ifdef CONFIG_XEN_PVHVM extern bool xen_pvh; #else #define xen_pvh 0 --=20 2.53.0 -- Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech