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 3634EC87FCB for ; Wed, 6 Aug 2025 21:24:52 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1072243.1435470 (Exim 4.92) (envelope-from ) id 1ujlcR-0006NL-Op; Wed, 06 Aug 2025 21:24:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1072243.1435470; Wed, 06 Aug 2025 21:24:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ujlcR-0006NE-KF; Wed, 06 Aug 2025 21:24:19 +0000 Received: by outflank-mailman (input) for mailman id 1072243; Wed, 06 Aug 2025 21:24:18 +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 1ujlcQ-0006N8-EM for xen-devel@lists.xenproject.org; Wed, 06 Aug 2025 21:24:18 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2061e.outbound.protection.outlook.com [2a01:111:f403:2412::61e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b199dbb7-730b-11f0-b898-0df219b8e170; Wed, 06 Aug 2025 23:24:12 +0200 (CEST) Received: from MW4PR04CA0336.namprd04.prod.outlook.com (2603:10b6:303:8a::11) by MN2PR12MB4389.namprd12.prod.outlook.com (2603:10b6:208:262::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8989.20; Wed, 6 Aug 2025 21:24:06 +0000 Received: from MWH0EPF000A6735.namprd04.prod.outlook.com (2603:10b6:303:8a:cafe::cf) by MW4PR04CA0336.outlook.office365.com (2603:10b6:303:8a::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8989.20 via Frontend Transport; Wed, 6 Aug 2025 21:24:06 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MWH0EPF000A6735.mail.protection.outlook.com (10.167.249.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9009.8 via Frontend Transport; Wed, 6 Aug 2025 21:24:06 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 6 Aug 2025 16:24:04 -0500 Received: from [172.17.35.128] (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 6 Aug 2025 16:24:03 -0500 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: b199dbb7-730b-11f0-b898-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZATdNZaHjT1fTZvxqTot48iPjdglfKrBo3fyi7Qa3egnfI9iRhEpUoAy8/+yJy3jjUBzeREsqwOo3MZw9xL6q99KGNvr4/jGjvMFslk+DDM8e/9p3BeQ6DPVHDV9mvnUKZ7csvfi92syc1VMwTG+F0kW7yKW/WJMsEv12F+sMVWERfTGr39ync997zVPNgmuFmgUDRXvUjoBrVm+0ftGigUEmhHuIczt3zu5YyfwEulVjO/wZP1TRV53x57RD2rYUoGddyggoK+Eg0hjROmplynjHUal1c5XtoJGQ4CoUolNfAht6pQ5mbRmrMN4ZTnX9b3+PCQ5LjBqK3xqK0/mdw== 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=39EmAH5FAicSc8YRclDIl5SElJIogV7JY0cYKX8W230=; b=RSzmtYso2OYnH42pyzDZJMiRlknhWczWip9UxjqmGUcK62itBMz/pLcNt0gnpkJG3Bl2hnca8vdVBmRzCAiGtnlFfTxXHsvImk5gEXwT7F7IqXxZUSUm80ao9FfhLisvpVNcZW8VbRYiFaLhV1DY1BcoWpfBh9dpojs35Ucx+ngKieLToDtnSYWmKA5KzIOO6swr5gnIJGUdJZ3x10wpS1+BWdROKWLGQjLyKvbs7wwLbBszTHf26uhyfjxoJnwe3N/B1H0NLoA2s1BoTnFiHs13H8Lg3ewgxyM0iwJDVUv/KKhqUVytrLHu9Ca/M8GjPtizb8JJqQKbdgmT907/DA== 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=39EmAH5FAicSc8YRclDIl5SElJIogV7JY0cYKX8W230=; b=tjwqBFbFMiaaykTwv9QWckuXtF80hCQlvfiP7D4KKtsSeOrA7M1IvfD81UaebNS0WTslRUgwvfvfvDywi9eE8lY4jLvdgly3nB28uO1tx+amZn5027S6Kllq7P3LAUKaCbHGI4/Xy5WR7WbSzm++AIZTrHTLF3K+jin+vmBAOY0= 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=SATLEXMB03.amd.com; pr=C Message-ID: Date: Wed, 6 Aug 2025 17:24:05 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] x86/mm: correct PG_log_dirty definition To: Jan Beulich , "xen-devel@lists.xenproject.org" CC: Andrew Cooper , Julien Grall , Stefano Stabellini , Anthony PERARD , Michal Orzel , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Penny Zheng References: <65e27b35-9256-4ab0-966a-c50a18900ba5@suse.com> Content-Language: en-US From: Jason Andryuk In-Reply-To: <65e27b35-9256-4ab0-966a-c50a18900ba5@suse.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A6735:EE_|MN2PR12MB4389:EE_ X-MS-Office365-Filtering-Correlation-Id: 646cf61f-ed6b-4cd0-c099-08ddd52f931c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014|7053199007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?RUNFNnNnd2FWSmFkYXlZdjF2TmF3MWxQbEZIbCs1SFdqN2NsV05nS3VINHlz?= =?utf-8?B?aHk5Mk03WVQvYUloZXdtVFM2SjV0K1pEMDZlM1NzWWlOVVJGMXM2LzZLZlhQ?= =?utf-8?B?cHBLYTlSbDg2L3JRcXZzdU4wdUV3VzlkUXNSMGUwZ2N5dVRHenBOSURMcEs3?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Zmxxcjc4ZWIva2tsa2Q1TnZSbXRLSENxNGQz?= =?utf-8?B?WmEyNVBjYVo1d1JMMFlXc25id0gvY3ZRaXVVZDhaNlBZbzJxeHBiU3E1Vnoy?= =?utf-8?Q?RtchG6?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014)(7053199007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2025 21:24:06.3429 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 646cf61f-ed6b-4cd0-c099-08ddd52f931c 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000A6735.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4389 On 2025-08-05 03:59, Jan Beulich wrote: > While it is correct that in shim-exclusive mode log-dirty handling is > all unreachable code, the present conditional still isn't correct: In a > HVM=n and SHADOW_PAGING=n configuration log-dirty code also is all > unreachable (and hence violating Misra rule 2.1). > > As we're aiming at moving away from special casing PV_SHIM_EXCLUSIVE=y, > don't retain that part of the conditional. > > Because of hypercall-defs.c we need to carry out the dependency by > introducing a new auxiliary PAGING control. > > Since compiling out mm/paging.c altogether would entail further changes, > merely conditionalize the one function in there (paging_enable()) which > would otherwise remain unreachable (Misra rule 2.1 again) when PAGING=n. > > Fixes: 23d4e0d17b76 ("x86/shim: fix build with PV_SHIM_EXCLUSIVE and SHADOW_PAGING") > Signed-off-by: Jan Beulich > --- > Of course PAGING is at risk of being confused with MEM_PAGING. It not > having a prompt, I hope that's tolerable, as I can't really think of a > better name. > > Other PG_log_dirty pre-processor conditionals then likely also want > replacing. mm/paging.c and mm/p2m-basic.c could also be compiled out > altogether when PAGING=n, at the expense of introducing a few more > stubs. > > FTAOD, the Fixes: tag being referenced does not mean this patch corrects > the far more recently introduced build issue with the combination of the > two features. That's still work that I expect Penny to carry out (with > there still being the option of reverting the final part of the earlier > series). > > --- a/xen/arch/x86/mm/paging.c > +++ b/xen/arch/x86/mm/paging.c > @@ -864,6 +864,7 @@ void paging_final_teardown(struct domain > p2m_final_teardown(d); > } > > +#ifdef CONFIG_PAGING The file already has a lot of uses of #if PG_log_dirty with similar meaning, if I am not mistaken, so using that would make it more consistent. But CONFIG_PAGING is directly tied to the Kconfig, so maybe it is better? Just something I noticed. Reviewed-by: Jason Andryuk Regards, Jason > /* Enable an arbitrary paging-assistance mode. Call once at domain > * creation. */ > int paging_enable(struct domain *d, u32 mode) > @@ -889,6 +890,7 @@ int paging_enable(struct domain *d, u32 > else > return shadow_enable(d, mode); > } > +#endif > > #ifdef CONFIG_HVM > /* Called from the guest to indicate that a process is being torn down