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 84467C5AD49 for ; Tue, 3 Jun 2025 07:04:25 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1004035.1383684 (Exim 4.92) (envelope-from ) id 1uMLh0-0006Xj-M1; Tue, 03 Jun 2025 07:04:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1004035.1383684; Tue, 03 Jun 2025 07:04:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uMLh0-0006Xc-Ie; Tue, 03 Jun 2025 07:04:14 +0000 Received: by outflank-mailman (input) for mailman id 1004035; Tue, 03 Jun 2025 07:04:13 +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 1uMLgz-0006XR-3o for xen-devel@lists.xenproject.org; Tue, 03 Jun 2025 07:04:13 +0000 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [2a00:1450:4864:20::429]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f2f0a92c-4048-11f0-b894-0df219b8e170; Tue, 03 Jun 2025 09:04:10 +0200 (CEST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3a50fc7ac4dso838368f8f.0 for ; Tue, 03 Jun 2025 00:04:11 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23506bdd06fsm81387255ad.101.2025.06.03.00.04.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Jun 2025 00:04:10 -0700 (PDT) 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: f2f0a92c-4048-11f0-b894-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1748934250; x=1749539050; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=ORnZR+XmtviWUd4DceF+imR5GCBsuWqg3AXM9xbvPwk=; b=E/z0m/+OYkUDlv6MwahqSnqkCFyawzDbM3aorIYRa7pebgkkoK+b2eYbWi5L+H1ArO Exy1iXLbW65omaUZLCLag4kQjAJCUKWVUMUJNWPd6u1ch/j64BrzEZY7sA+b8vTdchpZ /crLEPCOd7qdJFOQaya0YsbJ8ruXOlw2AcBXF7qyXfLN6Tj5libiM32xkPPQnr56p0L7 sLdgg3xGHoWLbDc4+6kq2xDTyoPmiRUodXbYFepTz4awcy4u6K559BpuSR1sDqm9LTk8 8mGfvAPIGb87WE5Sx8cArROh9d0xq4B7JPZxIRPHMpGsSmggBqbmWZ1w/Hqc3uwh8V/b 8k3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748934250; x=1749539050; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ORnZR+XmtviWUd4DceF+imR5GCBsuWqg3AXM9xbvPwk=; b=pcTOFl/TmlplwDo+qE1LceDibsoY0gmex5kkfpZfEjWT3KnAye0UCWYPx3glUKfJPs J6KbDX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025:b0:3a3:63d3:369a with SMTP id ffacd0b85a97d-3a4f7a63dfcmr12894877f8f.25.1748934250542; Tue, 03 Jun 2025 00:04:10 -0700 (PDT) Message-ID: <87224eb9-d4a6-4589-8cc2-e222619f8dde@suse.com> Date: Tue, 3 Jun 2025 09:04:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 07/19] arm/gnttab: Break cycle between asm/grant_table.h and xen/grant_table.h To: Alejandro Vallejo 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" , xen-devel@lists.xenproject.org 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> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A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bit 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 >>>>> >>>>> -#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=n >>>> 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=n was the best we could with >>> the older toolchains in order to not try to include a header that might not >>> exist. The high number of sequential inclusions of xen/grant_table.h and >>> 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 present >>> but even then sometimes the arch-specific header is required even when >>> the option is not selected. This causes inclusion sites to needlessly >>> 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=n? Overall >> we're trying to reduce dependency trees rather than growing them further. > > 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 to begin > with. > > Forcing the code to include both seems counter-productive to me. Depends on how frequent the double inclusion is, imo. Jan