From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31DE2E81BDF for ; Mon, 9 Feb 2026 16:27:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1225741.1532305 (Exim 4.92) (envelope-from ) id 1vpU6V-0000im-EQ; Mon, 09 Feb 2026 16:27:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1225741.1532305; Mon, 09 Feb 2026 16:27:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vpU6V-0000if-Bp; Mon, 09 Feb 2026 16:27:15 +0000 Received: by outflank-mailman (input) for mailman id 1225741; Mon, 09 Feb 2026 16:27:14 +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 1vpU6U-0000iN-6P for xen-devel@lists.xenproject.org; Mon, 09 Feb 2026 16:27:14 +0000 Received: from PH0PR06CU001.outbound.protection.outlook.com (mail-westus3azlp170110003.outbound.protection.outlook.com [2a01:111:f403:c107::3]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2df235dc-05d4-11f1-9ccf-f158ae23cfc8; Mon, 09 Feb 2026 17:27:10 +0100 (CET) Received: from SA1PR02CA0008.namprd02.prod.outlook.com (2603:10b6:806:2cf::13) by MW4PR12MB7168.namprd12.prod.outlook.com (2603:10b6:303:22d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9587.18; Mon, 9 Feb 2026 16:27:00 +0000 Received: from SA2PEPF00001504.namprd04.prod.outlook.com (2603:10b6:806:2cf:cafe::2c) by SA1PR02CA0008.outlook.office365.com (2603:10b6:806:2cf::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9587.19 via Frontend Transport; Mon, 9 Feb 2026 16:26:59 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SA2PEPF00001504.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9587.10 via Frontend Transport; Mon, 9 Feb 2026 16:26:59 +0000 Received: from localhost (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 9 Feb 2026 10:26:56 -0600 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: 2df235dc-05d4-11f1-9ccf-f158ae23cfc8 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VwuDeEBFjZD1jOoSSiwMO2yI/Q6CpT5O0yCBa2PkOYjViBp73QqXfvexCj0qrttrbdzGTcqSq38lq/zN06XEiMV4+CaI3kpTL862kH1CBiSc7ukQZwgbSa29utfaX1ywJoX//165OYpYCOyxEhRHOZw1+iU8CWFEDmCyvXi6O75pwVm6wWFuF2GNHOaPJbyKXPTmN0x1uG+h57zTt1+OwsrIba/GaQUwXmqK6/hVLr35gun2hBKa4uXQX2oQjnDT09bFXDijU6B6jxW8jmDLx6HleIJTkr1oLmhB0idLf0jdKAE907Vr79mxA4gjkbu+9/ztpWNDJ/P9RkzE3ZEtsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I0lVqEgne2CCU604ZviDZqPCpqQufrPW3RonEOcw48o=; b=vlU2WPWNCCGdRv+QAREUPuQ6Wqcgfa6bZDCoqO+PIGDYIsQYqyoMEe/jQ9mrXaRPhM3DGx9JDUfUrkKgZnqvabKJCK7bEa7Q6vF2l4ZK+xR/6lhc7dW+0qSPDvollFcbWs1lMDAigVwsm7sZ7aGtt+j2TRuPJwnpHvSREb2/X7EQ/P3EbFeKFOFrCwxW2iZ/6Av8yqsbEx/zwk77snJjoMMdA5wlYgmk5c98wKzOw/VYYIUaACfrTASLTMIG+DuVTUpMTPPV86D6UUCHmeczKFx0xM+6hU3aXtAO0oKr/0cxxyEG5irW/dBeHNtqLOkdIp0BNa4xNv9W8cqqJlVqqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I0lVqEgne2CCU604ZviDZqPCpqQufrPW3RonEOcw48o=; b=wADm73/OPPxaP4VWOD42u6r/l0V5C8W7CyYyvv5Hn1JgwPV90XvQCxd5EA8KGqYosa4udZOHZb/EArk7jhbP0FhUH94+hTYx/kiEENHm/1XPSisInNnGytzEm05vEFspTtraSVndx13gkOofPMRYNEHUZhCAUxu352y+M7jIZFI= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Date: Mon, 9 Feb 2026 17:26:54 +0100 Message-ID: Subject: Re: [PATCH] x86/hvm: short-circuit HVM shadow guest creation earlier From: Alejandro Vallejo To: =?utf-8?q?Roger_Pau_Monn=C3=A9?= CC: , Jan Beulich , Andrew Cooper , Xen-devel X-Mailer: aerc 0.20.1 References: <20260209144049.86535-1-roger.pau@citrix.com> In-Reply-To: X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001504:EE_|MW4PR12MB7168:EE_ X-MS-Office365-Filtering-Correlation-Id: d303d922-cfd0-449c-d8a6-08de67f80c97 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?VUk5eGY1Ujd4clNyTnJOYXBLNGx6L2JSRTVQcHhJY1lUajZndnRRV2lqWXFm?= =?utf-8?B?SkZvcDRaTzZTdkJUWDRzTXpkREVGSzEzeTJHZE00WUtZSVZTbmN2cXB1ajZG?= =?utf-8?B?ZUpvL2tIMlRxamRRRndsTVhkaTU1T25iTHlueTVORjAwcVlyb29ENndRTkN6?= =?utf-8?B?SzYxTDFEQlRvZ1pXbVZRQmVkVDA0bzF1L2lad3BmWDBNakl0S1lab2VlcVpF?= =?utf-8?B?eVdzeDEwaGxucGp1MFRDa0lRT3BrNnJsM1d4MnJzM1UveXI1TjZkV2NFRnho?= =?utf-8?B?UEdpTDQrNTc3Z3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= =?utf-8?B?d1owcUJ3RDByV3ZjOVczVXlCUlF6UjI5TlZwL2QwY3lsSUJsNERjS1VNVlYv?= =?utf-8?B?VVBnNmNpMlJ4TnhCdUk2QUlRR3ZVYVIySXFPdDBDM01FbmRRZHh3aXR0YWJx?= =?utf-8?B?dmlZckdXV2dMOFYyVWhtbkxRbkNBPT0=?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024)(7053199007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HyyYZU19RrMBK4A4DwN67EMRTVdZIEB7zRyVEt5RFVJpC2yGxtuMSvtt/LH0XcPv6XwNki3anwyWywlTQuH9hKzrJqZ29g//aPiY/fxMoCznn7f6OVb+kp+77RqYId2WZArGaSPfPJ7oHoQoxEW/XYRVnfvqHWweFX0AVoxfQPvXCJH3PHWujmV5vkT83VZLta7EK4zCHedWm6vP4f3QpJjlTVcuXkP3hRBSzacuJxggRaJMzejUweDxwJYvvIy5QFEpjscGecE9xrJc+ji6la2P2XlOoolmTeqG6m7BUUt3w+InTBJj0n/KHqxigkTJ6BuLy+16rglz/5U3xyvY4jQA9h1DEfgD4ZoXuQiZCAQnWKjbLPDYKk4jHkhusmetBY8pgjXYNUR6rsX/mNWXSgjm+WAk4lh/eOBC2lNsOWOqAjsGShjD699gYmasPCcl X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2026 16:26:59.3370 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d303d922-cfd0-449c-d8a6-08de67f80c97 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001504.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7168 On Mon Feb 9, 2026 at 5:11 PM CET, Roger Pau Monn=C3=A9 wrote: > On Mon, Feb 09, 2026 at 05:02:26PM +0100, Alejandro Vallejo wrote: >> On Mon Feb 9, 2026 at 3:40 PM CET, Roger Pau Monne wrote: >> > If shadow paging has been compiled out short circuit the creation of H= VM >> > guests that attempt to use shadow paging at arch_sanitise_domain_confi= g(). >> > There's no need to further build the domain when creation is doomed to= fail >> > later on. >> > >> > Signed-off-by: Roger Pau Monn=C3=A9 >> > --- >> > xen/arch/x86/domain.c | 6 ++++++ >> > 1 file changed, 6 insertions(+) >> > >> > diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c >> > index 8b2f33f1a06c..8eb1509782ef 100644 >> > --- a/xen/arch/x86/domain.c >> > +++ b/xen/arch/x86/domain.c >> > @@ -627,6 +627,12 @@ int arch_sanitise_domain_config(struct xen_domctl= _createdomain *config) >> > return -EINVAL; >> > } >> > =20 >> > + if ( hvm && !hap && !IS_ENABLED(CONFIG_SHADOW_PAGING) ) >> > + { >> > + dprintk(XENLOG_INFO, "Shadow paging requested but not availab= le\n"); >>=20 >> nit: s/requested/required/, maybe? > > The wording matches the rest of the messages in > arch_sanitise_domain_config(). I'm not saying that makes it correct, > but if we word this differently we should also change the others > IMO. My point is rather that HAP, or relaxed MSRs, or other settings are activel= y requested via createdomain flags. Shadow is instead the consequence of not setting HAP. You don't request shadow, you either requested something else = or you hit the error. It's not terrible wording, just imprecise. >> Also, with this in place can't we get rid of the panic in create_dom0() = that >> checks an identical condition? > > Hm, I would possibly leave that one, as I think it's clearer for the > dom0 case. Otherwise someone using a build without HAP or shadow and > attempting to boot in PVH mode will get a message saying: "Shadow > paging requested but not available", which is IMO less clear than > getting a "Neither HAP nor Shadow available for PVH domain" error > message. > > Just my thinking, both checks achieve the same result, but the error > message in the create_dom0() instance is more helpful in the context > of dom0 creation. Fair enough. It doesn't matter much anyway. With or without the adjusted pr= intk. Reviewed-by: Alejandro Vallejo Cheers, Alejandro