From nobody Tue Dec 16 02:34:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1747146587; cv=none; d=zohomail.com; s=zohoarc; b=jkYk2xN8LrfT0obmCIY7qxsVR5feOVeKs/TXnA/q6+uuckp+458wrIXJs08RDxarLrVnXnkLjV4dby+QKkXfWaRLm7xFvcwcSmKhdxx1YG++rIZfkSkuuTvNOB63aWgF4lX2ocvck3N2msHbA0c2Np9SrhPVKSP+juPtO8C6k00= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747146587; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=R3KsIxN/HFuAUbvxsLdzJtfMwgSAXD/I7p0jaxNXAMU=; b=i/iv/YQ88W1Ug39RJq3CIKDBGD1zaK2iWcORCjMJtfLboL8rNErtpQ69MW1OxBs7pDA7rgzWxt0OvKqWXTAmvtkCxty5MQid9FSwy1u/dJ1WL8TE52CjN+bL2MpBYATPW1SwFPWdeZUkUwYOH3NG4wNqmvq5otH+waMCIzvItuc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1747146587640587.2991726615584; Tue, 13 May 2025 07:29:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.982930.1369302 (Exim 4.92) (envelope-from ) id 1uEqdU-00047A-O3; Tue, 13 May 2025 14:29:36 +0000 Received: by outflank-mailman (output) from mailman id 982930.1369302; Tue, 13 May 2025 14:29:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uEqdU-000473-L2; Tue, 13 May 2025 14:29:36 +0000 Received: by outflank-mailman (input) for mailman id 982930; Tue, 13 May 2025 14:29:34 +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 1uEqdS-0003pS-Ef for xen-devel@lists.xenproject.org; Tue, 13 May 2025 14:29:34 +0000 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [2a00:1450:4864:20::635]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id aff2273f-3006-11f0-9ffb-bf95429c2676; Tue, 13 May 2025 16:29:33 +0200 (CEST) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-ad23db02350so568886866b.1 for ; Tue, 13 May 2025 07:29:32 -0700 (PDT) Received: from fedora.. (user-109-243-64-38.play-internet.pl. [109.243.64.38]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad2197ca2b4sm778952466b.160.2025.05.13.07.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 07:29:31 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: aff2273f-3006-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747146572; x=1747751372; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R3KsIxN/HFuAUbvxsLdzJtfMwgSAXD/I7p0jaxNXAMU=; b=QR9ErIOIl7SwdHwqt7NCUJPeQsZn372/s+/wOzLly4LrSWRROhms4btoE2BW58gKEE DnSIpuN645e7SI3FEyWjAde4Rm04AS8jb9oEjg+YCQldfUt/ZwZiSXQpmUBnmU7CGsjS hbvm1OmlHE/2Z+hSpqHtGFojd8w6aDomnN5VAKNIaIHGGwuFfM8AW9MDEmkWf83rqMed ocfcVJJpnEFkidrZoqnyZVXoR0aEWc6sQRmJWKU63rVowRHWsbEODY1m9e6Y10Rl7lN+ hLkyfVac1mTS5P9yAq4GZPFkY87wxai3mK10ko2HmOvrAqq00O+YjmvwHXmbe10CqH2b IxhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747146572; x=1747751372; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R3KsIxN/HFuAUbvxsLdzJtfMwgSAXD/I7p0jaxNXAMU=; b=bjO72xT5PjB4OqHX2Q9DX57QuGFUex+RfwWcgdo4mB1DDPn0Ol3rHpEHCzW+dusTcO ECK+XbwaZdLFOv1W//iDz3DL8Tv6wXA5g1hvhkAfU1DFaXzc2YxiA+ClCLSRaiSZl5Dc /J8lKQ2DAM21swcZDxFeWGNrgFKinIFWgnAkVdkWbFP9h87SaF4k6MehsWpXE2XRuc/F z6IKl2iy2X80Bkt7oSSlCXK7QNpwmJuKSJ9N0H2xdsC2XlinT41rlnPfZHfK+YaiRIp5 n5Q2y4aqt12EdMzV9XIB+LhwJE6idLskoSatAqfWsOPRAosXsnSfsm+C+ybOvReW7Jbm EfWw== X-Gm-Message-State: AOJu0Yx0tOfbY8Fnr7SB3IzmI0A1eUF15JskMWVNTwxKwBF1wy1LpjMm tqnmzfMglLXCKAq8hMXqrRR9T47t28bYEv99kFav36jjn+I1q+XSkNcGRA== X-Gm-Gg: ASbGncvGCazRnAwLl5zprHURa6iXSpBDJE253TJb5oSpCEncNnDJnBNnZA4yDLDHNps l417e0H/8xHjceFHafKo5YuW8JOxVanUa4FpxMtlXmlfknCgAwWziEyPpODdssqpQ4YHbyNcv5f 25ZNbcgVbhO9fUKbrHUTySYp6dOxdR6ac9HPF2PPI6JiU2NnG/h3iYwbosG/v1aqqzCNnbs4Ubz SkoatGIRh58AtnmROy05cnaIKHX85lHSf19nQJQvg1gCFOfzb/UNqvfLparZB9cbt92OecBnpqg fK/0Ni1zP/b6knv3c5j1diPLvysw+yvAEIkjMMokVAtzBrNg3pTYrmf/e7gyAOrM9FHwtRLjoKg juj7/ttXt8IY9e0PEOw== X-Google-Smtp-Source: AGHT+IHvDKrcm5EIAfWEwLCJGVdb2MtWTj4Y9h1Wt9ttaSNtX+3LeS3O1szFbN8nYpIojGfETO10dw== X-Received: by 2002:a17:907:3f11:b0:ace:d710:a8d1 with SMTP id a640c23a62f3a-ad218f1bafcmr1609678266b.24.1747146571959; Tue, 13 May 2025 07:29:31 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v1 1/3] xen: restrict CONFIG_STATIC_MEMORY to ARM Date: Tue, 13 May 2025 16:29:26 +0200 Message-ID: <7e5ae810c1cf542ea33b2a2e836e8d9d7b1749b2.1747145897.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1747146588902019000 Content-Type: text/plain; charset="utf-8" Now that CONFIG_DOM0LESS_BOOT has been moved to common code and is planned = to be supported by other architectures (e.g., RISC-V), the dependency for CONFIG_STATIC_MEMORY needs to be updated. Since CONFIG_STATIC_MEMORY is currently only supported on ARM, its dependen= cy should explicitly reflect that. Signed-off-by: Oleksii Kurochko Reviewed-by: Michal Orzel --- xen/common/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index bf7b081ad0..5f4a16e113 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -148,7 +148,7 @@ config NUMA =20 config STATIC_MEMORY bool "Static Allocation Support (UNSUPPORTED)" if UNSUPPORTED - depends on DOM0LESS_BOOT + depends on DOM0LESS_BOOT && ARM help Static Allocation refers to system or sub-system(domains) for which memory areas are pre-defined by configuration using physical --=20 2.49.0 From nobody Tue Dec 16 02:34:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1747146594; cv=none; d=zohomail.com; s=zohoarc; b=mk8+rXWQz+H6y9AU7KZxJPGtB+RFtH/DP/1xk3nzPy1xgvnWB0MuwOXfQHqNVd3On7Hq/ki21KTUc6exeN8s+TI53jxPRn0f2Yqyj5xpE9GorIDUV2Qvq8BBS3lzKLvMSms7nzNnDiDObqdEO67OKkE7LQqRUBoO5sQ//4Niam8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747146594; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0mmaIut+bB6JzVtawKv0l2+/AbruT3la6NzpbEBxjqw=; b=TWJgkyMf8okILHtBRC4mWMIi0f0w2HM6AqcjeNbufDZsWEVyd37kyAt+i4c6aNbRpvGKBCuMYXIORN/zAgzn525qLfEfDfP650TL+EAAwAY0KP7XZWmarA4J4dkuV1Bx0X962w4ZMUlW2WerrJPCPk0i71r4k72qvOna7PnuNGk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1747146594364530.8372480154421; Tue, 13 May 2025 07:29:54 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.982931.1369309 (Exim 4.92) (envelope-from ) id 1uEqdV-0004AB-4e; Tue, 13 May 2025 14:29:37 +0000 Received: by outflank-mailman (output) from mailman id 982931.1369309; Tue, 13 May 2025 14:29:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uEqdU-00049H-T7; Tue, 13 May 2025 14:29:36 +0000 Received: by outflank-mailman (input) for mailman id 982931; Tue, 13 May 2025 14:29:35 +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 1uEqdT-0003s1-9o for xen-devel@lists.xenproject.org; Tue, 13 May 2025 14:29:35 +0000 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [2a00:1450:4864:20::530]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b0f338a9-3006-11f0-9eb6-5ba50f476ded; Tue, 13 May 2025 16:29:34 +0200 (CEST) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5f624291db6so9681958a12.3 for ; Tue, 13 May 2025 07:29:34 -0700 (PDT) Received: from fedora.. (user-109-243-64-38.play-internet.pl. [109.243.64.38]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad2197ca2b4sm778952466b.160.2025.05.13.07.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 07:29:32 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: b0f338a9-3006-11f0-9eb6-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747146574; x=1747751374; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0mmaIut+bB6JzVtawKv0l2+/AbruT3la6NzpbEBxjqw=; b=LoSvhdw5nehZHzk/8Jbvg+yaSZYHJ5puIV0R+IWzpC4UF1ASRTYcLvsbR+We6J8Yew kRxEgt1UFlnbJKCfHnJnmqLralp1dlcyRiKpNnZlhOBMz/nUM1+uV22gFZjrh7ZNk74e Oh5bCZ3Y18YFnC+3zS/ElUnPBgwZggwrkZMPcNX9qsZm5XDCfKW0EcXVDZzJXKlObXYT /Bg0cxbBv9tbK4nzqJrNzZoVxdlWKk2zWaI5PpRTwVAXxFBNfNOeXAo/29uuZq3Puxqe xrU9vyu71oYAMkWvHKXXdEtudGl4uChDxOQ+BM+H7EWOlsvt5cfG6XnhlVrJZn5lIYjq S5gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747146574; x=1747751374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0mmaIut+bB6JzVtawKv0l2+/AbruT3la6NzpbEBxjqw=; b=Myx4AHioa1TR2F9vFuDgwnjAAnTcnPtPDUErRnZsBNnajLh4fHwSf7JFeABTfOp/DY gT2WD0G512lEE+Tbt5DdPKAcw+NKATfmWejgdS2KZQNJiPB9wI4zc6UTCnOH0aIPZLm0 sj+HN0GQV6TUCq8iOt26MDLOUlEGUyqEyZGWCKYjNnrZzHSOD0wsc5oxe08dPnKxvtvG 6y8YF3cPUAVn/kaOpGCQDofPF2iymRvMgHwI/VkOqJkYHmyQGsEoOvyqttpIWXZPH0uD qBXihwLhDDrz5XIfpXblmk/jz6YnlWtus4OoKsZ7fyvkhJxwTawS2AVzKRlR1FDy7i9O itag== X-Gm-Message-State: AOJu0YxhyZvAtD6ts61LAMgr68fNxwOx3Y4o/N58KIWgWahxxlajTWoF Dq4FrYiv1VyL/XXXXjuL27MAmHOkA4eg8egEh5LI2LAAD7yNrSzB0o5nxg== X-Gm-Gg: ASbGnctOwZaKI+uBxjAZbXCCgNm7+HGHO+1LEuuqbUo0BEut50puyZU1TxISCOtbbMO 0MFU61PzIPbN0TZNRtp8gvpampeuuUFD5SOdZz14khovWCINoV0PcIR9gPtGB5OxUd3lU2alowp B6v9VsD3UvQBKwf7jB/VuzbZdm4A71WxIW0pJC8lGM2e+ZuGbt5zXl02rREOfOsy93rzwmCS1hE idFIZZxKTqQZM+tpQXG+ZxWjd9PSJuE0MIU9pbZMDEmcIQuJ5O8A5VSUAhal0Jh/2Y4NDzNSwFP GyamcGo2iqULEJVXui5T/xl7NArvwKRgiF+dnKblGPfwutiZZxSYG7I/cXyQFpVgVllxf6y5BL1 mzmx7KJFZXVJ2iNz2xA== X-Google-Smtp-Source: AGHT+IEh0F5gqDJkUU+wGo+FupnzK7UMqX/dMJXfIaRgV/WqRtMGo+DSihPvLfiV3rLxnGcd9eWeTQ== X-Received: by 2002:a17:907:6d12:b0:ad2:5021:bf3c with SMTP id a640c23a62f3a-ad25021dcbcmr904419866b.52.1747146572983; Tue, 13 May 2025 07:29:32 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , Anthony PERARD , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v1 2/3] xen/dom0less: refactor architecture-specific DomU construction Date: Tue, 13 May 2025 16:29:27 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1747146595218116600 Content-Type: text/plain; charset="utf-8" Refactor construct_domU() to improve architecture separation and reduce reliance on ARM-specific logic in common code: - Drop set_domain_type() from generic code. This function is specific to ARM and serves no purpose on other architectures like RISC-V, which lack the arch.type field in kernel_info. - Introduce arch_construct_domU() to encapsulate architecture-specific DomU construction steps. - Implement arch_construct_domU() for ARM. This includes: - Setting the domain type for CONFIG_ARM64. - Handling static memory allocation if xen,static-mem is present in the device tree. - Processing static shared memory. - Move call of make_resv_memory_node() to Arm's make_arch_nodes() as this call is specific to CONFIG_STATIC_SHM which is ARM specific, at least, now. This cleanup avoids empty stubs on other architectures and moves ARM-specific logic into arch code where it belongs. Also, don't loose a return value of functions called in Arm's make_arch_nodes(). Suggested-by: Michal Orzel Signed-off-by: Oleksii Kurochko Reviewed-by: Michal Orzel Reviewed-by: Stefano Stabellini --- xen/arch/arm/dom0less-build.c | 42 +++++++++++++++++------- xen/common/device-tree/dom0less-build.c | 30 ++--------------- xen/include/asm-generic/dom0less-build.h | 3 +- 3 files changed, 36 insertions(+), 39 deletions(-) diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c index a49764f0ad..592173268f 100644 --- a/xen/arch/arm/dom0less-build.c +++ b/xen/arch/arm/dom0less-build.c @@ -220,9 +220,14 @@ int __init make_arch_nodes(struct kernel_info *kinfo) { int ret; =20 + ret =3D make_resv_memory_node(kinfo, GUEST_ROOT_ADDRESS_CELLS, + GUEST_ROOT_SIZE_CELLS); + if ( ret ) + return ret; + ret =3D make_psci_node(kinfo->fdt); if ( ret ) - return -EINVAL; + return ret; =20 if ( kinfo->arch.vpl011 ) { @@ -230,26 +235,41 @@ int __init make_arch_nodes(struct kernel_info *kinfo) ret =3D make_vpl011_uart_node(kinfo); #endif if ( ret ) - return -EINVAL; + return ret; } =20 return 0; } =20 -/* TODO: make arch.type generic ? */ -#ifdef CONFIG_ARM_64 -void __init set_domain_type(struct domain *d, struct kernel_info *kinfo) +int __init arch_construct_domU(struct kernel_info *kinfo, + const struct dt_device_node *node) { + int rc =3D 0; + struct domain *d =3D kinfo->d; + +#ifdef CONFIG_ARM_64 /* type must be set before allocate memory */ d->arch.type =3D kinfo->arch.type; -} -#else -void __init set_domain_type(struct domain *d, struct kernel_info *kinfo) -{ - /* Nothing to do */ -} #endif =20 + if ( !is_hardware_domain(d) ) + { + if ( dt_find_property(node, "xen,static-mem", NULL) ) + { + if ( !is_domain_direct_mapped(d) ) + allocate_static_memory(d, kinfo, node); + else + assign_static_memory_11(d, kinfo, node); + } + + rc =3D process_shm(d, kinfo, node); + if ( rc < 0 ) + return rc; + } + + return rc; +} + int __init init_vuart(struct domain *d, struct kernel_info *kinfo, const struct dt_device_node *node) { diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr= ee/dom0less-build.c index 2c56f13771..f6aabc2093 100644 --- a/xen/common/device-tree/dom0less-build.c +++ b/xen/common/device-tree/dom0less-build.c @@ -28,14 +28,6 @@ #include #include =20 -#if __has_include() -# include -#endif - -#if __has_include() -# include -#endif - #define XENSTORE_PFN_LATE_ALLOC UINT64_MAX =20 static domid_t __initdata xs_domid =3D DOMID_INVALID; @@ -507,12 +499,6 @@ static int __init prepare_dtb_domU(struct domain *d, s= truct kernel_info *kinfo) if ( ret ) goto err; =20 -#ifdef CONFIG_STATIC_SHM - ret =3D make_resv_memory_node(kinfo, addrcells, sizecells); - if ( ret ) - goto err; -#endif - /* * domain_handle_dtb_bootmodule has to be called before the rest of * the device tree is generated because it depends on the value of @@ -787,7 +773,9 @@ static int __init construct_domU(struct domain *d, if ( rc < 0 ) return rc; =20 - set_domain_type(d, &kinfo); + rc =3D arch_construct_domU(&kinfo, node); + if ( rc ) + return rc; =20 if ( is_hardware_domain(d) ) { @@ -799,18 +787,6 @@ static int __init construct_domU(struct domain *d, { if ( !dt_find_property(node, "xen,static-mem", NULL) ) allocate_memory(d, &kinfo); -#ifdef CONFIG_STATIC_MEMORY - else if ( !is_domain_direct_mapped(d) ) - allocate_static_memory(d, &kinfo, node); - else - assign_static_memory_11(d, &kinfo, node); -#endif - -#ifdef CONFIG_STATIC_SHM - rc =3D process_shm(d, &kinfo, node); - if ( rc < 0 ) - return rc; -#endif =20 rc =3D init_vuart(d, &kinfo, node); if ( rc < 0 ) diff --git a/xen/include/asm-generic/dom0less-build.h b/xen/include/asm-gen= eric/dom0less-build.h index e0ad0429ec..78142e71ca 100644 --- a/xen/include/asm-generic/dom0less-build.h +++ b/xen/include/asm-generic/dom0less-build.h @@ -56,7 +56,8 @@ int init_vuart(struct domain *d, struct kernel_info *kinf= o, int make_intc_domU_node(struct kernel_info *kinfo); int make_arch_nodes(struct kernel_info *kinfo); =20 -void set_domain_type(struct domain *d, struct kernel_info *kinfo); +int arch_construct_domU(struct kernel_info *kinfo, + const struct dt_device_node *node); =20 int init_intc_phandle(struct kernel_info *kinfo, const char *name, const int node_next, const void *pfdt); --=20 2.49.0 From nobody Tue Dec 16 02:34:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1747146590; cv=none; d=zohomail.com; s=zohoarc; b=W5QZGoWkM+KO0bDDOJKYH0tIUkK2ynfN3elDO6zN7U66yKHMJM6GXEHEl6Crj1FgGX0pHJvGlai7UKKjJK3dw4+gSppRkjxCQBLQ224L3h1A3/Vi6xuLyfZbBghm/bOou5nZ2h1BNyY+u2VsY5GRujEPuoizvbSn+Ez1IuJC4F8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747146590; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UZsMZZN4khD+tCxXKeFysBlRlf4LYZbhvhNdRNB+85Q=; b=NdV09jG+mjrx+eEFd+TKD3IqTr/kA+yz7GH4EwQWS0EkMLv+nyYBUTohhQlni9DbqB+I7iRb5JDhDSQpXQD4wPw3UE2SVK4StOCeJdFWd+ecnraZTLiYTs2uW1wG4TRFmpxBygztOUZSsbahuAgD1j/WLR4ECkNjZo6NAtU3udo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 174714659086470.71389627564122; Tue, 13 May 2025 07:29:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.982932.1369314 (Exim 4.92) (envelope-from ) id 1uEqdV-0004E7-Ex; Tue, 13 May 2025 14:29:37 +0000 Received: by outflank-mailman (output) from mailman id 982932.1369314; Tue, 13 May 2025 14:29:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uEqdV-0004Cn-5m; Tue, 13 May 2025 14:29:37 +0000 Received: by outflank-mailman (input) for mailman id 982932; Tue, 13 May 2025 14:29:35 +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 1uEqdT-0003s1-NE for xen-devel@lists.xenproject.org; Tue, 13 May 2025 14:29:35 +0000 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [2a00:1450:4864:20::62e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b1476b26-3006-11f0-9eb6-5ba50f476ded; Tue, 13 May 2025 16:29:35 +0200 (CEST) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-ad24b7e0331so425349766b.0 for ; Tue, 13 May 2025 07:29:35 -0700 (PDT) Received: from fedora.. (user-109-243-64-38.play-internet.pl. [109.243.64.38]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad2197ca2b4sm778952466b.160.2025.05.13.07.29.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 07:29:33 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: b1476b26-3006-11f0-9eb6-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747146574; x=1747751374; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UZsMZZN4khD+tCxXKeFysBlRlf4LYZbhvhNdRNB+85Q=; b=hrw6OBtqTLGaH//R4QOcbTI6RTrcLebiXOXMvh150bIvl6dovdVRtza9/dDCxCKyG8 rkwo2OIantEho9HUtTtclJthlVJG3XucHnAI3X5ns4qalJL02tMrOawWbGJRoI38G+cR FInHK0GeeXFIwINv1USos5fpwpWz2G0nrEl7TgyDiJ9Q/EKmYzIso2om7iRNUgQ3/2Li qh2Xi+axYy3h6vtmMEv/x+FCqd3RvOntWMub4LpUckrzY1LF+1tmA7Wly3kD82WbzBHX 8dPFY2pVaFTa0XYdC7N4ab4yQl8tyN1huc1jHIVVTAume7ok6paoPuyi7GfX+398J14h HFaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747146574; x=1747751374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UZsMZZN4khD+tCxXKeFysBlRlf4LYZbhvhNdRNB+85Q=; b=LCYY++ilYJj68KTwgz+guDVH2VsR8Koi/I4qlHqeV9ST265ZSrKXK0q6W0cCzdN4ey Fee1jTPvKuZPj37uo7j2A8wlMyuJwjhj/UMo3T73drO3NI9lYxOMRYKnGqYf7NsMjRTj mo2HMtLHMwjjv7+TO9vaiG2ZEKUtiuxbl5pCL6ycoBreW9MlbK0ZoFYOe4b/sBxhkwtn bCKE+OvzpdfRnwX/Cq2g8TdtCNzgw48aox86M3ylLBqDRPObyZs0l8V+ecFZLW4ITI8Y DlgQFUFx5/e2shxfo+ge6cnCz+bpoFOtpbG9A0uxarufXJpb0WyRoDqeAUXyRARg/k1J kTIQ== X-Gm-Message-State: AOJu0YzmMHHSdR2RYAeDjVTU+56bsVcdir3Xpx74ach3X17VHejY/GSR A4O9UT+v4e5ZGbQYWnkIKJtE8ShxaDmIE00/p08yHMhqeexswiBNEJ/8Qg== X-Gm-Gg: ASbGncuBqMK+U9vk/SwFcSVzdWfTArNkvBu5dDR3tEJ3qW2tBavKN/S/tIOr0fSoIL5 XjepoVrSsuQ1poMIUx1T/usLb39tMu47mTTSWIkzu4v26n8ue0J+M0Gy1AKAHFQ1p5l9QQPad/v thMzcVbEHpJY+1MNpYbjag6kc2mUgdcbqTr4Hh2etms5bytqzEpPnjaCUFNg+yNpxEJOCigQ2Pa 08q+NBL2WcyeeGBTtlmDHcR0C9Scbqlgl4veeOTvV8W+in+K1uLl2ynOcrNyfOJ6nrmpLb8oiKI oeMwqggAl1XZUyscEDbXbfVx8BXIOdBwnoIViLSTwZf4sxqjrcaProfnAvydIyWrIzfLibKquis AmJpq5YyDvCdyR0guug== X-Google-Smtp-Source: AGHT+IE9cgPaCM7BS6Eml7ivJ9CqmHMGc3KFJlYK/ty0Ha1pBEuAv17nL210cXysSsurYIG1B7W+kg== X-Received: by 2002:a17:907:72d0:b0:ace:6d5b:e785 with SMTP id a640c23a62f3a-ad2192b6b17mr1575576866b.47.1747146573733; Tue, 13 May 2025 07:29:33 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [PATCH v1 3/3] xen/dom0less: move make_chosen_node() to common code Date: Tue, 13 May 2025 16:29:28 +0200 Message-ID: <9c87738225d48bd1ee9bba6e8d4e018dfecabccd.1747145897.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1747146593355116600 Content-Type: text/plain; charset="utf-8" The current implementation of make_chosen_node() does not contain any architecture-specific logic. Therefore, move it from arch-specific files to common code. At this stage, there is no need to introduce an arch_make_chosen_node(), as no architecture-specific customization is required. This change avoids duplication and simplifies future maintenance for architectures like RISC-V and ARM. Signed-off-by: Oleksii Kurochko Reviewed-by: Michal Orzel --- xen/arch/arm/domain_build.c | 46 ------------------------- xen/common/device-tree/dom0less-build.c | 46 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index b189a7cfae..9e71cc8cef 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1470,52 +1470,6 @@ int __init make_timer_node(const struct kernel_info = *kinfo) return res; } =20 -/* - * This function is used as part of the device tree generation for Dom0 - * on ACPI systems, and DomUs started directly from Xen based on device - * tree information. - */ -int __init make_chosen_node(const struct kernel_info *kinfo) -{ - int res; - const char *bootargs =3D NULL; - const struct bootmodule *initrd =3D kinfo->initrd_bootmodule; - void *fdt =3D kinfo->fdt; - - dt_dprintk("Create chosen node\n"); - res =3D fdt_begin_node(fdt, "chosen"); - if ( res ) - return res; - - if ( kinfo->cmdline && kinfo->cmdline[0] ) - { - bootargs =3D &kinfo->cmdline[0]; - res =3D fdt_property(fdt, "bootargs", bootargs, strlen(bootargs) += 1); - if ( res ) - return res; - } - - /* - * If the bootloader provides an initrd, we must create a placeholder - * for the initrd properties. The values will be replaced later. - */ - if ( initrd && initrd->size ) - { - u64 a =3D 0; - res =3D fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(= a)); - if ( res ) - return res; - - res =3D fdt_property(kinfo->fdt, "linux,initrd-end", &a, sizeof(a)= ); - if ( res ) - return res; - } - - res =3D fdt_end_node(fdt); - - return res; -} - static int __init handle_node(struct domain *d, struct kernel_info *kinfo, struct dt_device_node *node, p2m_type_t p2mt) diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr= ee/dom0less-build.c index f6aabc2093..1265cadf94 100644 --- a/xen/common/device-tree/dom0less-build.c +++ b/xen/common/device-tree/dom0less-build.c @@ -434,6 +434,52 @@ static int __init domain_handle_dtb_bootmodule(struct = domain *d, return res; } =20 +/* + * This function is used as part of the device tree generation for Dom0 + * on ACPI systems, and DomUs started directly from Xen based on device + * tree information. + */ +int __init make_chosen_node(const struct kernel_info *kinfo) +{ + int res; + const char *bootargs =3D NULL; + const struct bootmodule *initrd =3D kinfo->initrd_bootmodule; + void *fdt =3D kinfo->fdt; + + dt_dprintk("Create chosen node\n"); + res =3D fdt_begin_node(fdt, "chosen"); + if ( res ) + return res; + + if ( kinfo->cmdline && kinfo->cmdline[0] ) + { + bootargs =3D &kinfo->cmdline[0]; + res =3D fdt_property(fdt, "bootargs", bootargs, strlen(bootargs) += 1); + if ( res ) + return res; + } + + /* + * If the bootloader provides an initrd, we must create a placeholder + * for the initrd properties. The values will be replaced later. + */ + if ( initrd && initrd->size ) + { + u64 a =3D 0; + res =3D fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(= a)); + if ( res ) + return res; + + res =3D fdt_property(kinfo->fdt, "linux,initrd-end", &a, sizeof(a)= ); + if ( res ) + return res; + } + + res =3D fdt_end_node(fdt); + + return res; +} + /* * The max size for DT is 2MB. However, the generated DT is small (not inc= luding * domU passthrough DT nodes whose size we account separately), 4KB are en= ough --=20 2.49.0