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 51F5BC5B543 for ; Thu, 5 Jun 2025 17:23:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1007252.1386555 (Exim 4.92) (envelope-from ) id 1uNEJ1-0006L4-R6; Thu, 05 Jun 2025 17:23:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1007252.1386555; Thu, 05 Jun 2025 17:23:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uNEJ1-0006Kx-O2; Thu, 05 Jun 2025 17:23:07 +0000 Received: by outflank-mailman (input) for mailman id 1007252; Thu, 05 Jun 2025 17:23:06 +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 1uNEJ0-0006Kr-B4 for xen-devel@lists.xenproject.org; Thu, 05 Jun 2025 17:23:06 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20628.outbound.protection.outlook.com [2a01:111:f403:2412::628]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id bc58ccfe-4231-11f0-a300-13f23c93f187; Thu, 05 Jun 2025 19:23:05 +0200 (CEST) Received: from BN9PR03CA0874.namprd03.prod.outlook.com (2603:10b6:408:13c::9) by PH7PR12MB7427.namprd12.prod.outlook.com (2603:10b6:510:202::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8792.37; Thu, 5 Jun 2025 17:23:00 +0000 Received: from MN1PEPF0000F0E4.namprd04.prod.outlook.com (2603:10b6:408:13c:cafe::37) by BN9PR03CA0874.outlook.office365.com (2603:10b6:408:13c::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8769.18 via Frontend Transport; Thu, 5 Jun 2025 17:22:59 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by MN1PEPF0000F0E4.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8792.29 via Frontend Transport; Thu, 5 Jun 2025 17:22:59 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 5 Jun 2025 12:22:57 -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: bc58ccfe-4231-11f0-a300-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ctZm2dkUGRSZWsMZS3ZvpbvQQfng/nt/Z3o6YAXXvIJ57a+aoJ5DqHUQQNkmXUVW9ttEK6hvOgGl6iUuN1YM029pWo6ifgCNG6WkVAI20IljRf2cTKyb+BRSU988HNQs2FwkJWnEx7YMnD2Pfp/b7I1T1jKQmwEpvspi90UBpNHzN2v3gYGkBAuCW8KQ4Y3ekRpJPSKQ9YGOuOktpvme8UhcbH78U1MTDt1n8jbhBvYriY8PclLHCNHXjGQM/YSpsp1PagcQVxL6zmH5iUDB7uQ7ovpWigsE7Aqro395sF+9J/qq/HyqJB3W5ib8u0TYId/T8JjWGiNaOL4WFiHGLw== 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=H6kfwSE7s6bQuZ3N1lUT5jMKzInmxmzg2O+OG1b5az8=; b=qMXsh8/8CL5F81hIibkrmiW5ZFt2OqMEax+Qnel40CYJkNf8YAvIetBW4qKkF0soKaRWqm0UvWS045K4TwGmXwofxTQsF/xQ1AmfsNxGuSintEA9TWJ43pAiXbsyauaQhWdnh/TE3N05v+XvatJFmmg+rVP9N/K2brMOpwusmY4EzVswoszViFAEZ1CXupgBAWCFLSDrmyhJ0MksASL0hrf0jMcaL9CBF0pU6RjaG6pw3oXjYpE78tUK7+YeXi7uKEu98HoipABmzLJC6iU0baRQXJfPZ5Vr4tt2BmUAtgqQ314lE1ztmfLGoxYcjLkZFDEk79kFHWoRQUixZdlz2A== 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=H6kfwSE7s6bQuZ3N1lUT5jMKzInmxmzg2O+OG1b5az8=; b=xS7AG1GftEABFU2Bz+FTEDfOE/8mLRTsAQMTC2RU64SWJSBdYXkUU/OxS2VLs4XOMgJ9OKR7+cM8fiAXu1ecAWgF4I5A2OCLfLYUzuH+jqcBv13pitq7znAM7p4h25CZkOP1voW6LDiPCnerrBkmjLlgk0Yuj/8WZekjac9Jqfk= 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=SATLEXMB04.amd.com; pr=C MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Date: Thu, 5 Jun 2025 19:22:56 +0200 Message-ID: From: Alejandro Vallejo To: Jan Beulich CC: Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , Anthony PERARD , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , "Daniel P. Smith" , Subject: Re: [PATCH 07/19] arm/gnttab: Break cycle between asm/grant_table.h and xen/grant_table.h X-Mailer: aerc 0.20.1 References: <20250530120242.39398-1-agarciav@amd.com> <20250530120242.39398-8-agarciav@amd.com> <5f3de127-70cd-422f-a368-6c23d83c6cf9@suse.com> <6cc4d172-793b-4d3e-990e-f8fd0d4bbabc@suse.com> <87224eb9-d4a6-4589-8cc2-e222619f8dde@suse.com> In-Reply-To: <87224eb9-d4a6-4589-8cc2-e222619f8dde@suse.com> X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E4:EE_|PH7PR12MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ce2dff7-95d0-4cbb-cc8f-08dda4559eaa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|7416014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ZjZXMHk3T3BWenNnQWc4SDkvZWFVSW5KQitqaDhyOXpWVTBPQzhRd0pLaVIz?= =?utf-8?B?bU82QVFieHBrZzNtT0xzb3R2VUx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EYzJX?= =?utf-8?B?MmRqbitPVzdBYmNQUVovTzNaeTdsYnRwM3BCMWd3dy93OEZOT3dHYjdodWNs?= =?utf-8?B?RU5nMGdYbG11U1QzSjEveW9nM3lDd095Uks4N1dDTFYxVWxwblJpT0lJcDZk?= =?utf-8?B?NGhkemJXNzBnL0hjSEV2enlKRnVZVEpQd0wzakZ4NlQ0WXh2ZDBnQWI1U2M3?= =?utf-8?Q?dEmKnE?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(82310400026)(7416014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2025 17:22:59.7188 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ce2dff7-95d0-4cbb-cc8f-08dda4559eaa 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0E4.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7427 On Tue Jun 3, 2025 at 9:04 AM CEST, Jan Beulich wrote: > On 02.06.2025 18:39, Alejandro Vallejo wrote: >> On Mon Jun 2, 2025 at 4:51 PM CEST, Jan Beulich wrote: >>> On 02.06.2025 16:30, Alejandro Vallejo wrote: >>>> On Mon Jun 2, 2025 at 9:53 AM CEST, Jan Beulich wrote: >>>>> On 30.05.2025 14:02, Alejandro Vallejo wrote:> --- a/xen/include/xen/= grant_table.h >>>>>> +++ b/xen/include/xen/grant_table.h >>>>>> @@ -27,7 +27,7 @@ >>>>>> #include >>>>>> #include >>>>>> =20 >>>>>> -#ifdef CONFIG_GRANT_TABLE >>>>>> +#if __has_include("asm/grant_table.h") >>>>>> #include >>>>>> #endif >>>>> >>>>> This change looks wrong (or otherwise is lacking justification): With= GRANT_TABLE=3Dn >>>>> the arch header isn't supposed to be included. >>>> >>>> It's not equivalent to the previous code; but that's a feature, not a = bug. >>>> >>>> Not including the header with GRANT_TABLE=3Dn was the best we could w= ith >>>> the older toolchains in order to not try to include a header that migh= t not >>>> exist. The high number of sequential inclusions of xen/grant_table.h a= nd >>>> asm/grant_table.h seem to attest to that. >>>> >>>> I can ammend the commit message to be clearer, but IMO this is what it= was always >>>> meant to be. I can replace the current commit message with: >>>> >>>> "The previous toolchain base version didn't provide __has_include(),= which >>>> allows conditional inclusion based on a header's existence. Lacking= that >>>> feature the inclusion was guarded by the GRANT_TABLE option being p= resent >>>> but even then sometimes the arch-specific header is required even w= hen >>>> the option is not selected. This causes inclusion sites to needless= ly >>>> include both asm/grant_table.h and xen/grant_table.h. >>>> >>>> Using __has_include() removes this requirement at inclusion sites." >>>> >>>> Thoughts? >>> >>> So why would we include a header we don't need when GRANT_TABLE=3Dn? Ov= erall >>> we're trying to reduce dependency trees rather than growing them furthe= r. >>=20 >> Because we do need it or the code doesn't compile. gnttab_dom0_frames(),= for >> instance, exists and is used in unguarded statements. > > I fear I don't understand this: Things are building fine right now, aren'= t > they? > >> There's more case like >> that. It may be possible to break those dependencies so the inclusion is >> not always expected, but the reality is that you tend to need the other = header >> for pretty much the same class of reasons you needed xen/grant_table.h t= o begin >> with. >>=20 >> Forcing the code to include both seems counter-productive to me. > > Depends on how frequent the double inclusion is, imo. > > Jan Not as much as I feared. I've removed both linkages for v2. Cheers, Alejandro