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 72091C43458 for ; Wed, 1 Jul 2026 11:59:00 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1349887.1607517 (Exim 4.92) (envelope-from ) id 1wetad-0004Ru-65; Wed, 01 Jul 2026 11:58:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1349887.1607517; Wed, 01 Jul 2026 11:58:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wetad-0004Rn-3F; Wed, 01 Jul 2026 11:58:51 +0000 Received: by outflank-mailman (input) for mailman id 1349887; Wed, 01 Jul 2026 11:58:49 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wetab-0004Rh-BH for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:58:49 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wetaa-00AiHv-GG for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:58:48 +0200 Received: from [10.42.69.8] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a4500f1-2eae-0a2a0a5409dd-0a2a4508b5d6-32 for ; Wed, 01 Jul 2026 13:58:48 +0200 Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com) by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a4500f8-edec-0a2a45080019-d155dd33c89e-3 for ; Wed, 01 Jul 2026 13:58:48 +0200 Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-475417f010dso358136f8f.2 for ; Wed, 01 Jul 2026 04:58:48 -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 ffacd0b85a97d-4756636d2cfsm18350828f8f.17.2026.07.01.04.58.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jul 2026 04:58:43 -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=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt: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=suse.com; s=google; t=1782907128; x=1783511928; 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=VCBBlBIZ2fRRtURovQCiNJjBxSs2iUUYs/xeLtP2pSs=; b=Ji54BCgi9FyjrWIeSbS78GcgMXzS9dq43gTruqg8EZBxVQ0pW/6QOXkNUYZrWzOC2C lAiBIF40cWzOwbhNBLskr/yW8nggf4/UJPz6qTF9xU+pMyaIeiaEzl8FhPeNOKRZ/Suu B4hJc4uS1/0mCn0uOjoTXrkKpwWz2Kz5co/cqRr1FnsEsTPHyw9/eUB58GbwGpsVkgkW yRAD802iDvKP9rVY5fbJMYG/Y6K8loTaGRGEznP0BmBFhbs48+tAkSVRl3WjrbkW75pF TUk+GWNdrfUnBRjOlEON0yzGh+1F8pmi/D4r92V5tLP0XmJ465vWHUYkCAr7GIhOerBk fqQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782907128; x=1783511928; h=content-transfer-encoding:in-reply-to:autocrypt: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=VCBBlBIZ2fRRtURovQCiNJjBxSs2iUUYs/xeLtP2pSs=; b=BWPcrytAgkt3uTVxofQb8U521+TPERwB3vkubFDoH5+7anLS5I0copAZR5fX/ugNJp K0ezPw7/ADhmVnxFQPpCXrQe9BuaQE5K5DLVC2T8c1gt2Cero8p3F5qXmChroBKKywQM Cx4BNMB00KLk9dfLaIj1Di/Fe/plvkt+DyBjlit39B3auueSAeY3UklZAfp04fMHYopo PAOlGrCp5gQfT0GcESALpuFROZwg7HpqV1mIav89StvT3pf1Q5bUfsZjw5nTNIfRyzWc oQuiQ9KvKJyPvunlpZdI7X4+vFO9O4bXsMwEpT6zB7/BDgu++2apVP+9TpYHtY+THlYX fMMA== X-Forwarded-Encrypted: i=1; AHgh+RogWqQUwvIOdvJK14ErAIrjn4yZ9tYxOOFbUAsfi9QuWYxHrvgw1WlSX+Hhi93zooMyyxBMYP3OjTI=@lists.xenproject.org X-Gm-Message-State: AOJu0YwktVK0OEEGlojT71TxaXez+Dud0gI7++Ro2ZZd4Uav7JtjIQ3Z +guV/JjaeaTNBDrsxDTEFyUCXrgjv8YWt3MEKfyjcu5WIc8JZKoJpHen4zRHI4/BlA== X-Gm-Gg: AfdE7clmlxEguagdXZhG+cGERqz5NFjOfmrFlQ0EA0GX0iYkx8zjeatZjvPhWEnT259 LLHKODSGHt6hyt4vz+IbcmFte70oqu34HFOx8algOnR1CclqXK2CoQ2FhJ74MMDhAcr4HM+KwWZ 5bIR6p4ikfiVBpr8HpKPZL2CVgpZxCPRpJe3hi6NQwgdWfgxL/80VpqXK7tFI3qw5YxCQSWmyJD jzUq11VLIsk/ZrUVrd6VmlQ8Ucg732aLQnrnmNkOJQQcjuIBN5F+LLK2UixovDHwhH+UyiZjkwY zk/zhGPCHGKrLYu6tK3j+sAVyxaMs4z94H1m9yXKxjrcdIx7MdYi8PVZf77FSRURqTPVSejJpe2 bdfQMNHiB/oPiIWtFIAL4LE0aALenr8LdaJnNxlDjWMmGiOKcCTJVC5eUiSS4MLQi+LGtXbPk/o RsHt70VdPPYiTRs1wEsbp8kZJwpavV/dnwKVvG4knwO+fSoWwgctFRrziQryQaGkvi8leQNdAk+ CjmPuzOySqLb6w= X-Received: by 2002:a5d:64c3:0:b0:473:da43:44ba with SMTP id ffacd0b85a97d-47757798020mr2295215f8f.22.1782907127866; Wed, 01 Jul 2026 04:58:47 -0700 (PDT) Message-ID: Date: Wed, 1 Jul 2026 13:58:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 20/25] xen/riscv: create APLIC DT node for guest domains To: Oleksii Kurochko Cc: Romain Caritey , Baptiste Le Duc , Alistair Francis , Connor Davis , Andrew Cooper , Anthony PERARD , Michal Orzel , Julien Grall , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , xen-devel@lists.xenproject.org References: <2bab716741ae436c7b92989d7613dac620166b89.1782487661.git.oleksii.kurochko@gmail.com> <76b16195-43a8-40cc-9d22-7b9c21e4c8f1@suse.com> <7d007b0d-d246-45aa-8ce2-579f36f6d8bf@gmail.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9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BM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <7d007b0d-d246-45aa-8ce2-579f36f6d8bf@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-purgate-ID: tlsNG-c1860d/1782907128-4293D3FC-65BDD623/0/0 X-purgate-type: clean X-purgate-size: 2244 On 01.07.2026 13:55, Oleksii Kurochko wrote: > On 6/29/26 5:26 PM, Jan Beulich wrote: >> On 26.06.2026 17:46, Oleksii Kurochko wrote: >>> --- a/xen/arch/riscv/vaplic.c >>> +++ b/xen/arch/riscv/vaplic.c >>> @@ -9,6 +9,8 @@ >>> */ >>> >>> #include >>> +#include >>> +#include >>> #include >>> #include >>> >>> @@ -19,6 +21,11 @@ >>> >>> #include "aplic-priv.h" >>> >>> +#define VAPLIC_COMPATIBLE "riscv,aplic" >>> +#define VAPLIC_NUM_SOURCES 96 >> >> So for the IMSIC the host value is relevant, but for the APLIC the count is >> an arbitrary(?) compile time constant? Why? > If you are referring to the number of IMSIC interrupt identities, the > IMSIC node has separate properties for the host and guest: > > ```yaml > riscv,num-ids: > $ref: /schemas/types.yaml#/definitions/uint32 > minimum: 63 > maximum: 2047 > description: > Number of interrupt identities supported by the IMSIC interrupt file. > > riscv,num-guest-ids: > $ref: /schemas/types.yaml#/definitions/uint32 > minimum: 63 > maximum: 2047 > description: > Number of interrupt identities supported by the IMSIC guest > interrupt file. If not specified, it is assumed to be the same as the > value of the `riscv,num-ids` property. > ``` > > Therefore, if `riscv,num-guest-ids` is not explicitly specified, the > predefined value `GUEST_IMSIC_NUM_IDS` is used. > > No equivalent property exists for APLIC, which is why the value is > explicitly hardcoded here. To some extent, the chosen number is > arbitrary, but I used the same value that QEMU uses when creating the > APLIC node. > > It probably makes sense to limit this value in a similar way to IMSIC, > at least for now, since the case where the number of VAPLIC sources > exceeds the number of host APLIC sources is not supported (assuming that > configuration is even valid). In other words, we could use: > min(VAPLIC_NUM_SOURCES, host_num_sources) > > Would that make sense? Perhaps, yes. Just with the constant again named appropriately for its purpose (see comments on an earlier patch). Jan