From nobody Fri Nov 22 01:22:51 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=1727454832; cv=none; d=zohomail.com; s=zohoarc; b=gGtUlbfk9wxp3R9jdTfIiUCmdnH0L9mWd6yOhUvqfLFJZU6B/FCQ5SIpFHBg9yDoy4ntafUVD+yxJvbyBzgZ+UqGJ/rB0+XcxoPnrT6rYELTn/sgtCslf1OQGr9RJKityEhaa5sPvYDtcfWniy7mlW3SARz57gF/rPSMQbnICis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727454832; 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=nzAWnVE+25sXlcSpnmj7o00ZWNIuoO0eLwRBHFjtKEM=; b=A0oknaxRScyMytUEq5zys6g+6h6AQUscCyJ7qvJLK53zk3M8YMBAAvqSVxrECVpL9dUv6UthlOZoCac7YftqP0d3iudJfv7SjMksqqmQ88RzDJzgRMSZTJx6EU4ESEP9F7OJ9zJw+c1Y3kZumFHnN9WZmfHm3prvNgPjaY6LxrM= 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 1727454832494597.9608011400705; Fri, 27 Sep 2024 09:33:52 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.806400.1217758 (Exim 4.92) (envelope-from ) id 1suDtx-0001iY-6U; Fri, 27 Sep 2024 16:33:05 +0000 Received: by outflank-mailman (output) from mailman id 806400.1217758; Fri, 27 Sep 2024 16:33:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1suDtx-0001fe-0V; Fri, 27 Sep 2024 16:33:05 +0000 Received: by outflank-mailman (input) for mailman id 806400; Fri, 27 Sep 2024 16:33:03 +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 1suDtv-0001aC-I3 for xen-devel@lists.xenproject.org; Fri, 27 Sep 2024 16:33:03 +0000 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [2a00:1450:4864:20::62a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 296d5a43-7cee-11ef-99a2-01e77a169b0f; Fri, 27 Sep 2024 18:33:01 +0200 (CEST) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a8d4979b843so312315066b.3 for ; Fri, 27 Sep 2024 09:33:01 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c27c59bdsm150607166b.50.2024.09.27.09.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 09:32:59 -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: 296d5a43-7cee-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727454780; x=1728059580; 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=nzAWnVE+25sXlcSpnmj7o00ZWNIuoO0eLwRBHFjtKEM=; b=QnYd+stomPUKtX4Rf8vxJnK50Dq+QUmseS2wmqorcn5s38TW9hpD7uSkRb0Fe2vIaB Qy+GXc4/ZotxCCJ6b6AUw49b5P/0ro1kzCqT6ZL6uNjB01Yij23KARhMZLJBZsZePV5X w8jhhw3QSv707Jaa4ojgvLe1CqNx1+q+WwyJL6mwyTmtF0ooFggijkP1DbnMwlmTYXG0 zzfGVMhY90P+UG/KBjC9SIn+gYc9v7uASLCYyhEZ8FVkA7pz+I7GMXcNHfMtH/4A2cUM WfazGfZqLFPpQ216eFGYL3Vt9Gsgh9AlxS6W75ArkS30ir1/LCgHtPR9nnbe+34QRQ+H HBaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727454780; x=1728059580; 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=nzAWnVE+25sXlcSpnmj7o00ZWNIuoO0eLwRBHFjtKEM=; b=MBzCA3sqIhrq7TsgdLNBuFZnUC/3u9HyTw6s34Ap56Jp/kBlYDiFSD4NU2PDq77L7Z +we3qTSZkUdEJkyNqq81sVzTagiwG/S8sGbOdHRTVUtE4gyroMULk44qzkG+Gdp7UefL nY+dzXrU0pw+CuUPH0Kg9VsjueG8j27yU2VC5X+3bZCc0dURTBGZQHBs0DFNerHAlJXO l7jExAjOhUnMdVjNdG0+iM32rki1wpnVp6qotpyNWRfKE1fetbVwVaT5VkNAHucLi8vG XtPaaRzZ1wdmFpM9mzMmpaN1qt9IUc/2Og5B8/jzL6ODM1KeGe5e4FUaXjEkhrpNDwg5 J9Nw== X-Gm-Message-State: AOJu0YwJHzmufFvefzWn5Gqh5G0kl6lzZQxzW/Nfdt6jupjCSfawN9XJ qNLGteant8j23Ex4Afgi0KoRCOtWFt1WqdZIuOrq6Hry+4YPvKMeY+bW4Q== X-Google-Smtp-Source: AGHT+IFXHO9VrrpRGbMSzTVKjhVmVf7mxR5JFaneIy5RuHsDNT47WjtuZ0HG/ZLAxrbjeAkA057dAw== X-Received: by 2002:a17:907:743:b0:a8d:42c3:5f68 with SMTP id a640c23a62f3a-a93c492189fmr270848366b.23.1727454779991; Fri, 27 Sep 2024 09:32:59 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Shawn Anastasio , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v5 1/6] xen: introduce DECL_SECTION_WITH_LADDR Date: Fri, 27 Sep 2024 18:32:51 +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: 1727454834185116600 Content-Type: text/plain; charset="utf-8" Introduce DECL_SECTION_WITH_LADDR in order to signal whether DECL_SECTION() should specify a load address or not. Update {ppc,x86}/xen.lds.S to use DECL_SECTION_WITH_LADDR. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V5: - s/SIMPLE_DECL_SECTION/DECL_SECTION_WITH_LADDR. - add space between # and define in x86/xen.lds.S. - use DECL_SECTION_WITH_LADDR in ppc/xen.lds.S. - update the commit message. - add Acked-by: Jan Beulich . --- Changes in V4: - new patch --- xen/arch/ppc/xen.lds.S | 2 ++ xen/arch/x86/xen.lds.S | 6 ++++-- xen/include/xen/xen.lds.h | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S index 0c4b94814b..30b4a6ced8 100644 --- a/xen/arch/ppc/xen.lds.S +++ b/xen/arch/ppc/xen.lds.S @@ -1,4 +1,6 @@ #include + +#define DECL_SECTION_WITH_LADDR #include =20 OUTPUT_ARCH(powerpc:common64) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index b60d2f0d82..7d2aa2d801 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -3,6 +3,10 @@ =20 #include #include + +#ifndef EFI +# define DECL_SECTION_WITH_LADDR +#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..c6178bdc42 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 +#ifdef DECL_SECTION_WITH_LADDR + /* * 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 /* !DECL_SECTION_WITH_LADDR */ +#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 Fri Nov 22 01:22:51 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=1727454813; cv=none; d=zohomail.com; s=zohoarc; b=Bl5FyD6Ij3Awsicb8nbSrcsww3BwW0/jYlkLYD/GY1hbr+rJZxAjxCooiKoq5vYwHadIQQGLSXSoyLtuUqHNiGjOcO1USTfK0NDKee/ygVMSQFur8KhshX0FceD0nChT6Z4jPKAFHKu5yVay2a9EoMMbPnqYMoE1oMDc+bgDNxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727454813; 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=KJV5oRBJlzZEz9ymtqRaazaj6DoXUhgQRXq9CVcX0tA=; b=S9h2QKtFiv5fzM7Rd8JLBi/yEg0hlVM4J2+qtxDT2Cpx6SnD0eoERQnQMwntx4Z6pRLv4A0yaNuCyL6lzvfaP13oTkMQDiFsnHkAV8ouUCAhm7GKl+fG6caEiEHvYcSfmuYFC4Km5Q9CtVEE5FOyd4nMdIJrr7V7iBbX8Pja+dc= 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 172745481382328.323788096133626; Fri, 27 Sep 2024 09:33:33 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.806399.1217753 (Exim 4.92) (envelope-from ) id 1suDtw-0001dt-Vx; Fri, 27 Sep 2024 16:33:04 +0000 Received: by outflank-mailman (output) from mailman id 806399.1217753; Fri, 27 Sep 2024 16:33:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1suDtw-0001dD-QL; Fri, 27 Sep 2024 16:33:04 +0000 Received: by outflank-mailman (input) for mailman id 806399; Fri, 27 Sep 2024 16:33:03 +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 1suDtv-0001aD-0E for xen-devel@lists.xenproject.org; Fri, 27 Sep 2024 16:33:03 +0000 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [2a00:1450:4864:20::636]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 29c15f0c-7cee-11ef-a0ba-8be0dac302b0; Fri, 27 Sep 2024 18:33:02 +0200 (CEST) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a93c1cc74fdso225209966b.3 for ; Fri, 27 Sep 2024 09:33:02 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c27c59bdsm150607166b.50.2024.09.27.09.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 09:33:00 -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: 29c15f0c-7cee-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727454781; x=1728059581; 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=KJV5oRBJlzZEz9ymtqRaazaj6DoXUhgQRXq9CVcX0tA=; b=j0oHFMrVhqpylfxNXpunPqu9ghT3Shl+AKkoVbTtOMZFh0HrdJ33XwYXEYEfhW/6Yw Mqm6zUD7O3RVjRm27aMRbS83X16TPp5e5Gw70CtOCcMSuQRgXHWktsi2KHzuKr5wewRt 1bIRFzcaUnMwxtuythq1jCJMfTm9FYlfzyo/3Qe2mChsBOBHUscQUNhFXOolZrpzFath Sw87xCC61Or/3/wWw9CHWuulvEL4gTQluJigWdwO6cqSZWV5Gx7aFMEJYdHlViW/jm/W HMzuHYZX89J/hIQQS16WOtS+fsY8mmHRggNNuiB1+aSNN2f3YEcNWJ1HsMicJdxymyRB xqAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727454781; x=1728059581; 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=KJV5oRBJlzZEz9ymtqRaazaj6DoXUhgQRXq9CVcX0tA=; b=PLF2RzYGZZUaZzGEFgHqfUuRQfyXm/FPHVXtVzrF3G547orR43Fqmh7ZpsfpN0CPOW auLEZeHifncQee8SxB49/py2f4VZrlXo43I/5yrCPWsGfEI2s/npeT6yaNIgy3XBSU14 mu5bFLD5PFeUkfkaz/9Gnjxik1/02J2AydQ9a1c+L7Y0AcTsxov92/ZWhpYDKzLvGHRy 9N9/AATeTthdlFvmURGD50QtZZJVyTD8wpqqtitC0PZt4RqBhnbOBsfVMWFrz6/+FxBM KyYaz6nsdMPKJsvHdIU046YSmyIVfOGdBJTTuPO3mti360drSGloUF7WMSsKom5yftow 7eeA== X-Gm-Message-State: AOJu0YwyT6eYnmJ9P9Tdo1EHzNWDJ1SrNx1IDhvvuVEELE8LTyPalTiZ VphnYBUj/X+CfTdazBUcKkhwwwe6V1yPLisoMQ93uiAfwzex3GcXozm6Cw== X-Google-Smtp-Source: AGHT+IHhHgFHvcCnMJwrZrnSea7HPNePoioW1KsPsVXPYD0jV0RZzy1+SVCUfIAFJo92YTJUt2eivQ== X-Received: by 2002:a17:907:6ea1:b0:a86:7b71:7b77 with SMTP id a640c23a62f3a-a93c4a69aabmr335450766b.44.1727454780814; Fri, 27 Sep 2024 09:33:00 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH v5 2/6] xen: define ACPI and DT device info sections macros Date: Fri, 27 Sep 2024 18:32:52 +0200 Message-ID: <05ce8fea5c16ad603ca0fea60730ff10abcf2d02.1727452451.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: 1727454814329116600 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 V5: - drop macros parameter for ACPI_DEV_INFO and DT_DEV_INFO. - add 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 c6178bdc42..16a9b1ba03 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 \ + . =3D ALIGN(POINTER_ALIGN); \ + DECL_SECTION(.adev.info) { \ + _asdevice =3D .; \ + *(.adev.info) \ + _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 \ + . =3D ALIGN(POINTER_ALIGN); \ + DECL_SECTION(.dev.info) { \ + _sdevice =3D .; \ + *(.dev.info) \ + _edevice =3D .; \ + } :text + #ifdef CONFIG_HYPFS #define HYPFS_PARAM \ . =3D ALIGN(POINTER_ALIGN); \ --=20 2.46.1 From nobody Fri Nov 22 01:22:51 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=1727454809; cv=none; d=zohomail.com; s=zohoarc; b=nCH9dubrGhGnCVdfTN1/x365cNerrz00OC1FHTF26Yw6QBvER3dl7lp0mrlzfg0xMKFQbV7xmbluo1WjViy3RPCQk5o738WzomO6eXjC1yUDR+jnx6PcnVFbcbWwcuzYfzeBX3dsh2zCD2uTKSA6RaCBQumqtdKNCAPlhqvTgbs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727454809; 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=2hWXwXM8AkGaqnosUqSbi4XBp7s8/BolzMP+Ya0W380=; b=Lo2etFefGgUNx0ndPO4P6cx1wy/E0TZfmJoVeanbQdJ9B3OC28UR2wyT2foGMRig3qhbiGnmjmO4DN9cZZenGG/9zsjPiCWeoMq1V/iZv8mL14MK1sgEsFhTH5yR/KMSQR/92ZlcUTZydGaAmI+XlqfIc584a6R0OBHgrgZbLR0= 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 1727454809968510.12913411604404; Fri, 27 Sep 2024 09:33:29 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.806401.1217762 (Exim 4.92) (envelope-from ) id 1suDtx-0001nw-DN; Fri, 27 Sep 2024 16:33:05 +0000 Received: by outflank-mailman (output) from mailman id 806401.1217762; Fri, 27 Sep 2024 16:33:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1suDtx-0001mA-8s; Fri, 27 Sep 2024 16:33:05 +0000 Received: by outflank-mailman (input) for mailman id 806401; Fri, 27 Sep 2024 16:33:03 +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 1suDtv-0001aD-Lc for xen-devel@lists.xenproject.org; Fri, 27 Sep 2024 16:33:03 +0000 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [2a00:1450:4864:20::12e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2a68a096-7cee-11ef-a0ba-8be0dac302b0; Fri, 27 Sep 2024 18:33:02 +0200 (CEST) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-535dc4ec181so2536512e87.3 for ; Fri, 27 Sep 2024 09:33:02 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c27c59bdsm150607166b.50.2024.09.27.09.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 09:33:01 -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: 2a68a096-7cee-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727454782; x=1728059582; 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=2hWXwXM8AkGaqnosUqSbi4XBp7s8/BolzMP+Ya0W380=; b=bWj5os0jLK3d+qzy8n9ltuylN7xTLMfNwtq9KY9XnoZCZFMFPs99cs8fs+zOY00ZH6 DTFtd4/Z7SzATaAMLbOBqC/P+SK1cBG5SI9MQa2tsvPXXWtnFqoa7bQc//Sbq9aurDMr ykM83sXjo7ntgi8rVpOfUxPGpbIQLWUfLjrrBt9s7jZMHA5WiKvbhDA+JOfVfVhPbbdE DosgbxBElrIHZfcp/mPTU9bum4FNIBOS53SU5wbbabUyCJZ6gwR9PjfI4DGa4OwEzROJ O7Zt8EcObMHgTsp/TKE2YgkCh9MnOjOdMHIsqLmH6REDnyCKSk4236Va99j+bQjV00x7 oPhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727454782; x=1728059582; 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=2hWXwXM8AkGaqnosUqSbi4XBp7s8/BolzMP+Ya0W380=; b=MALOyph+XB7ngZiMNPTeX7GvIwJA5BnXAoL2+TzGMYK3nD+OH4BDO1+wJFqayxqyIu FJLLYBBPklSwallZ4tILIWs48w1VKB3qnshIwtXMf8EB4ZW+RGWEDK41s9JrcfkPZngU 9uofnHAQIot7fv7ez1tVzdZHINV+Zg0oFsy0FDnGTSwVjqU47b7gu45iAK2jXbSh9A1a FocvffbKiu0VArsR7Tv6vaQ7m8GesW6cVH4VJnEUmAa9FJeQuhjZ7BBK/i6PsbGNSEGQ XTLxEHZrkfmzDl7zVZQDC4wRvwOV0AapH2sRuHkqHpp3KTkRV0z/CX0TgXU9JfoiPCzF mJWQ== X-Gm-Message-State: AOJu0Yxwa0yw/qdrQSXw58gcfB2NUEOtis1KEMUZjJCltp4tJUJbV016 3BfnvFJlVMGCiz9ZNnYRBdsLqV6vjqFxwNv2M3pBpUUsLJD1BurRPDSKXg== X-Google-Smtp-Source: AGHT+IHqba2x/LuPYwAWEbDp/3SXBVV9I5Du1sSufcMPMgmKIuxrZOE6HlF1REbdv7tHGF1hnycwfA== X-Received: by 2002:a05:6512:4023:b0:52f:413:7e8c with SMTP id 2adb3069b0e04-5389fc3c5e7mr2318449e87.14.1727454781854; Fri, 27 Sep 2024 09:33:01 -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 v5 3/6] xen/arm: use {DT,ACPI}_DEV_INFO for device info sections Date: Fri, 27 Sep 2024 18:32:53 +0200 Message-ID: <025fa86a8dcc7430c072743b54489f913aa990b0.1727452451.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: 1727454812293116600 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. Change alignment of DT_DEV_INFO and ACPI_DEV_INFO sections from 8 to POINTER_ALIGN as struct acpi_device_desc and struct device_desc don't have any uint64_t's so it is safe to do that. Signed-off-by: Oleksii Kurochko Reviewed-by: Michal Orzel --- Changes in V5: - add Reviewed-by: Michal Orzel . - update the commit message ( add information about s/8/POINTER_ALIGN/ for Arm ). - use newly refactored ACPI_DEV_INFO and DT_DEV_INFO ( drop macros argumen= t ) --- 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 | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 0987052f1a..5b9abc9a2d 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -124,20 +124,10 @@ SECTIONS _eplatform =3D .; } :text =20 - . =3D ALIGN(8); - .dev.info : { - _sdevice =3D .; - *(.dev.info) - _edevice =3D .; - } :text + DT_DEV_INFO =20 #ifdef CONFIG_ACPI - . =3D ALIGN(8); - .adev.info : { - _asdevice =3D .; - *(.adev.info) - _aedevice =3D .; - } :text + ACPI_DEV_INFO #endif =20 . =3D ALIGN(8); --=20 2.46.1 From nobody Fri Nov 22 01:22:51 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=1727454813; cv=none; d=zohomail.com; s=zohoarc; b=RmStzcmX8Sa0Q8kUHlmThiBKmvN4hGNvV8baMK5uhYXxQEwhHidDpcS6P9MW5ELF5AKIHx1ZqLB20V8tQDSxURP0/arCiy/29nVhzmu64w4KedfGVScsdq27sb1yVWDP1MPrIhUsBSfwEjjwu9B4Zl/IkyuO19ZJI82e4aTT+RM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727454813; 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=leAxxJzl+409UfrEd5qPVybrX2oZQDzIq1f2vuG+PV8=; b=Vht/tv0/fKo0LcnAy7t6V5DZ78oxS3inr9EGTX4MOZSfdS83XVlZ0Gw+UbpHiNBSid9CaFDlvM6lPKPrUt9owLIFBrAH3OW4CgPiv3P58SbcCow1na81bhsTbRnwrkOEGP6FMc/9QiAklOBlnyBuQifWKAMRGEOXoIFQTC2JHbg= 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 1727454813308481.20814121685703; Fri, 27 Sep 2024 09:33:33 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.806402.1217786 (Exim 4.92) (envelope-from ) id 1suDty-0002Ql-NI; Fri, 27 Sep 2024 16:33:06 +0000 Received: by outflank-mailman (output) from mailman id 806402.1217786; Fri, 27 Sep 2024 16:33:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1suDty-0002PZ-Iw; Fri, 27 Sep 2024 16:33:06 +0000 Received: by outflank-mailman (input) for mailman id 806402; Fri, 27 Sep 2024 16:33:05 +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 1suDtx-0001aC-Jl for xen-devel@lists.xenproject.org; Fri, 27 Sep 2024 16:33:05 +0000 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [2a00:1450:4864:20::629]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2b205ecf-7cee-11ef-99a2-01e77a169b0f; Fri, 27 Sep 2024 18:33:04 +0200 (CEST) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a8a897bd4f1so314425866b.3 for ; Fri, 27 Sep 2024 09:33:04 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c27c59bdsm150607166b.50.2024.09.27.09.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 09:33:02 -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: 2b205ecf-7cee-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727454783; x=1728059583; 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=leAxxJzl+409UfrEd5qPVybrX2oZQDzIq1f2vuG+PV8=; b=JjBtGapZoeZ3wCYhIN+19UEhytAvEaN0nBt40rtkiZZ8rVC2PJhbGGcWp3jzPnoAhp scpBJgaAwpTYgSRL3xDkz7ftIexw7SVH/YBKmc7L2wIz1zs4hN3VBcexs6cm+vO5jZx+ WijeK1Vf3U66t4KcMaDfS3JSG7aaa+ml43Ysj9F0DCqSnh8E11QVR+tjNnIn6sMnPfXP AAwtWRa0kyihGHg5tkGMQp/2lmS4w8fm971IYWB9f7wmgxUGgu8DeQ6u0vSYjDKx4s2C Lc0A/oZ3yibhLq945392f7pnYF0mSzI30PRmZ+dHwaEhxenMOUvrepH2nXzryxO9FPvs lfOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727454783; x=1728059583; 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=leAxxJzl+409UfrEd5qPVybrX2oZQDzIq1f2vuG+PV8=; b=C+JGpIUpGdXNfNffr+8lxMynqKm5IJ6QJu+kSt8BFiplAR/+Enyq7tHwB1Caj1QoNn vvFjkybhoh3vaDhu/5Un24l5awdhHk6rizfJjNwoas7L0T6a5G9RWP7iu5OTVag8FAPQ xlgrYUAP8yX2SU0nZedJkZsTXO4RWJDXGrvrpg0gprh+b5kdxfiENB9CdUhXTdVM0Btg o3PwLwmt9/ZY/ppkBLp9Cpka8cQj37LO6dxyCkhuQoRxhzAi8LL7o0z1y0t34vHAGKMs Ik01vJ9woCwBcwyhfKjALkh4J3rmskyzV/vH+xxdQqoQdILYe0rmXpcaBzwXzmDbOr0L GXvA== X-Gm-Message-State: AOJu0YxYiCiM1zQxhw5jNy5OgQoz0zTP1YWK1+XT7my7JjGHbbX0YSX5 BIC2dMoyw3prx/+je9AVfQWZRivQ9xUEf3PmBi+9v3zVhygsdMJrz2sYsQ== X-Google-Smtp-Source: AGHT+IG3CIopgO+5VFJyIZI70q+ryIQxhz3RGf6b5mdoV8H8FuYr8cYwn/WrPxwqE/VlWI+JSsXy+w== X-Received: by 2002:a17:907:e91:b0:a7d:c148:ec85 with SMTP id a640c23a62f3a-a93c4aa6b89mr366505766b.62.1727454782941; Fri, 27 Sep 2024 09:33:02 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Shawn Anastasio Subject: [PATCH v5 4/6] xen/ppc: add section for device information in linker script Date: Fri, 27 Sep 2024 18:32:54 +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: 1727454814315116600 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 V5: - use newly refactored DT_DEV_INFO ( drop macros argument ) --- 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 30b4a6ced8..3f2a7676ec 100644 --- a/xen/arch/ppc/xen.lds.S +++ b/xen/arch/ppc/xen.lds.S @@ -96,6 +96,8 @@ SECTIONS CONSTRUCTORS } :text =20 + DT_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 Fri Nov 22 01:22:51 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=1727454833; cv=none; d=zohomail.com; s=zohoarc; b=dn5k4vDMwElIGPWx8RnVTa9/NzLQyvGIbPFKOLSIupdL2QMn634+lF1cn6316gAhqHHW/yeb95upXQ2vIsFyaEFv3JUMl8HZv36qGBjp1s6JMA5X+pqqBh2SkCjrhRgMfsDYSrVo+jAzWKu2CwDSxXDN3elze4ciHF57A9QNrPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727454833; 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=+08psIfLJrfr1+9TR9z6IB/oh0Wn/fJVKMeRSZDPsdY=; b=WuE6g1tRlBZmYZqfFaVBafYvEDzSCwe5O3KUiViyWdCeUQcg0HWVmjyuVOc2+ksWqTaQj6Kje9jrwkom9PX/F5bq941d5jVGl1GhUbp27UqsBXbJ/Sfr+3LwGigrWSjI/xxvDawxk/Bu7Gg0rhHqXbt/9+/h0VbwH0sEYovDO+4= 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 1727454833267719.707193418393; Fri, 27 Sep 2024 09:33:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.806403.1217797 (Exim 4.92) (envelope-from ) id 1suDu0-0002mu-6M; Fri, 27 Sep 2024 16:33:08 +0000 Received: by outflank-mailman (output) from mailman id 806403.1217797; Fri, 27 Sep 2024 16:33:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1suDu0-0002m4-25; Fri, 27 Sep 2024 16:33:08 +0000 Received: by outflank-mailman (input) for mailman id 806403; Fri, 27 Sep 2024 16:33:06 +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 1suDty-0001aC-LT for xen-devel@lists.xenproject.org; Fri, 27 Sep 2024 16:33:06 +0000 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [2a00:1450:4864:20::12b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2bc6e334-7cee-11ef-99a2-01e77a169b0f; Fri, 27 Sep 2024 18:33:05 +0200 (CEST) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-535dc4ec181so2536557e87.3 for ; Fri, 27 Sep 2024 09:33:05 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c27c59bdsm150607166b.50.2024.09.27.09.33.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 09:33:03 -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: 2bc6e334-7cee-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727454784; x=1728059584; 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=+08psIfLJrfr1+9TR9z6IB/oh0Wn/fJVKMeRSZDPsdY=; b=KkcqOpxXrCT0z629iwsso8R0aeLu+wpXVlvWiDvOFqvNECMfmY70pfJSsCELA2oDYj 9tscUJ9N/bOmWE9UoO724gviMNAeOgVPRPtMTpJBqYSfZLxldDUu7ZAWkXz3FqAfx0bv ucnwlcJBH0YKwfd7DumIlZ4AGkTFtxUcho+P2Y1J3y1MopIdA/MH4X6LVjLE5S/BqXyQ nqeGb4hDmwlSz54JO2lvDiqPYAvt42tRGSqoS2hYPgWY/0UyA0MsYtWoFZtPEMSottcD DzLcOjpCBgXgdDTpP8r4N/7kZ13pqIvJ++/25GKFx98GGiAWVFVNLVHk0iTS8HfZMhG1 fC0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727454784; x=1728059584; 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=+08psIfLJrfr1+9TR9z6IB/oh0Wn/fJVKMeRSZDPsdY=; b=HC5qcnMgqj0uEtJdFQ5cXuw34Sr/vz6EkXfAiLuEKKKP5WNgi4c8yPg2cjK0crxXc8 cdYRBf8QeV+e7PjIbx+2Oe7GBSZXnpZ3Cs28gNdBW7n1a46KI9pR3SJ9B3YV5l4OB/50 sESccvn4A7wLqyStrTUuZdhrJyqOQfJ1UboFqzZ59UWvynFRmlefvs6Rw5/SoUhTxycV csKvkqZJ+yPiaRoMfnBDwvUJYSVWkgrgG4y0qsJHPIAwve0qclpK2iVee6q4Nrm4biH4 56VqjD6c5d9sJrQHufIa2EDGNv9JRDGU++LSMT+C45blEk7JzGT6H3WgniRBwy3amPBf 514w== X-Gm-Message-State: AOJu0Yzrr59uwi5c44V6myJwaekQ70rezcYluIFfdf/d5Ae4yCP8pgWC GXZYzwtIhgdSUCUMtULuk3PFvqN74Fcc1T+C6I3IFAQbuzs9hzoW5zKukw== X-Google-Smtp-Source: AGHT+IHag+2Yt+XhEsKsDG5krM5YYD9hVHam1+A0d0Lwbgcf/8x3dibUe6S+Y4EfAdjJCrw7cJCC0w== X-Received: by 2002:a05:6512:68f:b0:536:53c2:817f with SMTP id 2adb3069b0e04-5389fc4d18cmr2780979e87.36.1727454784158; Fri, 27 Sep 2024 09:33:04 -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 v5 5/6] xen/riscv: add section for device information in linker script Date: Fri, 27 Sep 2024 18:32:55 +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: 1727454834167116600 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 V5: - add Acked-by: Jan Beulich - use newly refactored DT_DEV_INFO ( drop macros argument ) --- Changes in V4: - use newly refactored DT_DEV_INFO --- Changes in V3: - use refactored DT_DEV_INFO macros. --- xen/arch/riscv/xen.lds.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index 871b47a235..75fcf367e4 100644 --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -91,6 +91,8 @@ SECTIONS CONSTRUCTORS } :text =20 + DT_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 Fri Nov 22 01:22:51 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=1727454841; cv=none; d=zohomail.com; s=zohoarc; b=nKK7mfgo0s1m3nUJeEjwsFReyNI9Rp1rus+rPWBaPgfGUQG1iTSF6LwbAjSxbeDyM8SoqW36UIjebtFFvro5vIqgna5Mc2nRAkxwrLWuKlECllI/RFFq9yHEnYNrFWMSFHYyrOexnAJswtd2OJwJG6dq+P3wygXDvU0pA4+bpO8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727454841; 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=X2QQxBgwKAcM3DvdSfBvFC6LEQQkOxf8BpaLss5/lZ0=; b=kkIk/E/ADB+SmzNZqyE9WDPvqWYHkmIuhoqQWkBvkAf8c40A34cHf2IBR5kzgjG2Mdh5yLCcEpPzPI66dsu/Ef96hvKpbrl7vVl5CL8D/EOvx6Ur1kUJFqurUjhiVyuRAj6Ca5vq/6/9gK18Gv1Z3K1UH5KtqGqaxkdlX0f2N10= 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 172745484123117.11533397641631; Fri, 27 Sep 2024 09:34:01 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.806404.1217803 (Exim 4.92) (envelope-from ) id 1suDu0-0002rT-Ml; Fri, 27 Sep 2024 16:33:08 +0000 Received: by outflank-mailman (output) from mailman id 806404.1217803; Fri, 27 Sep 2024 16:33:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1suDu0-0002r0-F1; Fri, 27 Sep 2024 16:33:08 +0000 Received: by outflank-mailman (input) for mailman id 806404; Fri, 27 Sep 2024 16:33:07 +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 1suDty-0001aD-Sj for xen-devel@lists.xenproject.org; Fri, 27 Sep 2024 16:33:06 +0000 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [2a00:1450:4864:20::636]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2c7a61e0-7cee-11ef-a0ba-8be0dac302b0; Fri, 27 Sep 2024 18:33:06 +0200 (CEST) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a7a843bef98so298159966b.2 for ; Fri, 27 Sep 2024 09:33:06 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c27c59bdsm150607166b.50.2024.09.27.09.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 09:33:04 -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: 2c7a61e0-7cee-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727454785; x=1728059585; 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=X2QQxBgwKAcM3DvdSfBvFC6LEQQkOxf8BpaLss5/lZ0=; b=OqWarkFzh4CZwJgBwFWdVS4nkhK6bx1FFo84r31r3ybcZd+AlL4k+I9Fvtz7vFcok2 XzgGnBS86qVMy8QzWzH4AD/XYRLGtUMes/lvvnAMY9AYIpJ7MTXYvXzTAMNI4ebBj3Ao Rl4vkLmcVAFM9C5k80eAlF24VD6465tKUbo7zt1Hijq/eZiBXqSpSiPUFXXPbUuWEoD+ 4cIT9RZsz7xlo3nNp+rDJAmWAsFjrIiotjYHAZNTCtJKwkqt2hXFZqVo/PgeDzDeNZe6 6WmiXpAU++PcLmm/vwFD3dBdMdVKhEBGjO/yTvviT3hCgshy2GFbv3cZJbJ9XYiYhogc DBAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727454785; x=1728059585; 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=X2QQxBgwKAcM3DvdSfBvFC6LEQQkOxf8BpaLss5/lZ0=; b=HJpb8+29cDvQdruKEXltgcUmcfqvezdWY9VXgIt9hmFsoLO4xKZeTFRGZaa98WnVMM ViOfeiFz2PL5ZkupcHYYS6bc/0IntKF3CcmSbjw7Z9ONAjmoayDGl5sTY/MlNrIEjfK+ eiRdcGIXXUyuhAH4s1LG8NYoNEbJYbc3M7qt0SgICY6ZfQ4gw4wPQ2qN4cg02jafy2oh tJO+ybYsCb7JqVBUv4O6Brw5wabxPq6ozoaUl34l9acDN/y6x2VM0PCHRklxbxdQj2Oc q3idd4ooQYDHiqm8F4hGX47yEEDTxkMlYAkn1My2Ur8YtCSjDzBm1QmG+i5EoZF8NfpY 2wwA== X-Gm-Message-State: AOJu0YyUmOtMxOpgyWs8DZ1oq5kOCPyT2hy1EXtjCO4xL9+G87CjFNqD I6bZodjdTnbALsdsTJAEQuB4Adc1sNNIfVjX+5GNbIdaV7WcMS7sEMJBmw== X-Google-Smtp-Source: AGHT+IEcVT/jngnSHyPkDtg8R5eE+hbo8sqfo4/S4LE98s0mmpdW92PjjiuxdKOm6xNT+SofvdZnVw== X-Received: by 2002:a17:907:7f28:b0:a8a:835f:4cb9 with SMTP id a640c23a62f3a-a93c4a69b3bmr393643966b.46.1727454785287; Fri, 27 Sep 2024 09:33:05 -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 v5 6/6] xen/common: move device initialization code to common code Date: Fri, 27 Sep 2024 18:32:56 +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: 1727454842322116600 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 V5: - 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