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 7D0AECD342C for ; Wed, 6 May 2026 07:45:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1301233.1575534 (Exim 4.92) (envelope-from ) id 1wKWwA-0007Qk-Rt; Wed, 06 May 2026 07:44:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1301233.1575534; Wed, 06 May 2026 07:44:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wKWwA-0007Qd-PG; Wed, 06 May 2026 07:44:54 +0000 Received: by outflank-mailman (input) for mailman id 1301233; Wed, 06 May 2026 07:44:53 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) id 1wKWw8-0007QX-WE for xen-devel@lists.xenproject.org; Wed, 06 May 2026 07:44:53 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wKWw7-008Xqc-S1 for xen-devel@lists.xenproject.org; Wed, 06 May 2026 09:44:51 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69faf173-2eae-0a2a0a5409dd-0a2a4502b3fc-0 for ; Wed, 06 May 2026 09:44:51 +0200 Received: from [209.85.218.46] (helo=mail-ej1-f46.google.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69faf173-af86-0a2a45020019-d155da2ec48a-3 for ; Wed, 06 May 2026 09:44:51 +0200 Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-b8f9568e074so917106266b.0 for ; Wed, 06 May 2026 00:44:51 -0700 (PDT) Received: from [192.168.1.6] (user-109-243-69-121.play-internet.pl. [109.243.69.121]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bc55ecffad3sm49090966b.46.2026.05.06.00.44.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 May 2026 00:44:50 -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" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778053491; x=1778658291; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QkoEEvXZ0nd9/OFXBMW0XbitQDRY2IA2LH/1rm9+raY=; b=kEg+yzantVl9dT7tjwETxnVpo/AYi5DJgyO/3Tjao+C0dylTIxrdA+RNVUIJOPs6sd xElIHqaudqsHVZ76GaVJomEnW5/T7OW37N6LNuaWnUJsbJUOdlLs0odqGjuqg2D37NI7 DSQlISWS406rlT+7SnEEuCOLPxZ2v/pzjZVhwr6RhC0MYESUmSxEZbvb5www5gQb0v5b hp8U0r19cpYUuq6iQyLwtnO9Vftyl1AkXjt+JaqB+/b4IGKaosK9XYlw3Q4ZsT7HeTBC 4v4o9qLtKB0GjJ4sqgzigiVIJeMDyvuCQYA+hOI6tv/qA8bEDd1A2Nk7Bdc6Z0auovbU cqQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778053491; x=1778658291; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QkoEEvXZ0nd9/OFXBMW0XbitQDRY2IA2LH/1rm9+raY=; b=glKMjsNnkJmKN2H/9GHT7exfI9uc0PJ1qE1OkvYL9qmP+OkgF1xtfdwZzB6K3Y3Rtv gNTUuzYY/26HjGP6hDknG+DunuyiNWnk9jQgtAgEhSA9enjnSwjPz6UgwYireqlztfTY BsgRUCCxgf+1mnHWz60kZR9/NqNhyRkmfnbbDgwfgm5qFRKnT0mYZvdRXpkDWm5Wq+1K g90su3NIde0katojNThDupP/gq6pEDguz/qiA+QpNaPrbK3qcLdE0tVg6/OBsE2Pl2Xm 1i9H3UIgzr3eOoSCMtSHB/OGhPHU6j3dSOsJGU4HIHQa5ein2TXas2yxJur9npsTsIDd AvUg== X-Forwarded-Encrypted: i=1; AFNElJ/XR6iyXJ6c+IKGuHy+dFS376bB32IdyNTwa/VpAuhV7Ocu73wrA47IUYppEn8/HxG8kMtjTNDLYok=@lists.xenproject.org X-Gm-Message-State: AOJu0YyGikZjtQlsVKmhergNc6RVJdcbN3bX15fyC3pNmYYgXG9oYSb0 gHvMeDXU1/vExAxHTYEDIjXkS4+Wjc4pq185ehblwgp/j5Smpgv3T+H+ X-Gm-Gg: AeBDieuyD75O55WUIsCld2xsPn4x7PhiqcB4EYgZfONM9VVLo7WRnpa3DMJeVeyHyxg 4IaAqP1xdW8O8bXvK3Dl+t0TzbKR5AUHCNnfLUlEPdFQySCUJizqA1BgjDbhS0U9R9BJpgKWd89 MymKgHTPWWywbXHC1nAK7hnNaDWLqKu7sgsiLNIBGCzJPiJ6TdI61Mn7FDqZ2beJTWCtB3X/XYY D+L7djLzqlqnqKicndXnzN1rQ9nGdegzm57JY70r3QRgPxr8fEu+4HlEwFACAeGR6cpozddC66c SS4FuVjU+21z1IbCN7p8PnzceRX6S9sCeMfOwyQkdGpHhGpOMi9cmUX5H66277J9S7Uq/hfJu/b GVj5P+rSFN/wLjaHgnalBkCcsD//g4hQ+df8kiaXOqF5fwljeIiKDEJr0rRP3tqVvpqlrHtgCKU 9fE8iZzg9TGbH91W8IgAAHUIkufNxjELYYpvZ7QNlz2FFH/Ifrp3xkUMnvzbMWYddHFsxDWx4Ua VsY9rd3iE9dSA== X-Received: by 2002:a17:907:2685:b0:bb5:8532:af4b with SMTP id a640c23a62f3a-bc56e40f24amr84274666b.26.1778053490996; Wed, 06 May 2026 00:44:50 -0700 (PDT) Message-ID: <2ec5eec1-0a7d-445f-9d96-99b3070afeb1@gmail.com> Date: Wed, 6 May 2026 09:44:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 3/3] xen: introduce CONFIG_HAS_DOMAIN_TYPE To: Jan Beulich , Michal Orzel Cc: Romain Caritey , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , Anthony PERARD , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , xen-devel@lists.xenproject.org References: <7c91e1a705e1046be4af1c5671a8d91cf3557013.1777296786.git.oleksii.kurochko@gmail.com> <5daeb8f7-cf0f-4ea7-a686-93df36b43a30@suse.com> Content-Language: en-US From: Oleksii Kurochko In-Reply-To: <5daeb8f7-cf0f-4ea7-a686-93df36b43a30@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-purgate-ID: tlsNG-720697/1778053491-80B78161-F99BE298/10/73395122804 X-purgate-type: spam X-purgate-size: 3034 On 5/4/26 2:21 PM, Jan Beulich wrote: > On 27.04.2026 17:34, Oleksii Kurochko wrote: >> As domain type is part of common code now there is no any reason >> to have architecture-specific set_domain_type() functions so >> it is dropped. >> >> Change the guard around access of kinfo->type to CONFIG_HAS_DOMAIN_TYPE >> for consistency. Also, drop and add some parentheses to be aligned >> with the similar if() below. >> >> x86 with CONFIG_64BIT=y shouldn't use is_{32,64}bit_domain() as >> x86 doesn't have support of CONFIG_HAS_DOMAIN_TYPE. Since x86_32 Xen no >> longer builds, the fallback is currently only relevant for arm32. >> >> Signed-off-by: Oleksii Kurochko >> Reviewed-by: Michal Orzel > > In principle: > Acked-by: Jan Beulich Thanks. > > However, still a few remarks: > >> --- a/xen/include/xen/domain.h >> +++ b/xen/include/xen/domain.h >> @@ -13,6 +13,19 @@ struct guest_area { >> void *map; >> }; >> >> +#ifdef CONFIG_HAS_DOMAIN_TYPE >> +enum __packed domain_type { >> + DOMAIN_32BIT, >> + DOMAIN_64BIT, >> +}; >> +#define is_32bit_domain(d) ((d)->type == DOMAIN_32BIT) >> +#define is_64bit_domain(d) ((d)->type == DOMAIN_64BIT) >> +#elif !defined(CONFIG_64BIT) >> +/* At the moment on 32-bit-only platforms all domains are 32-bit. */ >> +#define is_32bit_domain(d) (true) >> +#define is_64bit_domain(d) (false) > > I think it would be nice if the excess parentheses were dropped from here. > >> --- a/xen/include/xen/fdt-domain-build.h >> +++ b/xen/include/xen/fdt-domain-build.h >> @@ -7,6 +7,7 @@ >> #include >> #include >> #include >> +#include >> #include >> >> struct domain; >> @@ -69,6 +70,14 @@ static inline uint32_t alloc_phandle(struct kernel_info *kinfo) >> return kinfo->next_phandle >= GUEST_PHANDLE_GIC ? 0 : kinfo->next_phandle++; >> } >> >> +static inline void set_domain_type(struct domain *d, struct kernel_info *kinfo) > > Pointer-to-const for the 2nd parameter? I will apply this comment and comment above. > >> +{ >> +#ifdef CONFIG_HAS_DOMAIN_TYPE >> + /* Type must be set before allocate memory */ > > This comment would be more prominent if it lived outside of the #ifdef, > perhaps (read on) ahead of the function. I wonder though why it's only > a comment, and not e.g. an assertion. If an assertion was possible to > add, the comment would want to live next to it. Without an assertion > putting it ahead of the function may be better. > > Depending on how far to go, changes could be made while committing, or a > proper v5 may want submitting. I think that instead of comment or just after comment the following could be added: ASSERT(!domain_tot_pages(d)); Jan, Michal, do you see any concern with that ASSERT() or I could add it and keep your Ack-by and R-by. Thanks. ~ Oleksii