From nobody Sat Dec 21 15:09:23 2024 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=1727369710; cv=none; d=zohomail.com; s=zohoarc; b=YjHdwonVLR3UTakZD2mHiMVYmRTUH1K5GV6siOQwEOYgJJclZps6M7BuHJ/Ir2fsrQATh4YCQWG5J9MDzF612QIZZTb9aJUrcaOF3yj0dAVCT0vKBKhLfpoh4dftb5pLbuAKXAsyT2foSuStvxpp86uNvK9lCoIYIx2RLW+1HhM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727369710; 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=tyQZLVu1mMzTaGyKX8oda+NFy3jMOBImmEzHcbevgZ0=; b=hc+mHdo8weUpibxkdSZgcnPQiKgnDWu//kCQMXtwmOY6reMHG4gtxrEFaEkEpqVKxsMBCxcMRjtW12pLMRqtKPmZnslTtPtuXgnKWbzZhvakkpd44294Gzgg65F+897bJY85cwCP6WphqmkzRKX/xtW2AU7ArXUczmAxPvwtqjs= 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 1727369710357251.14970355980608; Thu, 26 Sep 2024 09:55:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.805751.1216949 (Exim 4.92) (envelope-from ) id 1strlB-0001W5-Pr; Thu, 26 Sep 2024 16:54:33 +0000 Received: by outflank-mailman (output) from mailman id 805751.1216949; Thu, 26 Sep 2024 16:54:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1strlB-0001Vm-My; Thu, 26 Sep 2024 16:54:33 +0000 Received: by outflank-mailman (input) for mailman id 805751; Thu, 26 Sep 2024 16:54:32 +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 1strlA-0001SU-Hb for xen-devel@lists.xenproject.org; Thu, 26 Sep 2024 16:54:32 +0000 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [2a00:1450:4864:20::62f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 001742f4-7c28-11ef-a0ba-8be0dac302b0; Thu, 26 Sep 2024 18:54:31 +0200 (CEST) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a8d6ac24a3bso231486066b.1 for ; Thu, 26 Sep 2024 09:54:31 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2979e00sm16981566b.158.2024.09.26.09.54.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 09:54:29 -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: 001742f4-7c28-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727369671; x=1727974471; 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=tyQZLVu1mMzTaGyKX8oda+NFy3jMOBImmEzHcbevgZ0=; b=PB8EpGCXAXXY7Yv7vp9W75XsX0eSCfdE5A8/mRX9zh628uc6bDJRV7ATEEUu3uKmIn 3CP0UeojdDB20q1BoOkaYJ+nTSvug43Efcvc6w981oaAjsCjVFCreES2oZCSsC6K17og l7VkC3uNDxIQdkr/uFf3sHwjNSp/zAzOYBzfvKoavuPUEkN8fjSi521fhwD8YGAbmxnG OWiybuYZIfYHRJBjxbshMaCdJudGgSRi+sO42sFNZ6VghQwyluZ9egyti6j2dcd37nCI YxHAv3uewwApSyUpB7lYKVCO8OkhZO6GqzEfSsaRZKjsEmP3buzKgyXQrVEvOOBzLwZT 8SUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727369671; x=1727974471; 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=tyQZLVu1mMzTaGyKX8oda+NFy3jMOBImmEzHcbevgZ0=; b=U0KEtVneaTLxtoKHhjfTmrqaI0EqRji9kUpWIX0hSmfSPvvIIjZKiP3I1Ct2OWWX44 YsSphUr9LhzuUSCfzDlUwqM7f11GIpS7BrysqUPx3VmeiNZUqU1a7Vbtcwy5WxRqkK2o a9gqeO8Wdn9+wdmJjuT1GjK+gXSLbIEtG5a3/HOB0Bnptg1J2BWQS/kVL/cifKadGjtl E4snBZDvePKEODZdSzz7RJ2FKOZtUZ+1F5w9uE5ipl3FRZxOqyp/Xpn9Hve8d6+rFZNf GTrNrlwYeTxwSgiGN6zdpfUHS/zsLTxfChNdrvre9z5wcn3ek4oyFV5TGFwpiWOa9m+G aT6Q== X-Gm-Message-State: AOJu0Yxd9LqxJAItrNw4nV66bH16HyEAtFF1YYKBlEIczuWXibLDChEs nKOCNtDDIaYpMRLXzJqBDvBqsB+FJFoU+ZkeED+K7/rvUsUjXtheuH/bTg== X-Google-Smtp-Source: AGHT+IGO7LzsF8sL7T87A5FWyFu7zhWF2lc2XGmHrBVsJ9IfeJqByhupnamafALDKTWao2T7nT6fTg== X-Received: by 2002:a17:906:4fd2:b0:a7a:afe8:1013 with SMTP id a640c23a62f3a-a93c3094cbbmr61577066b.1.1727369670418; Thu, 26 Sep 2024 09:54:30 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Julien Grall , Stefano Stabellini Subject: [PATCH v4 1/6] xen: introduce SIMPLE_DECL_SECTION Date: Thu, 26 Sep 2024 18:54:20 +0200 Message-ID: <413dfb16280c3ec541df8775d31902a4b12a64fe.1727365854.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727369710995116600 Content-Type: text/plain; charset="utf-8" Introduce SIMPLE_DECL_SECTION to cover the case when an architecture wants to declare a section without specifying of load address for the section. Update x86/xen.lds.S to use SIMPLE_DECL_SECTION. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - new patch --- xen/arch/x86/xen.lds.S | 6 ++++-- xen/include/xen/xen.lds.h | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index b60d2f0d82..9275a566e1 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -3,6 +3,10 @@ =20 #include #include + +#ifdef EFI +#define SIMPLE_DECL_SECTION +#endif #include #include #undef ENTRY @@ -12,9 +16,7 @@ =20 #define FORMAT "pei-x86-64" #undef __XEN_VIRT_START -#undef DECL_SECTION #define __XEN_VIRT_START __image_base__ -#define DECL_SECTION(x) x : =20 ENTRY(efi_start) =20 diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h index 24b8900ffe..8135732756 100644 --- a/xen/include/xen/xen.lds.h +++ b/xen/include/xen/xen.lds.h @@ -5,6 +5,8 @@ * Common macros to be used in architecture specific linker scripts. */ =20 +#ifndef SIMPLE_DECL_SECTION + /* * Declare a section whose load address is based at PA 0 rather than * Xen's virtual base address. @@ -15,6 +17,10 @@ # define DECL_SECTION(x) x : AT(ADDR(x) - __XEN_VIRT_START) #endif =20 +#else /* SIMPLE_DECL_SECTION */ +#define DECL_SECTION(x) x : +#endif + /* * To avoid any confusion, please note that the EFI macro does not corresp= ond * to EFI support and is used when linking a native EFI (i.e. PE/COFF) bin= ary, --=20 2.46.1 From nobody Sat Dec 21 15:09:23 2024 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=1727369708; cv=none; d=zohomail.com; s=zohoarc; b=MlLP3VnHmLwl6q7hCH1f1V23ASZo0+BaYh/i/fN7oRUH38GN+8Smzec0Srwx/j6RFeA5lkPpi7QlpsYyR/VDiQurWuCBvot5BJ6QfT6M+X3C7UQvLFTtv0fUIgJG05rAgPaea88uthtf2jUUMCSbGS2yiCcKxk79mQ7lV/TwXK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727369708; 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=/Me01IlmWn5ZXb/VKWHt5wAOgVcX8vvbwAiPhcFzwz0=; b=LVuJHR5n0zkgIgvdzwVqAjQ7XJAwy86uPcgaozAX/9Sv98YEYTr0/Vore0eeE4CKAPqNPClBA/v1smh3JV/vjIIAP5Qf0temylHiKrYRmn+gMzrxKD/NmLVzFvF8RI57TIWfaH/2SE4XAPPGCMJMUxWIJmzvnuLnj9Rk6By1O4Q= 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 1727369708322601.628780265262; Thu, 26 Sep 2024 09:55:08 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.805752.1216959 (Exim 4.92) (envelope-from ) id 1strlC-0001iR-AH; Thu, 26 Sep 2024 16:54:34 +0000 Received: by outflank-mailman (output) from mailman id 805752.1216959; Thu, 26 Sep 2024 16:54:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1strlC-0001iF-5e; Thu, 26 Sep 2024 16:54:34 +0000 Received: by outflank-mailman (input) for mailman id 805752; Thu, 26 Sep 2024 16:54:33 +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 1strlB-0001SU-6H for xen-devel@lists.xenproject.org; Thu, 26 Sep 2024 16:54:33 +0000 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [2a00:1450:4864:20::632]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0072edca-7c28-11ef-a0ba-8be0dac302b0; Thu, 26 Sep 2024 18:54:32 +0200 (CEST) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a93c1cc74fdso38881966b.3 for ; Thu, 26 Sep 2024 09:54:32 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2979e00sm16981566b.158.2024.09.26.09.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 09:54:30 -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: 0072edca-7c28-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727369671; x=1727974471; 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=/Me01IlmWn5ZXb/VKWHt5wAOgVcX8vvbwAiPhcFzwz0=; b=TsEpjwmIy/fiRv+OxB8HeW8p79G75MGcaw7mtYn024YB9wCyqncHMQ3w2jGx+K0WRr 96XAj5HbvsXqza6NCqmNk/89w6vsnL9CkxsFvSz6qB6Mac28+PUbhaTf/noi8xxvSUN+ zfNMiThN67jBNBekZhvfsnEamSqLfCw87zoh8L//X3IE/fs9zqnYVJbxO/tpjy8K+dU9 4tMiN4xfC4TRbN3r53IKA1TXpzdeB02ciyoJVqAvSj92xeKJ3nn0s4L3Dbv6vaz0lbRF jkfa9HcS7KsvI+t8SANopO/CFfWyRBhDnkW0z3NPESmIuLZJniWPkNHoG6s9r/4ZdPA/ +v8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727369671; x=1727974471; 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=/Me01IlmWn5ZXb/VKWHt5wAOgVcX8vvbwAiPhcFzwz0=; b=WZi/k4s2X0UzMaD+h//rHeLvIT2KpGnFzYHz8pvmgK9QRHFWdNjgU8ywO6EoBFSjt7 4i/FLMMBAO6+kZfTb5MtijkHLyDZX9AbC1PNN9kZUM1yGKitpfHIRUlCDXw6yManPaeu YcqTlULz+6TwuxInoT3WcxF1XLdl6eN1WSkPMUc8NncJLfRD2yM1u2/kLW0Dq13Iz8Fo M+A+wEFmH8R/JOGuVYuEYIokQsqIDmaO0mvAg9ZjhD5dXsSjYZS7qwHjIN0dA5UtpicK UoEC8Zer2b9IopepLB3/lKKDHCenNO9NX6oaSm3c20mpljrirtvACTo0ixaWGJqF5Kk8 IQbQ== X-Gm-Message-State: AOJu0YwTn1IuSSvi8VGq/zL5X+805JrWXYf0vIJRV2SgzeAYbPQA0LzY 7on5aYZ7aXNvd/VbsJQ/CnZRXdBDc9WM0oeIGw2LvUYgUnJMiNvook+xlQ== X-Google-Smtp-Source: AGHT+IENxhW8Z6GwOSQEBYUaU5Ssy8Dm29D6OtuPMVh8LwjaxL6cuq1Jq2ETxT/5xAHcm5tHy+QvDA== X-Received: by 2002:a17:907:60cc:b0:a86:7a84:abb7 with SMTP id a640c23a62f3a-a93c4915538mr16959066b.20.1727369671152; Thu, 26 Sep 2024 09:54:31 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH v4 2/6] xen: define ACPI and DT device info sections macros Date: Thu, 26 Sep 2024 18:54:21 +0200 Message-ID: X-Mailer: git-send-email 2.46.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727369708993116600 Content-Type: text/plain; charset="utf-8" Introduce macros to define device information sections based on the configuration of ACPI or device tree support. These sections are required for common code of device initialization and getting an information about a device. These macros are expected to be used across different architectures (Arm, PPC, RISC-V), so they are moved to the common xen/xen.lds.h, based on their original definition in Arm. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - rename ADEV_INFO to ACPI_DEV_INFO. - refactor ADEV_INFO and DT_DEV_INFO: add alignment and DECL_SECTION. --- Changes in V3: - drop SEC* at the end of ACPI AND DT device info section mancros. - refactor ADEV_INFO and DT_DEV_INFO macros. --- xen/include/xen/xen.lds.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h index 8135732756..cec86d0781 100644 --- a/xen/include/xen/xen.lds.h +++ b/xen/include/xen/xen.lds.h @@ -120,6 +120,14 @@ =20 /* List of constructs other than *_SECTIONS in alphabetical order. */ =20 +#define ACPI_DEV_INFO(secname) \ + . =3D ALIGN(POINTER_ALIGN); \ + DECL_SECTION(secname) { \ + _asdevice =3D .; \ + *(secname) \ + _aedevice =3D .; \ + } :text + #define BUGFRAMES \ __start_bug_frames_0 =3D .; \ *(.bug_frames.0) \ @@ -137,6 +145,14 @@ *(.bug_frames.3) \ __stop_bug_frames_3 =3D .; =20 +#define DT_DEV_INFO(secname) \ + . =3D ALIGN(POINTER_ALIGN); \ + DECL_SECTION(secname) { \ + _sdevice =3D .; \ + *(secname) \ + _edevice =3D .; \ + } :text + #ifdef CONFIG_HYPFS #define HYPFS_PARAM \ . =3D ALIGN(POINTER_ALIGN); \ --=20 2.46.1 From nobody Sat Dec 21 15:09:23 2024 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=1727369707; cv=none; d=zohomail.com; s=zohoarc; b=YpcgoD99oXZ0Vvb4/PD87yrtgRzKUOKcKYrn2YI+fRf3jPwPu+xF8KPTgqdp2+KbrSneQPxYLE2rZ8KL+cwZ+jjVvrUC/o3qk42sCqcTedIY8kTr1vCOWq7w0o1B0YcBDiUKN5faOYTnUgOLKcrxnewegMhQaXvCO/USIWWCfVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727369707; 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=JQIIQr4UWTptg8Aejtk0NghHPcRH7JuS3+zpBsqfsg8=; b=RvrbHFvE2RmpLMgTeFzVoe9u4D6aoBFh9iRAI47NIyug8PZQwOKEnXzVTgSomGbrNpToBYLTsgvcJGgqPynXQOfJ7MH++ZuKqH4T0GmAN4q+4sgwPJlcfZGStqc/Z1T3HSWLFbfqW22Bviq9YgBKPCTNP/0A1k9myhHrRNshj0k= 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 1727369707857478.5058309271716; Thu, 26 Sep 2024 09:55:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.805754.1216980 (Exim 4.92) (envelope-from ) id 1strlD-0002DC-R5; Thu, 26 Sep 2024 16:54:35 +0000 Received: by outflank-mailman (output) from mailman id 805754.1216980; Thu, 26 Sep 2024 16:54:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1strlD-0002Cj-Kl; Thu, 26 Sep 2024 16:54:35 +0000 Received: by outflank-mailman (input) for mailman id 805754; Thu, 26 Sep 2024 16:54: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 1strlC-0001ST-RG for xen-devel@lists.xenproject.org; Thu, 26 Sep 2024 16:54:34 +0000 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [2a00:1450:4864:20::134]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 012ea90a-7c28-11ef-99a2-01e77a169b0f; Thu, 26 Sep 2024 18:54:33 +0200 (CEST) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5365aa568ceso1492701e87.0 for ; Thu, 26 Sep 2024 09:54:33 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2979e00sm16981566b.158.2024.09.26.09.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 09:54: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: 012ea90a-7c28-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727369672; x=1727974472; 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=JQIIQr4UWTptg8Aejtk0NghHPcRH7JuS3+zpBsqfsg8=; b=eCkky41bTqXf5MEQzg89wdxfmXePTFu7VXNHdA6Ml0vlBFh3fDoK0pdqSdG9DJxM8t 5pzozVqNzxoVhV7a2Zj/Wo1KTPhYanm4Ix+4vJqAmrAfaF9K4mgn8Ymj4z4w09U8pxjq XMu6RKl7vwX5V/bScybRH8YuwAAT/dtWik0Pf3maQTFhQrsaAdaFg+b4uhsghVE6xeVX AqKThGXJ8B71C4hnKVXpQi5LusUefKPZ2BBnvQun1vImG2a+yA7Q6EjKdtKCIhI+t61X vDIbKtZkXWnZYajknOpetr02gepnKuYLZkAcBABPPliTY0fXl1GfjVNnAA2W7WamabUg WQog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727369672; x=1727974472; 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=JQIIQr4UWTptg8Aejtk0NghHPcRH7JuS3+zpBsqfsg8=; b=WK6XjAyK5TwnUiJ/wsZihS/sp/Skf5oronQFffM7SGy4UU1yzkG63BvL+LxgCHMGMX 5aY0eNoG0yvSkSNDfsrqcCFd8KDipCeBwknNMYsw6K4GY1sbeSVeNHMRWyxr3SLKiSHi t5/nS0IH/WGFyRxpk5U3vAAL5E/hGw32uWZ2ZYK6PxBXq+C39O5j9xtDnAn9JA/s+uXd xcodyITbdQ1ANjLlEon75ydUnHB9CJE+ltRGd1HfsBfdyPI1K7UWHwIzQ4EiGN5X0XY/ Lm1pxDuSm+CclRVJNjrOvUk5zvNXrkjyOS/fvbvPVC3LEXU6W2kDqlqRcoWbrIuyqGl2 6BxA== X-Gm-Message-State: AOJu0YykzxCjczZdteG7TGGjz8gqoBg39QSmVw2GMu8Kd0PLHdHBpITG qmabTuJlIPyND9UtoKvjCNIIEaCy+62j8k/5mGQuDHaAuHuJjA+9mAWQPw== X-Google-Smtp-Source: AGHT+IFbuc19mZ6WQ7B3+O6sfjgA9vkYIGDrEAgw1pzkytyRcgldlpExwOPYD6WPVeHFo4Ln1Dauxg== X-Received: by 2002:a05:6512:114c:b0:52e:fa5f:b6a7 with SMTP id 2adb3069b0e04-5389fc3bd7cmr240506e87.13.1727369672200; Thu, 26 Sep 2024 09:54: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 Subject: [PATCH v4 3/6] xen/arm: use {DT,ACPI}_DEV_INFO for device info sections Date: Thu, 26 Sep 2024 18:54:22 +0200 Message-ID: X-Mailer: git-send-email 2.46.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727369709000116600 Content-Type: text/plain; charset="utf-8" Refactor arm/xen.lds.S by replacing the inline definitions for device info sections with the newly introduced {DT,ACPI}_DEV_INFO macros from xen/xen.lds.h. Signed-off-by: Oleksii Kurochko Reviewed-by: Michal Orzel --- Changes in V4: - use newly refactored ACPI_DEV_INFO and DT_DEV_INFO --- Changes in V3: - use refactored ADEV_INFO and DT_DEV_INFO macros. --- xen/arch/arm/xen.lds.S | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 0987052f1a..3b7b677197 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -4,6 +4,8 @@ =20 #include #include + +#define SIMPLE_DECL_SECTION #include #include #undef ENTRY @@ -124,20 +126,10 @@ SECTIONS _eplatform =3D .; } :text =20 - . =3D ALIGN(8); - .dev.info : { - _sdevice =3D .; - *(.dev.info) - _edevice =3D .; - } :text + DT_DEV_INFO(.dev.info) =20 #ifdef CONFIG_ACPI - . =3D ALIGN(8); - .adev.info : { - _asdevice =3D .; - *(.adev.info) - _aedevice =3D .; - } :text + ACPI_DEV_INFO(adev.info) #endif =20 . =3D ALIGN(8); --=20 2.46.1 From nobody Sat Dec 21 15:09:23 2024 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=1727369712; cv=none; d=zohomail.com; s=zohoarc; b=Ol2ZgJ/IgiQHq/87HuBZsnmx+GuNpsMpAu0qFrw+P7ffLmTiMEO4gIes0ec+UMFcEZTy1fi3kUV226cvucqT33ROF26EvaPEoJVEK+o/5T8iIiw4CLLOTe+a6ezaYedzEA0vblTK00Re44Ld8PXnvyiRxbcUQmpkxw1xqOtu97o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727369712; 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=/8YXz3xJwYM5w/OK9x2qBPOxlg0qWTOKPTFvzRr9UJQ=; b=HyqQ8bDLy2tF7HYvP3gz8GsnrDuwaHTKndjc2VMU7xlVJOeC5zRK9wy9WgSFkaIRdk0bijp/o3/lwTjlcDBgf/B/uepULQ9bJ5emsk+Yf7RAaDqcOVghs2a8BHzrydVCQZA1T/a3g8kv9fZQsj4YhfDKyVSUazNFD2G8ExRcwcY= 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 1727369711969789.9115192999549; Thu, 26 Sep 2024 09:55:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.805753.1216973 (Exim 4.92) (envelope-from ) id 1strlD-00029m-FO; Thu, 26 Sep 2024 16:54:35 +0000 Received: by outflank-mailman (output) from mailman id 805753.1216973; Thu, 26 Sep 2024 16:54:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1strlD-00029f-Cw; Thu, 26 Sep 2024 16:54:35 +0000 Received: by outflank-mailman (input) for mailman id 805753; Thu, 26 Sep 2024 16:54:34 +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 1strlC-0001SU-8l for xen-devel@lists.xenproject.org; Thu, 26 Sep 2024 16:54:34 +0000 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [2a00:1450:4864:20::62a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0177dac0-7c28-11ef-a0ba-8be0dac302b0; Thu, 26 Sep 2024 18:54:33 +0200 (CEST) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a8d56155f51so144818666b.2 for ; Thu, 26 Sep 2024 09:54:33 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2979e00sm16981566b.158.2024.09.26.09.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 09:54: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: 0177dac0-7c28-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727369673; x=1727974473; 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=/8YXz3xJwYM5w/OK9x2qBPOxlg0qWTOKPTFvzRr9UJQ=; b=c3U7QNUYwulNiwGULAsdw62j+14V2Kk7H1VOQmmT/qefxVfykQzFysm+l+QQGO2Vak OHkD/UrvnxTJ5PYU8mmzOph2YTw2b3EBehhaX1vDyMJ807+Wrl1ER1GAN8RuyXzukyGX MSPSf0jlZu/zF+bA5JzNXB65mOwoNkc5TNasBQ9H12ITXq3uWfVikM7oNfpZ0lL2kCTW QQ23L1xjqpIB4Vu6IakeOQeE0B/uRWcSGhupxYpXLGzaWWGBzRPFMFOliMNNcfYPzT2a oXAJrrp/iU+crY3/CEovw8WFWM3DWu30xnLaQ9ejNrujxmRRGiWtMWfnyZBYN5JRaJR3 8A0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727369673; x=1727974473; 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=/8YXz3xJwYM5w/OK9x2qBPOxlg0qWTOKPTFvzRr9UJQ=; b=TtSYbOpATz9FYBnEyFpoMOtzqVwQkRnz47nSxdKGvgcDG8RMdy3cURaP9xyQHdP0T7 nGcYs2WzG7KLLmHrcRTuRiIL4ITCN4dYR38IwJtIC3D1VD3SkO3kgViPSqk2/u9Wq6cE 6uLE8ajurjChkyZgGMqQyj/tAly6URJuLo/n7LgQT8ec3M2Jpd9uwylCyGgGexFB0OeZ kopy3ddYUuDJj7fn6Bqp9XM1x5fZQZQNnQDka/XsqWUL+m9GPc+K1CsJa5kVW4iv/pzF w+cQJquMbGgImLMJ9nbekdnlVZXjIrbZKnojkifUnWK/IOq706qnzrIK9SbM5DXUOfw8 LZkQ== X-Gm-Message-State: AOJu0YxECusFIXcrdKkJoM399bOGwPDx+Dw6x9rSjgL5UPOLRoVimtZa CQBXaJtiRhXWSsmZ63J2LsOSH8OytIJ8MATS/sRNNRFlokf6RZOY4uHBnA== X-Google-Smtp-Source: AGHT+IG71GkEna8nM0+z+CEjm6upP/tl2YVZJMZaqlC6YXrPp3VrSAb4t7N9sXbJcbYv1Npz0OEzHA== X-Received: by 2002:a17:906:7946:b0:a8a:7897:c043 with SMTP id a640c23a62f3a-a93c4ae12c7mr11871366b.43.1727369672851; Thu, 26 Sep 2024 09:54:32 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Shawn Anastasio Subject: [PATCH v4 4/6] xen/ppc: add section for device information in linker script Date: Thu, 26 Sep 2024 18:54:23 +0200 Message-ID: X-Mailer: git-send-email 2.46.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727369713003116600 Content-Type: text/plain; charset="utf-8" Introduce a new `.dev.info` section in the PPC linker script to handle device-specific information. This section is required by common code (common/device.c: device_init(), device_get_class() ). This section is aligned to `POINTER_ALIGN`, with `_sdevice` and `_edevice` marking the start and end of the section, respectively. Signed-off-by: Oleksii Kurochko Acked-by: Shawn Anastasio --- Changes in V4: - use newly refactored DT_DEV_INFO --- Changes in V3: - use refactored DT_DEV_INFO macros. - Add Acked-by: Shawn Anastasio --- xen/arch/ppc/xen.lds.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S index 0c4b94814b..9222213484 100644 --- a/xen/arch/ppc/xen.lds.S +++ b/xen/arch/ppc/xen.lds.S @@ -94,6 +94,8 @@ SECTIONS CONSTRUCTORS } :text =20 + DT_DEV_INFO(.dev.info) /* Devicetree based device info */ + . =3D ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin =3D .; DECL_SECTION(.init.text) { --=20 2.46.1 From nobody Sat Dec 21 15:09:23 2024 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=1727369717; cv=none; d=zohomail.com; s=zohoarc; b=WVT5fPcKCRmNKXL13WE9UfASGHl7Fpdr4M83IzP9enHW6k/i9JhOKv0tm3M3lMNEIiLvWg3SbZ+NJ3jJdCZGpfTl6SP5APAlqFWCBelfiBAbHsDLO7KHNWjh3Vxgcb5ZbIgABGu+yn4SaVtTX/YUAd7uO8lt0gNa6vaZQey4Rxw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727369717; 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=QOoo4EKtPRFIE8HIHhg2CdM3Nn/tt0xPaUiavjCjh5s=; b=Jp0Kq8ZQQ4KmPIhAdRS3qR8sAE/CeW4i5UtblhSv0Uy2bFJzYXm7+QrfryuX5chZ7AVygcJDBme1DkX3adZg45JUX+7YBSh3UXnXQejv9azcm71IMjp5GIhKIsUwIdhZtONuGKitnujroRMde0raGsBoRFQ1K7+DxCwqefyXgRU= 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 1727369717256416.099883892966; Thu, 26 Sep 2024 09:55:17 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.805755.1216994 (Exim 4.92) (envelope-from ) id 1strlG-0002gP-2r; Thu, 26 Sep 2024 16:54:38 +0000 Received: by outflank-mailman (output) from mailman id 805755.1216994; Thu, 26 Sep 2024 16:54:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1strlF-0002gD-Vx; Thu, 26 Sep 2024 16:54:37 +0000 Received: by outflank-mailman (input) for mailman id 805755; Thu, 26 Sep 2024 16:54:36 +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 1strlE-0001ST-Kl for xen-devel@lists.xenproject.org; Thu, 26 Sep 2024 16:54:36 +0000 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [2a00:1450:4864:20::333]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 02304502-7c28-11ef-99a2-01e77a169b0f; Thu, 26 Sep 2024 18:54:35 +0200 (CEST) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-42cb57f8b41so15192465e9.0 for ; Thu, 26 Sep 2024 09:54:35 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2979e00sm16981566b.158.2024.09.26.09.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 09:54: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: 02304502-7c28-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727369674; x=1727974474; 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=QOoo4EKtPRFIE8HIHhg2CdM3Nn/tt0xPaUiavjCjh5s=; b=Fa6S8BXqSUyfiY/XCI3gZQQwnRCEgOkRyBT+CEVlSn56AaTORXehfje1pi7Z9gpKFp hEZjYJighwPeSGakXPZWq08J4AFU/V7VUMe04Oab8qEvABzEEe4mmdJMeT1qTMiZcKA9 SAnksmFetKQIPvRwDACG8lC7rl5NyA5PjONeYuHvohPvGd2WjPMEF+5DP9sHBCvaCM8+ b04DrfOPZmoLJAqp+c1+fX1YcCZoJnVDK582MS9E8Bn9fa4EEPhbX02zOjACJrtWtAS3 qf2yK7DS7CFCVqi7btN4QFR8tuNjcUOExAWcGjtYNB8hv+Uv1sZIf3TnM0/rLzV6m8aV xh2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727369674; x=1727974474; 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=QOoo4EKtPRFIE8HIHhg2CdM3Nn/tt0xPaUiavjCjh5s=; b=v7T8snq12OMlnnQwyQ07GgfS1EHBM2rWaPImH3mnHzS+s/G4X2l2h/IPaKG+bWcWP9 jENvrorIOXp9NUXpAGMz4mFsraewt8PfrFshZbcn7rw6WMsgDFI2s01GVeAw8EGk46ao W5NN2Ep5O9CLDaNANP2Jm/va0vcI8COpmrFAq+gOHqe0ZqOpbNrLf0tTgBgGDsSrLMkW njmXhlyF3qmgrwPNKsxWMickLwDlQhDFmqAt+uqtgJguJaj/FYXCkagNUDpXs673k3yZ hTNL26dWTkeBIVqm/PAoP/99IsJlsXUniGsHBWQVKmQwypVfgYpqMPks1yBp8gvb4jCI GcvA== X-Gm-Message-State: AOJu0Yz0vgcMdOp0FM41Mr22/NEDSUn0e5JQgKPZNXvRtBv1+AyAngGe eFDy0HECE5ATG3RIHUL5r7XGIrRQYo7cgJfZOOUp9xU7Si6vfRGGw3/Psw== X-Google-Smtp-Source: AGHT+IHVFydoImr+LV17up08n5HYKJ9djPYqPRg6EgwtOFy6HXWX75X6Go6ebuOZdOGAUlNLyf7/Vw== X-Received: by 2002:a05:6000:b8b:b0:374:c658:706e with SMTP id ffacd0b85a97d-37cd5b04975mr165768f8f.39.1727369673981; Thu, 26 Sep 2024 09:54:33 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Alistair Francis , Bob Eshleman , Connor Davis , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH v4 5/6] xen/riscv: add section for device information in linker script Date: Thu, 26 Sep 2024 18:54:24 +0200 Message-ID: X-Mailer: git-send-email 2.46.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727369719011116600 Content-Type: text/plain; charset="utf-8" Introduce a new `.dev.info` section in the RISC-V linker script to handle device-specific information. This section is required by common code (common/device.c: device_init(), device_get_class() ). This section is aligned to `POINTER_ALIGN`, with `_sdevice` and `_edevice` marking the start and end of the section, respectively. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - use newly refactored DT_DEV_INFO --- Changes in V3: - use refactored DT_DEV_INFO macros. --- xen/arch/riscv/xen.lds.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index 871b47a235..c1400e0613 100644 --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -1,4 +1,6 @@ #include + +#define SIMPLE_DECL_SECTION #include =20 OUTPUT_ARCH(riscv) @@ -91,6 +93,8 @@ SECTIONS CONSTRUCTORS } :text =20 + DT_DEV_INFO(.dev.info) /* Devicetree based device info */ + . =3D ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin =3D .; .init.text : { --=20 2.46.1 From nobody Sat Dec 21 15:09:23 2024 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=1727369707; cv=none; d=zohomail.com; s=zohoarc; b=R7Fca/w2x31hYHjdtMel+op2526cK2eLq89MUPGgm1MxUwLw/+xuBzCfVe47y+qONnWgyP7lQXkxg0zIhonJWTVfCzOErEgwBraMKs0jig78ewHe/csy4rvPDBi4F0ompV4z6Z+8amTBxjoEktXqLEAmrH020SCZvXzR9/Bpg1w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727369707; 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=Gg6k+CK/Tj9ZK3VXKpaB9MObc8AdN5CBF1fDnVMAt5E=; b=I26Oe0ZKAzMwFX26YGQZLU22dt86hK/c0VcPJ/HBO68UfErV/BjTTHKBsBACKo3bMNKOFsFlFK0mQPEuD0Npm+VEHUbe0d1e20KH0tOkQosHvwP2A7fGOSjmOQpLww7ia2m8WWOYaDu7azKWjIzAtSUWrgtzxBCenmFuQ3P5SAs= 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 1727369707017218.01823685751026; Thu, 26 Sep 2024 09:55:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.805756.1217001 (Exim 4.92) (envelope-from ) id 1strlG-0002kW-Hc; Thu, 26 Sep 2024 16:54:38 +0000 Received: by outflank-mailman (output) from mailman id 805756.1217001; Thu, 26 Sep 2024 16:54:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1strlG-0002ji-9p; Thu, 26 Sep 2024 16:54:38 +0000 Received: by outflank-mailman (input) for mailman id 805756; Thu, 26 Sep 2024 16:54:37 +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 1strlF-0001ST-RJ for xen-devel@lists.xenproject.org; Thu, 26 Sep 2024 16:54:37 +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 02d6b89c-7c28-11ef-99a2-01e77a169b0f; Thu, 26 Sep 2024 18:54:36 +0200 (CEST) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a8a7cdfdd80so157895166b.0 for ; Thu, 26 Sep 2024 09:54:36 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2979e00sm16981566b.158.2024.09.26.09.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 09:54:34 -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: 02d6b89c-7c28-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727369675; x=1727974475; 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=Gg6k+CK/Tj9ZK3VXKpaB9MObc8AdN5CBF1fDnVMAt5E=; b=EmPxeBXxFFYCQtgjJjNzNHG1mNsffOJGA9UPTAgxFIrGGtux/6yQ6Fie8WsElsk8yN NEU1rVheYrnlrdBjj3aBAZIbXsQrSadZ/fx1SMrN86hv4wf1F3ACF2A5zWykm1icUd1Q 9AqWjV+/836a+OxXCYBE2DNLNsFxjcEdvm+2ebCbbQEMRNitb6y3UTsunNHwVbLdxhes kFgQsuyHZqGVaSmpbfvp+Ea+OHqsq4imeAJ+QpQ/NFFRJD9aEjX+C+0M+Mz8GE7HdMOu YBbQ4jjZ4dshxDnvO52oYy1G8NefSfCGcyk/83bR5d+UOvJTWLjqYF4xxrydXyX4ffJw 4e+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727369675; x=1727974475; 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=Gg6k+CK/Tj9ZK3VXKpaB9MObc8AdN5CBF1fDnVMAt5E=; b=JTAFHqB4Cqon4/WR+SQrY+fEBSP5BnByCxJThGaIguzhH51XCaNkW6mBx7okiiJqdW KLhQETiMTnqYs8aZ3dCByCqBtCGaLXjj5nJvrMMfYTXIgHdWTBuSEyP82gX5GESii2HD lvdVEVS9xJsWFHbWcUGLsTmqf+Y1qOIuWWLR7K841YDcCVgKNZCJ6WQRxS0u/WTn45Mu RgfJtX2D5nZwQB/LH0oNM2/NXx53W7aZZSvh7VbN0cLxh22bU/M155HP7JADhn7V2kue 9dotkx6+X70v8KGaWwSRTiQlfTZCtTHqxhuAVrZqydqlRO1uvJPv56Q0oVHnTHlLFZIV IDiQ== X-Gm-Message-State: AOJu0YxnyJq3M8q7Kn08yCArrcwzzrMvNWbvY7yTwuxKZu3riSiOCjNI dLjqgIA6njjnFrUaA/jF7GZTTEIRztC7frJxTQwp2IItC9cfrXuehaIrOQ== X-Google-Smtp-Source: AGHT+IHKESgS4TqIm1v+f2kHFyIrUJmECr9U8XK/Heg84H5Dtk0cX1S2luBxYtWe4+iimPY3aTafDw== X-Received: by 2002:a17:906:794f:b0:a80:f840:9004 with SMTP id a640c23a62f3a-a93c48eea6emr16958866b.12.1727369675068; Thu, 26 Sep 2024 09:54:35 -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 , Jan Beulich Subject: [PATCH v4 6/6] xen/common: move device initialization code to common code Date: Thu, 26 Sep 2024 18:54:25 +0200 Message-ID: X-Mailer: git-send-email 2.46.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727369709069116600 Content-Type: text/plain; charset="utf-8" Remove the device initialization code from `xen/arch/arm/device.c` and move it to the common code to avoid duplication and make it accessible for both ARM and other architectures. device_get_class(), device_init(), _sdevice[] and _edevice[] are wrapped by "#ifdef CONFIG_HAS_DEVICE_TREE" for the case if an arch doesn't support device tree. Remove unnecessary inclusions of and from `xen/arch/arm/device.c` as no code in the file relies on these headers. Fix the inclusion order by moving after headers to resolve a compilation error: ./include/public/xen.h:968:35: error: unknown type name 'uint64_t' 968 | __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t); | ^~~~~~~~ ./include/public/arch-arm.h:191:21: note: in definition of macro '___DEF= INE_XEN_GUEST_HANDLE' 191 | typedef union { type *p; uint64_aligned_t q; } \ | ^~~~ ./include/public/xen.h:968:1: note: in expansion of macro '__DEFINE_XEN_= GUEST_HANDLE' 968 | __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t); because includes , which in turn includes "xen.h", which requires to be processed correctly. Additionally, add to `device.c` as functions from this header are used within the file. Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich Reviewed-by: Michal Orzel --- Changes in V4: - add Reviewed-by: Jan Beulich --- Changes in V3: - drop DEVICE_INIT config. - update the commit message. --- xen/arch/arm/device.c | 71 ++----------------------------------- xen/common/Makefile | 2 ++ xen/common/device.c | 82 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 69 deletions(-) create mode 100644 xen/common/device.c diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c index 3e02cff008..5610cddcba 100644 --- a/xen/arch/arm/device.c +++ b/xen/arch/arm/device.c @@ -8,79 +8,12 @@ * Copyright (C) 2013 Linaro Limited. */ =20 -#include -#include +#include #include -#include #include #include =20 -extern const struct device_desc _sdevice[], _edevice[]; - -#ifdef CONFIG_ACPI -extern const struct acpi_device_desc _asdevice[], _aedevice[]; -#endif - -int __init device_init(struct dt_device_node *dev, enum device_class class, - const void *data) -{ - const struct device_desc *desc; - - ASSERT(dev !=3D NULL); - - if ( !dt_device_is_available(dev) || dt_device_for_passthrough(dev) ) - return -ENODEV; - - for ( desc =3D _sdevice; desc !=3D _edevice; desc++ ) - { - if ( desc->class !=3D class ) - continue; - - if ( dt_match_node(desc->dt_match, dev) ) - { - ASSERT(desc->init !=3D NULL); - - return desc->init(dev, data); - } - - } - - return -EBADF; -} - -#ifdef CONFIG_ACPI -int __init acpi_device_init(enum device_class class, const void *data, int= class_type) -{ - const struct acpi_device_desc *desc; - - for ( desc =3D _asdevice; desc !=3D _aedevice; desc++ ) - { - if ( ( desc->class !=3D class ) || ( desc->class_type !=3D class_t= ype ) ) - continue; - - ASSERT(desc->init !=3D NULL); - - return desc->init(data); - } - - return -EBADF; -} -#endif - -enum device_class device_get_class(const struct dt_device_node *dev) -{ - const struct device_desc *desc; - - ASSERT(dev !=3D NULL); - - for ( desc =3D _sdevice; desc !=3D _edevice; desc++ ) - { - if ( dt_match_node(desc->dt_match, dev) ) - return desc->class; - } - - return DEVICE_UNKNOWN; -} +#include =20 int map_irq_to_domain(struct domain *d, unsigned int irq, bool need_mapping, const char *devname) diff --git a/xen/common/Makefile b/xen/common/Makefile index fc52e0857d..9d962069f7 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -6,6 +6,8 @@ obj-$(CONFIG_HYPFS_CONFIG) +=3D config_data.o obj-$(CONFIG_CORE_PARKING) +=3D core_parking.o obj-y +=3D cpu.o obj-$(CONFIG_DEBUG_TRACE) +=3D debugtrace.o +obj-$(CONFIG_HAS_DEVICE_TREE) +=3D device.o +obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) +=3D device.o obj-$(CONFIG_HAS_DEVICE_TREE) +=3D device-tree/ obj-$(CONFIG_IOREQ_SERVER) +=3D dm.o obj-y +=3D domain.o diff --git a/xen/common/device.c b/xen/common/device.c new file mode 100644 index 0000000000..33e0d58f2f --- /dev/null +++ b/xen/common/device.c @@ -0,0 +1,82 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Based on the code from: + * xen/arch/arm/device.c + */ + +#include +#include +#include +#include + +#include + +#ifdef CONFIG_HAS_DEVICE_TREE + +extern const struct device_desc _sdevice[], _edevice[]; + +int __init device_init(struct dt_device_node *dev, enum device_class class, + const void *data) +{ + const struct device_desc *desc; + + ASSERT(dev !=3D NULL); + + if ( !dt_device_is_available(dev) || dt_device_for_passthrough(dev) ) + return -ENODEV; + + for ( desc =3D _sdevice; desc !=3D _edevice; desc++ ) + { + if ( desc->class !=3D class ) + continue; + + if ( dt_match_node(desc->dt_match, dev) ) + { + ASSERT(desc->init !=3D NULL); + + return desc->init(dev, data); + } + } + + return -EBADF; +} + +enum device_class device_get_class(const struct dt_device_node *dev) +{ + const struct device_desc *desc; + + ASSERT(dev !=3D NULL); + + for ( desc =3D _sdevice; desc !=3D _edevice; desc++ ) + { + if ( dt_match_node(desc->dt_match, dev) ) + return desc->class; + } + + return DEVICE_UNKNOWN; +} + +#endif + +#ifdef CONFIG_ACPI + +extern const struct acpi_device_desc _asdevice[], _aedevice[]; + +int __init acpi_device_init(enum device_class class, const void *data, int= class_type) +{ + const struct acpi_device_desc *desc; + + for ( desc =3D _asdevice; desc !=3D _aedevice; desc++ ) + { + if ( ( desc->class !=3D class ) || ( desc->class_type !=3D class_t= ype ) ) + continue; + + ASSERT(desc->init !=3D NULL); + + return desc->init(data); + } + + return -EBADF; +} + +#endif --=20 2.46.1