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 E98ABC43458 for ; Tue, 30 Jun 2026 07:29:04 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1348414.1606197 (Exim 4.92) (envelope-from ) id 1weStl-000499-6h; Tue, 30 Jun 2026 07:28:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1348414.1606197; Tue, 30 Jun 2026 07:28:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1weStl-000492-3h; Tue, 30 Jun 2026 07:28:49 +0000 Received: by outflank-mailman (input) for mailman id 1348414; Tue, 30 Jun 2026 07:28:47 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) id 1weStj-00047Y-H6 for xen-devel@lists.xenproject.org; Tue, 30 Jun 2026 07:28:47 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1weSth-00364o-Lm for xen-devel@lists.xenproject.org; Tue, 30 Jun 2026 09:28:45 +0200 Received: from [10.42.69.12] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a437025-2eae-0a2a0a5409dd-0a2a450cca82-26 for ; Tue, 30 Jun 2026 09:28:45 +0200 Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com) by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a43702d-f399-0a2a450c0019-d155dd2eecf7-3 for ; Tue, 30 Jun 2026 09:28:45 +0200 Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-463f1165e16so4185812f8f.0 for ; Tue, 30 Jun 2026 00:28:45 -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-47563d19573sm4929119f8f.4.2026.06.30.00.28.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jun 2026 00:28:44 -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=1782804525; x=1783409325; 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=5GFe567EMxADlC6emMYxvpkfeJc6/w2uUW0Xpug4zHU=; b=INSjAjRyWw9W02g9+x+mM7WeOn9UlKiP2ctwAA+idz2qHCdNQvJMVhK9bj9DxhfKP3 XXw6nZSrTITyfKMEeuL3rUAE7wcnSWhYw56HuAASy0gL++i05Ap4JrPDYLexK94SRXf9 t26vdrZvWPvbN+t96zCc65eowMt3RiNNCKAlAd5MMsvJ3cGJt4JPgDZJd+xCNxjQd1uO Zy8BOeMXP12xBfyn76b8kK8TIO9vNLE+8EMj3J2+kjH9jfD2NPDwmJEych72VXBN+sli pLpIK56Hqr/cAmkceJUWi89kSnvtXOPt62/fSnI4sKF7owl+CAQjZCUnEch7uVL8TsPp cRtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782804525; x=1783409325; 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=5GFe567EMxADlC6emMYxvpkfeJc6/w2uUW0Xpug4zHU=; b=ldWmBc/QyVRC+oqGfoHRfx/3/msiMaxlDv4qBOS+pCKBNypm4aRqA4xOoIfLAWdQaS 1/NyGUpbyKw0OFiMykRdsCOM6US0CsBZwNjjlvGAQEuCS7Yz26LkGKVxU9iBT9FqwTdR GZ9P0ZRQHeZFEHsnenZWuQ/5+zuWEWmtjJMAEaAmr5uP/s9tRvIWE1cy1T02TA0WfnFI 13LohBG+MrAVjIvdemAqRzTbD3vJlpeQ4rYBkJIV0uwb37Yd1vSYnJ3TFmJ9hbeoNzyl B2jmFqTWCYHk+auozeQpKdkVuIW51NRGLzbR8Ts3HVBetEyk+Qvt0+AqhLRoAxlNhLPa J0xA== X-Forwarded-Encrypted: i=1; AHgh+RowGgd36fj5+GGSbw1XEMFzXFYKXbEwH5Q3UTnNp6XDumtrnG+MbmfoCGNtRcBD5NBH+pllDhNy63E=@lists.xenproject.org X-Gm-Message-State: AOJu0YzDKRNJ8NKpPUTHe+Zs5AeC0Dd4DDuIGWnQ1hjU4KcWYuEBZn7H V1PJkmbCJWdE7gsV/fsXfHweBYoBSoVpnGWukHDOFg+QPwmeTRSRlWOnJVpLJcwWUA== X-Gm-Gg: AfdE7cmKoSSwcRPvdSYYZzzDRkW0BdPqncBTDlqK+W2/CJKO19TqddwQ0tIJwvl5X61 vq3AiBr9//MQbseX4a/V9U53xexSPQMjTndJf4/ctk3N9GgUhmOkFvpbVbpDBWyjer8Qv8brEN4 TFF6eNNGXeMiW/X1SjJDFaGKFgxgoI42iY/+U0xYDPejqM0Mrb45KLmoQhqyim4SzZaV8GS8FfU EqhG+Ua4H47UyAz5dkoUp+aVDc6CeKmUyd6Q9rgwS3JHgwj1pbLWqDMwOgBegNTQ3fZ1y2/j9oN +21nP3XzmkbkQrgtwgEI9KKXP9oPbpqV3xZffEeqmz8APHBws6N2KP7LwJtIXhSguB0/GXllyOf PBM+wGdyo8fWzpN0MhZIMnBumNmJ/Fost7g6beINY2BU0JA3sqGjzKV1twcYBUuH0237d17fllb IwXpvAu4wHRd6kler8CQ4rQBHwdjrPrhBODcLVhshftUzdjVlKHo6MgMabPq8KxgZvsuw7A+ScM 0+9wuuK/0wNBRo= X-Received: by 2002:a05:6000:4285:b0:475:f100:35f7 with SMTP id ffacd0b85a97d-475f10036cdmr794453f8f.52.1782804524740; Tue, 30 Jun 2026 00:28:44 -0700 (PDT) Message-ID: <131fc20c-1353-49fc-8f77-1ca13628ff17@suse.com> Date: Tue, 30 Jun 2026 09:28:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 25/25] xen/riscv: add initial dom0less infrastructure support 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: 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/v5ClMjg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cKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-purgate-ID: tlsNG-d25034/1782804525-A80ABD51-388FC2FE/10/73395122804 X-purgate-type: spam X-purgate-size: 2567 On 26.06.2026 17:46, Oleksii Kurochko wrote: > Enable dom0less support for RISC-V by selecting HAS_DOM0LESS and > providing the minimal architecture hooks required by the common > dom0less infrastructure. > > Add stub implementations for architecture-specific helpers used when > building domains from the device tree. These allow the generic > dom0less code to build and let a basic DomU be constructed on RISC-V. > construct_hwdom() and make_hypervisor_node() are still stubs returning > an error: Dom0/hwdom construction isn't supported yet, and the > hypervisor node generation (needed by domains with > DOM0LESS_ENHANCED_NO_XS set) is not implemented. Both are marked with > a TODO and are not reached by the currently supported configurations. > > Provide missing helpers and definitions required by the domain > construction code, including domain bitness helpers and the > p2m_set_allocation() prototype. > > Additionally define the guest magic memory region (GUEST_MAGIC_BASE / > GUEST_MAGIC_SIZE) in asm/guest-layout.h. The base is arbitrary; the > only constraint is that the region must not overlap guest RAM or the > emulated device regions. It is placed in the unused gap below > GUEST_RAM0_BASE (0x80000000); the constraints are documented next to > the #define-s. > > Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich Nevertheless, ... > --- a/xen/arch/riscv/include/asm/guest-layout.h > +++ b/xen/arch/riscv/include/asm/guest-layout.h > @@ -32,4 +32,16 @@ > #define GUEST_RAM_BANK_BASES { GUEST_RAM0_BASE, GUEST_RAM1_BASE } > #define GUEST_RAM_BANK_SIZES { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE } > > +/* > + * The guest magic region holds Xen-reserved pages mapped into the guest's > + * physical address space (shared info, grant table, etc.). The only real > + * constraint is that the GUEST_MAGIC_SIZE-byte region must not overlap > + * guest RAM (the GUEST_RAMx banks) or the emulated device regions defined > + * above; the exact base is otherwise arbitrary. Here it is placed in the > + * unused gap below GUEST_RAM0_BASE (0x80000000), but a hole after a RAM > + * bank would work equally well. > + */ > +#define GUEST_MAGIC_BASE _UL(0x79000000) > +#define GUEST_MAGIC_SIZE _UL(0x01000000) ... while 16Mb may seem a lot, it feels pretty little for 64-bit guests. Even in just Sv39 mode they have ample VA space to map a bigger region. (As iirc indicated before, a static upper bound looks questionable to me anyway.) Jan