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 D5C59E81BD7 for ; Mon, 9 Feb 2026 15:08:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1225576.1532106 (Exim 4.92) (envelope-from ) id 1vpSsI-0004CB-Ej; Mon, 09 Feb 2026 15:08:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1225576.1532106; Mon, 09 Feb 2026 15:08:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vpSsI-0004C4-BN; Mon, 09 Feb 2026 15:08:30 +0000 Received: by outflank-mailman (input) for mailman id 1225576; Mon, 09 Feb 2026 15:08:28 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vpSsG-0004Am-Dv for xen-devel@lists.xenproject.org; Mon, 09 Feb 2026 15:08:28 +0000 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazlp170120001.outbound.protection.outlook.com [2a01:111:f403:c10d::1]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2ede6946-05c9-11f1-b162-2bf370ae4941; Mon, 09 Feb 2026 16:08:26 +0100 (CET) Received: from BY1P220CA0024.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::9) by MN2PR12MB4455.namprd12.prod.outlook.com (2603:10b6:208:265::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9564.13; Mon, 9 Feb 2026 15:08:23 +0000 Received: from SJ1PEPF000023D0.namprd02.prod.outlook.com (2603:10b6:a03:5c3:cafe::f7) by BY1P220CA0024.outlook.office365.com (2603:10b6:a03:5c3::9) 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 15:08:22 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF000023D0.mail.protection.outlook.com (10.167.244.4) 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 15:08:22 +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 09:07:01 -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: 2ede6946-05c9-11f1-b162-2bf370ae4941 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AvugacQntXAb/QpydDpSMzW98Zl8mbWqji0AymP64+8L7xQuCcPFk/pU3oEQcuUv5fFuMi3J9JoUX18bwzHs1Dvc4mclGSLVEckBi08GnpXdsAg+DraRztKwbvH7nJUusWZWxzCrrUcHwSmr0nVLeea1XBckYE85hxZuqzq6oekY1VwAGck7JMMzbQBtHr1vUFWAaq73W9pflL5ZdmaNJlFMp+lKD59mxNKT+3Dqo1bKA5c0HTxcU3u7ZdY0GDKT75pz4N/0kTW1oSXQu0ATDA/oDQI55yf2gODxSG38r5lAq9irs8w7tUyvA1TXYo+wi0nna0q8wMlVS1PzO1MEVQ== 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=ZACJAMIXm9fqBihO1qHxx44lQPPNDIw2L15Y3Sh9xok=; b=A/RAdJH6ABD/adWj211XhNMMTiy6PwUwf0q4mW5iqVIsZsgklVhrSl9fhE6kmKYENxprWwRwie6OHPEVDiY1l87PHNjF8pheXY9AJxzxIMr861ON33dM1kSKf4b/IWq+cdqAJ3yPJ/JId7Cg127HsyEz5iMo6N5nAgwLmNjO77xn3W4vhEYDKqYk93DuN2yvnGS4fGBHdEj78/efG6U1MNLMezfwPqMd4E/v/YIoVZFZRM02mMMe+wXq+ZSrp0lkXyYVTPPUks3gSn6e8/LkQZDH/LZkCPeGDqr8cQgjcUF09MqvITujYEILIgCeUxIhu+RGO9DerMm4RhdxVCewKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.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=ZACJAMIXm9fqBihO1qHxx44lQPPNDIw2L15Y3Sh9xok=; b=0VmroLvEj8PDovekTLkOz9OugzZ822fdxHL/P77q6aBwTo884u2aMoIQSEWEEPtlhNDk+ZzdwZEHYB+pWvhKSdOHRSmDF/Vg12tRbZSjfoBrw//3G/duOjs9u4MBkqH/urClIoOTZGNCfmFhO5M0IEksfd1voCrMs858FvYaXig= 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 16:06:59 +0100 Message-ID: To: Jan Beulich CC: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Tim Deegan , Subject: Re: [PATCH] x86/shadow: Delete the none.c dummy file From: Alejandro Vallejo X-Mailer: aerc 0.20.1 References: <20260209104104.7840-1-alejandro.garciavallejo@amd.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: SJ1PEPF000023D0:EE_|MN2PR12MB4455:EE_ X-MS-Office365-Filtering-Correlation-Id: 78074416-145c-44a6-b7b1-08de67ed1119 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?UGhYbzJGY1BoSTB6YnlHUUp0aTNPYUc0RFhva2h1V1Z4Z2t6ZW1xbGxYUFBy?= =?utf-8?B?cFgvRmg0YmZRdm9Lb2FsYWZYMTJlL0ZPYjhyT1BSbnRCVFlFUnhjY3Z4Mndo?= =?utf-8?B?M0pEQTdDTVVzZXFRbndWNFhTY0I0YksvUmdmWTQrbzZkZ25ibDUyc3pxR0NS?= =?utf-8?B?S0pWRTlva0VtNTNudWppOUdOUitPT3pFYmI5eHlYdEUvcFpXSmE5ZVppVHlJ?= =?utf-8?B?ZTF4bGFWSUJLam5uNmVQOU01V1hobTNRdFJmMzEyZFk5L1JpWWlNTngyTFVZ?= =?utf-8?B?dmcydnVqL0JucFR1dlJYNmwzUFdRRVFHeW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3dZamQzUGxWRjBtME1YWVFRZ1RuRG82dlhtM1VqL0NnNDJTVjR2eGo4djk3?= =?utf-8?B?WG5HSkRhaHBFSWhWZUc4K2hzbU9RVlB2bnFEaVFkYVBpUmJkNzhKUzRXWTBK?= =?utf-8?B?bE95cldEOWZBbnkzWTFCNUFZSGZRPT0=?= 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)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JufWAUGwlCjuhj7r5CvbfTRJyHGQgJaQR0qkPMcyojG+mlOv3YaeGzgmTykAihtLbOfRhCwCBGM3qclDpIW9L7kv8BZXfhdFH25tbipS0bwiRQRY97u8ufHO4q814rmD1cJ5A4xK5h47UM9rk+MTP307XIXCgEId7TUlXs5Z/XRS5mJo6eCJsEaOOw7IvqNATJHC84s2lp2XMEhDoEpghlVkze7EIGprPr1gYG4DfigripQyZqdM5HdtRcdMLi3WK546oTEgFlA5ZY0LTKAkzpbR1pDgv7YueqMlqZqrIsvFvDGV1f0dLzmLeg195P8lGKuEcO6L1RoK/+FRA9by9ism/nYnYvS1r0BKs0jTpEZgL8KEwz/VdLyH3rhGc4OX0x+YJVsSSzjonjZ1yfHnVeZo2lzq7iHvfP2dyL5Yy9TWwqZfvwl8HVHRS3ApXNRx X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2026 15:08:22.3895 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78074416-145c-44a6-b7b1-08de67ed1119 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: SJ1PEPF000023D0.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4455 On Mon Feb 9, 2026 at 3:36 PM CET, Jan Beulich wrote: > On 09.02.2026 11:41, Alejandro Vallejo wrote: >> It only has 2 callers, both of which can be conditionally removed. >>=20 >> Signed-off-by: Alejandro Vallejo >> --- >> I'd be ok conditionalising the else branch on... >>=20 >> IS_ENABLED(CONFIG_SHADOW_PAGING )|| IS_ENABLED(CONFIG_LOG_DIRTY) >>=20 >> logdirty patch: https://lore.kernel.org/xen-devel/20260209103118.5885-1-= alejandro.garciavallejo@amd.com >>=20 >> ... to avoid the danger of stale pointers, with required changes elsewhe= re so >> none.c is only compiled out in that case. > > I'm not sure I understand this remark. Is this about something in the oth= er > patch (which I haven't looked at yet), or ... > >> --- a/xen/arch/x86/mm/paging.c >> +++ b/xen/arch/x86/mm/paging.c >> @@ -634,7 +634,7 @@ int paging_domain_init(struct domain *d) >> */ >> if ( hap_enabled(d) ) >> hap_domain_init(d); >> - else >> + else if ( IS_ENABLED(CONFIG_SHADOW_PAGING) ) >> rc =3D shadow_domain_init(d); >> =20 >> return rc; >> @@ -645,7 +645,7 @@ void paging_vcpu_init(struct vcpu *v) >> { >> if ( hap_enabled(v->domain) ) >> hap_vcpu_init(v); >> - else >> + else if ( IS_ENABLED(CONFIG_SHADOW_PAGING) ) >> shadow_vcpu_init(v); >> } > > ... these two hunks? In this latter case, I don't think the bigger condit= ional > would be correct. It'd be about these hunks and the inclusion condition for shadow/. I sugges= t that because... > >> --- a/xen/arch/x86/mm/shadow/none.c >> +++ /dev/null >> @@ -1,77 +0,0 @@ >> -#include >> -#include >> - >> -static int cf_check _toggle_log_dirty(struct domain *d) >> -{ >> - ASSERT(is_pv_domain(d)); >> - return -EOPNOTSUPP; >> -} >> - >> -static void cf_check _clean_dirty_bitmap(struct domain *d) >> -{ >> - ASSERT(is_pv_domain(d)); >> -} >> - >> -static void cf_check _update_paging_modes(struct vcpu *v) >> -{ >> - ASSERT_UNREACHABLE(); >> -} >> - >> -int shadow_domain_init(struct domain *d) >> -{ >> - /* For HVM set up pointers for safety, then fail. */ >> - static const struct log_dirty_ops sh_none_ops =3D { >> - .enable =3D _toggle_log_dirty, >> - .disable =3D _toggle_log_dirty, >> - .clean =3D _clean_dirty_bitmap, >> - }; >> - >> - paging_log_dirty_init(d, &sh_none_ops); > > How do you avoid d->arch.paging.log_dirty.ops remaining NULL with this > removed? ... as you point out, the ops don't get initialised. Adding the log-dirty condition ensures there's no uninitialised ops (even when unreachable). > >> - d->arch.paging.update_paging_modes =3D _update_paging_modes; > > Same question for this function pointer. > >> - return is_hvm_domain(d) ? -EOPNOTSUPP : 0; >> -} Oh. This was a hard miss, true that. >> - >> -static int cf_check _page_fault( >> - struct vcpu *v, unsigned long va, struct cpu_user_regs *regs) >> -{ >> - ASSERT_UNREACHABLE(); >> - return 0; >> -} >> - >> -static bool cf_check _invlpg(struct vcpu *v, unsigned long linear) >> -{ >> - ASSERT_UNREACHABLE(); >> - return true; >> -} >> - >> -#ifdef CONFIG_HVM >> -static unsigned long cf_check _gva_to_gfn( >> - struct vcpu *v, struct p2m_domain *p2m, unsigned long va, uint32_t = *pfec) >> -{ >> - ASSERT_UNREACHABLE(); >> - return gfn_x(INVALID_GFN); >> -} >> -#endif >> - >> -static pagetable_t cf_check _update_cr3(struct vcpu *v, bool noflush) >> -{ >> - ASSERT_UNREACHABLE(); >> - return pagetable_null(); >> -} >> - >> -static const struct paging_mode sh_paging_none =3D { >> - .page_fault =3D _page_fault, >> - .invlpg =3D _invlpg, >> -#ifdef CONFIG_HVM >> - .gva_to_gfn =3D _gva_to_gfn, >> -#endif >> - .update_cr3 =3D _update_cr3, >> -}; >> - >> -void shadow_vcpu_init(struct vcpu *v) >> -{ >> - ASSERT(is_pv_vcpu(v)); >> - v->arch.paging.mode =3D &sh_paging_none; > > And the same question yet again for this pointer. > > Jan However, on the whole. Under what circumstances are these handlers invoked? They are only compiled in for !CONFIG_SHADOW. But these are only applied wi= th HAP disabled. Are they for PV or something? Cheers, Alejandro