From nobody Sat Dec 21 17:11:10 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=1727196179; cv=none; d=zohomail.com; s=zohoarc; b=C+d+ToytogzKu1n8VLeW/U2R7JT6sovHKO2sfRHKZG9h3RyG2mRzN0cSKXlsunOo6Eb+rZ7UUskTSV/WA432Td7T4/R08lDyHfjf+HhW0Lp0b9yXxEkz/HY3wABzUUNYMYKmaoyq3rlktccDdwM7doLGM1gZdsg4HE2bnPnBaBI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727196179; 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=eEBtAEoVJ9n0AWPFgewaJw3+Rl2x63pa8iRhlsFUppk=; b=UnN6cc5hzVqQsgMnra7/TN3tccjBYqrQsa3W3zICXmHa/zQJN1BUWDd80Bxo9oKRcWqd4rVWyaE55glR3CxqzCE4HKzKXpHL37GisG6/iUPEK1tUTo2n8lCizVf7O4tTADtSxXarJWt4eyUXZYbI70Ye2u8EIhY5xOkHR/AFwGw= 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 1727196179145191.8255160364888; Tue, 24 Sep 2024 09:42:59 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.803178.1213659 (Exim 4.92) (envelope-from ) id 1st8cb-0007QI-1t; Tue, 24 Sep 2024 16:42:41 +0000 Received: by outflank-mailman (output) from mailman id 803178.1213659; Tue, 24 Sep 2024 16:42:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1st8ca-0007QB-Uz; Tue, 24 Sep 2024 16:42:40 +0000 Received: by outflank-mailman (input) for mailman id 803178; Tue, 24 Sep 2024 16:42:40 +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 1st8ca-0006ag-07 for xen-devel@lists.xenproject.org; Tue, 24 Sep 2024 16:42:40 +0000 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [2a00:1450:4864:20::535]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 02c28587-7a94-11ef-a0ba-8be0dac302b0; Tue, 24 Sep 2024 18:42:39 +0200 (CEST) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5c5bca59416so3606022a12.1 for ; Tue, 24 Sep 2024 09:42:39 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c5cf4972f8sm925880a12.36.2024.09.24.09.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 09:42:38 -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: 02c28587-7a94-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727196158; x=1727800958; 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=eEBtAEoVJ9n0AWPFgewaJw3+Rl2x63pa8iRhlsFUppk=; b=KVArqidZW45mkD5gXw/d0YMpuKlpMUYsv4gXM/kK0G4QQSnwVOOF3BAwP7wXG4yXSl xN0TFg9OiHuuKOk5H1nmasKNdeL/cj2pnj1Hn0E6vbE2dyVBJlvK3HuXECstIGkMD1Np zaHuHn3RTmD0S02cq9dPUef6rCGEWK3g4/+xRVZtKQmFIw58SSKXzxtgtt3FmSeURPxb gFXN0ahRLUn1GZAf4YQ03vikyN5SYnbcNjliN1V1VDpfTBcaeVrvjm7RisvcwDR4UmAl 6sWr39zoBUMaQvVRaLvzNRwn8Xd01U1uzy1K4FaNobSgVxci4pZpYlFAcB0r4PLtiwnS BqIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727196158; x=1727800958; 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=eEBtAEoVJ9n0AWPFgewaJw3+Rl2x63pa8iRhlsFUppk=; b=TZh5zS8F7JYcK27uZaG2Vo23bWmH3h8APiSpX4yIP9rVPiZkGjtzhroMHpcW2zjrNx SknR3B6xOawjB8K2JlVTGgu8Cu8k9O5p3GEyglrW8M0fb3+mFTQLokVO46fR8t2N845J oMdkaa5Dmx78zmETyiwzBjScOyUavItc4CF+LDiM9jYDaTyFD4YuOVMhcvt/KAVO1Mmg vOlKQZ0orvTL63ajoiBysY0VOYPpk26zfxKecfmmXodDX3hPZQlfRHkgXotmiWaAsNNP AotztHNtlUTSXAyPqrCwuHgzJtBPzGrkXy6K4wQCm9f3rowJf42sXBmIRX7TkfF/NMch d+yg== X-Gm-Message-State: AOJu0YyCAU+L4HkiOCR0Ztq4oRfFQqO3GF8xI/LtIKF57NoNNLuHC1va ZDb18G6kz6McwGO1sGDLjGa40xWd7RiYt2YuSwhGWPOItKaYpuw/xnKIBg== X-Google-Smtp-Source: AGHT+IE50acNkkZzGnkJoi3X+n3OKQo+CNNfAI/OySokfx+N1vfxAX8tjTD6pjjz16nSny9OK3nZww== X-Received: by 2002:a05:6402:274a:b0:5c5:c5fb:57d5 with SMTP id 4fb4d7f45d1cf-5c5c5fb5846mr4065993a12.33.1727196158394; Tue, 24 Sep 2024 09:42:38 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH v3 1/5] xen: define ACPI and DT device info sections macros Date: Tue, 24 Sep 2024 18:42:30 +0200 Message-ID: <7521839bd265e0520fc448adf50361d18dfe53df.1727193766.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: 1727196179615116600 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 --- Changes in V2: - 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h index a17810bb28..b85c5e6576 100644 --- a/xen/include/xen/xen.lds.h +++ b/xen/include/xen/xen.lds.h @@ -114,6 +114,11 @@ =20 /* List of constructs other than *_SECTIONS in alphabetical order. */ =20 +#define ADEV_INFO \ + _asdevice =3D .; \ + *(.adev.info) \ + _aedevice =3D .; + #define BUGFRAMES \ __start_bug_frames_0 =3D .; \ *(.bug_frames.0) \ @@ -131,6 +136,11 @@ *(.bug_frames.3) \ __stop_bug_frames_3 =3D .; =20 +#define DT_DEV_INFO \ + _sdevice =3D .; \ + *(.dev.info) \ + _edevice =3D .; + #ifdef CONFIG_HYPFS #define HYPFS_PARAM \ . =3D ALIGN(POINTER_ALIGN); \ --=20 2.46.1 From nobody Sat Dec 21 17:11:10 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=1727196187; cv=none; d=zohomail.com; s=zohoarc; b=gIoUBgcmgZ54SxfV6jv5DsVYpVToqTP9YgsWcyoD4etFiKwI1x6bAzR8+bXrbWms3hv8TpUSBAHNc3w1L4/bNBJ0viZpl56LnpwcfzrfOQ6y3nhjxi15fj/bFhmDfCTMh1WXjHeFnyIRKsys7wW3ssKpKsclK3XgLi4Vt2ufB5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727196187; 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=bp9beghPA+jXcegEyvP7wMfnc3wLxaxw+ebFwbltls0=; b=b8w9Tgv0hfygocROwpBpLMpE2HhPjfvX82y7+qd9Ou1atcL0g1plyc3i+mFo2DQB0p+8cHh4ZJ6rtKx9zIvnvtSzseGu2uJjN/PLAbmVoVlrv6mhn2jrnbg1ACJ+FQ1aNRHJ89UuWkAjtlcYF25MdNHN9GIIiNVHC2874YkYlo8= 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 1727196187396331.3814711996896; Tue, 24 Sep 2024 09:43:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.803180.1213678 (Exim 4.92) (envelope-from ) id 1st8cc-0007u5-K1; Tue, 24 Sep 2024 16:42:42 +0000 Received: by outflank-mailman (output) from mailman id 803180.1213678; Tue, 24 Sep 2024 16:42:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1st8cc-0007tE-GP; Tue, 24 Sep 2024 16:42:42 +0000 Received: by outflank-mailman (input) for mailman id 803180; Tue, 24 Sep 2024 16:42:41 +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 1st8cb-0006ag-0C for xen-devel@lists.xenproject.org; Tue, 24 Sep 2024 16:42:41 +0000 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [2a00:1450:4864:20::62e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0361a052-7a94-11ef-a0ba-8be0dac302b0; Tue, 24 Sep 2024 18:42:40 +0200 (CEST) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a8a837cec81so414400966b.2 for ; Tue, 24 Sep 2024 09:42:40 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c5cf4972f8sm925880a12.36.2024.09.24.09.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 09:42:39 -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: 0361a052-7a94-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727196160; x=1727800960; 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=bp9beghPA+jXcegEyvP7wMfnc3wLxaxw+ebFwbltls0=; b=MqBhHdmd9HNroHBiJ1uP5E0+j8eUyIKYqrgbGj2AIcR+xy8zlVewn4I5D/JSHqmINv y7mbuAeVTGlyM5Eo9N8RGbXbb+jSgnyhBdwTcFuwEFiF8Pup8IrNJnCFelA1J0FN7rks fHtP/iW4bSCJntSdmLXyZiWRC6qzn8bkxPLi/mnhZfq0PkFZj973zU1WcjAKu8dqfocn jseUU8RaL2tzm9bqSeBWLwQZZUQ2nVPT3dFgQ/mJl0B8JaJN1Rr7cuZ39YGni4sNmH6l OY8XAfVRvJ+IG/cx2ykfjYSkpbDN5ES/IiedJ8Rlhzp7LfKFP75MyHtwp+N4kXXSJRL7 DjEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727196160; x=1727800960; 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=bp9beghPA+jXcegEyvP7wMfnc3wLxaxw+ebFwbltls0=; b=k72KmiWsH9sCspiTfPaxHa01sx4HbKq/ohaZk2IhiDdjBL/Ez/SFsXdkxHwkrnPPiw sljY1AuzKoRIXNj+Tpu1oq2v972WGiJiabxuEtfvR3u7XLXbwx2SFTGuKCW109NYSW8k n7YWAlPgTL3Y4GedDSTbYoTnjhHil3THYz/U3z9PmaTI3ITehPUoghy+/0m4YcPj/q5W VLTmKdT2vMqdXRXvF3Aliif3gaZhsrzFLt4o53VOEK4/BQ36MIKHYz68Cu9zIUvV6TB/ VyzuEctRxvxULuICo2QhxEVO3/qdIlibFdSR2xwLLc8nPa5UHidhTj5UT0exzTChGLSs cZYQ== X-Gm-Message-State: AOJu0YzIpy2LG4WtnqMswDdzUECdD2ve47UHpCT5f5ilLFUOeTbtDihL 11IUvAwvW5ScMuOAMxg9xpdsjmiCh9Aob8Wy1pJq02KdHgRTnr7bWRirBQ== X-Google-Smtp-Source: AGHT+IErM9Jc+846ggvulOl9WQ5PnxMxUZ+z+bT4bDXhTwwPZuew0fVwvbcBssDODwgsuNO/yRML+g== X-Received: by 2002:a05:6402:2753:b0:5c5:c1dc:9028 with SMTP id 4fb4d7f45d1cf-5c5c1dc9175mr8261128a12.33.1727196159539; Tue, 24 Sep 2024 09:42:39 -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 v3 2/5] xen/arm: use {DT,ACPI}_DEV_INFO for device info sections Date: Tue, 24 Sep 2024 18:42:31 +0200 Message-ID: <1533aa9fe0a4464bd97a44fc1f68cac0a670640c.1727193766.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: 1727196187568116600 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 --- Changes in V2: - use refactored ADEV_INFO and DT_DEV_INFO macros. --- xen/arch/arm/xen.lds.S | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index bd884664ad..7317851871 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -126,19 +126,13 @@ SECTIONS =20 . =3D ALIGN(8); .dev.info : { - _sdevice =3D .; - *(.dev.info) - _edevice =3D .; + DT_DEV_INFO } :text =20 -#ifdef CONFIG_ACPI . =3D ALIGN(8); .adev.info : { - _asdevice =3D .; - *(.adev.info) - _aedevice =3D .; + ADEV_INFO } :text -#endif =20 . =3D ALIGN(8); .teemediator.info : { --=20 2.46.1 From nobody Sat Dec 21 17:11:10 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=1727196200; cv=none; d=zohomail.com; s=zohoarc; b=PaoDkEnYYCsl9NXzlKQfjhTS7JquYwk6ZIezBk6TfJGyiMK5u65IBSIISFJzfdwXIjOwvc/oQoRbJ9PMsq3autiTzBdJxbVdpSXxcLnE/taC3UtzenvK8dyh5dJDnqclvr8rEvggUivm8uBkMU7upVoeD090TQcHc+qhjk/mxi4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727196200; 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=VwsMqH+vxZYDyNEsWH1sd5LxztB46M2iGBmwnAqg9js=; b=lOcTmLnr40iaQ3wuKnzd0RY/9brvDCVbv3Vy2e1ngGDp8dFvf5TDyS4ootAxnTYXmrUUdHLz74jjzku8xFrbtai2Q/NCcv7HvuYLSh7qs3ZkF7gIxD/WXs0UjZNW0wY2jExPMH3lEBiAUzX436CRLZSfi68zALsQRuF2686cEXc= 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 1727196199849904.2966053936011; Tue, 24 Sep 2024 09:43:19 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.803182.1213694 (Exim 4.92) (envelope-from ) id 1st8cf-0008JT-ER; Tue, 24 Sep 2024 16:42:45 +0000 Received: by outflank-mailman (output) from mailman id 803182.1213694; Tue, 24 Sep 2024 16:42:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1st8cf-0008Ix-3l; Tue, 24 Sep 2024 16:42:45 +0000 Received: by outflank-mailman (input) for mailman id 803182; Tue, 24 Sep 2024 16:42:43 +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 1st8cd-0006l4-FH for xen-devel@lists.xenproject.org; Tue, 24 Sep 2024 16:42:43 +0000 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [2a00:1450:4864:20::52b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 04412154-7a94-11ef-99a2-01e77a169b0f; Tue, 24 Sep 2024 18:42:41 +0200 (CEST) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5c26815e174so7230421a12.0 for ; Tue, 24 Sep 2024 09:42:41 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c5cf4972f8sm925880a12.36.2024.09.24.09.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 09:42:39 -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: 04412154-7a94-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727196161; x=1727800961; 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=VwsMqH+vxZYDyNEsWH1sd5LxztB46M2iGBmwnAqg9js=; b=BH+VvGxHnjlwcwGxyjEY4i8ZvXVN+9BpFu/uRBwXPKPdEn1Hp+H2yP7b4ldqXMZCFw /90owJYRdvl/8zrD977AW1mEO5WntVCNd8xBAFb8hW/0tGDafLBuZ32h5v7WtQKZYEDc JuWhlbIRxzx3iS3hGRr+NrbKdbmZeAkj4OtNKSpJrLu8CkB9tvjfJsmFMUVq19QfR1bM xUtkI6Yt6ajAVzHKntl2QXe0aPyqDjHscI5sDwnBhkexw+aCRwuoWaM5n/tiLtHTmfZ5 oqFmapVywCvB/a380pfL92rTzMKK+yGKZtugUYCPb/x9LL4thruj6fU31mmTnzuNVvn7 LNcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727196161; x=1727800961; 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=VwsMqH+vxZYDyNEsWH1sd5LxztB46M2iGBmwnAqg9js=; b=YCLbBqVsPG+BJr70m5Xe+wyrb585g4BTp/x7FZ2+de+Q1JzqlsjdlnGnYMW5YHOO+O MADQfguhRqETZGu6WLN1KJDVcrQxPuTM/bd3TsFbPVE/IHdF+SmuWAKj6GYB1eSgBBw7 3KwUGQRfnW2zgVkJHRO3FfqmS3GS34l8F1uDf+TYE+esFNk4stdqcPyYuWW4WnKnZgWb Khs9M2fm+csUGZ3YvM/eb8Y8ZblSv+fzliAwE8eoQufQf3tuIKH7CzaxQ50TDQ0t+oQf R83IljsM0biLlXdbY/yhEmxemIzGg8RHazPbt2YsRvQ2YZvpLY+zAy0F+ZOeCNn9MxqK 0Ugw== X-Gm-Message-State: AOJu0YypVuycYOKu/1YhYQQJTHnJtp9u5BrT5Mcz/lSsP1aRS9RlE0sP cmfaG7zB0qULkAKqnmYbN+pOVLQA5i39pWKAcQMbVUcGiuzjYV28nXohdw== X-Google-Smtp-Source: AGHT+IHB8hT+6MsHt5VSeesC8+CxLmnF5vq1SHabPcyfUYt4kcbkgOi9U/Owow2HAETlXaqawk6IFQ== X-Received: by 2002:a05:6402:3548:b0:5c4:4e15:872b with SMTP id 4fb4d7f45d1cf-5c464a584bemr12014767a12.28.1727196160605; Tue, 24 Sep 2024 09:42:40 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Shawn Anastasio Subject: [PATCH v3 3/5] xen/ppc: add section for device information in linker script Date: Tue, 24 Sep 2024 18:42:32 +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: 1727196201599116600 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 V2: - use refactored DT_DEV_INFO macros. - Add Acked-by: Shawn Anastasio --- xen/arch/ppc/xen.lds.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S index 38cd857187..fb8f7703d4 100644 --- a/xen/arch/ppc/xen.lds.S +++ b/xen/arch/ppc/xen.lds.S @@ -94,6 +94,11 @@ SECTIONS CONSTRUCTORS } :text =20 + . =3D ALIGN(POINTER_ALIGN); /* Devicetree based device info */ + DECL_SECTION(.dev.info) { + DT_DEV_INFO + } :text + . =3D ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin =3D .; DECL_SECTION(.init.text) { --=20 2.46.1 From nobody Sat Dec 21 17:11:10 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=1727196192; cv=none; d=zohomail.com; s=zohoarc; b=OcygUZF+w/1Fs8cdFrUqDNRZ57HDyN/9m/aBgYgJuTsQg/2xWldzBpvNhMQh0qKWVojsLbOFs0yL2kzllIZhn42ARcj1Fo4nwDcdDGacV6a6iSc3BBn64WLE6z+gOUJQnFXxdzO8xE/LWGQNgTxp/2iO7cXTHkyiwT3rhpxd7SY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727196192; 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=XIfX/djb1o7xVS3XP5z4GDh2TaBNEkfpUUAYhcycsgI=; b=CE/VWR8ErzUrRDa019Ai33NYAVXSCh2xs0E5Hb6W35EX4/2B4saKxVeiwkuKFSHHyB9vnz2GBCs1KMDGb6XqWu/KvHd896rcd52rhhYVCNM5Xci1kZYkaV28WASZZP2LLC76mu5DtO1hJe6fDhVZRxfFc+M5j2do+fp+7aMtzLI= 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 1727196192345222.2295038856496; Tue, 24 Sep 2024 09:43:12 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.803181.1213689 (Exim 4.92) (envelope-from ) id 1st8ce-0008Gf-VS; Tue, 24 Sep 2024 16:42:44 +0000 Received: by outflank-mailman (output) from mailman id 803181.1213689; Tue, 24 Sep 2024 16:42:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1st8ce-0008GQ-Qx; Tue, 24 Sep 2024 16:42:44 +0000 Received: by outflank-mailman (input) for mailman id 803181; Tue, 24 Sep 2024 16:42:43 +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 1st8cd-0006ag-7j for xen-devel@lists.xenproject.org; Tue, 24 Sep 2024 16:42:43 +0000 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [2a00:1450:4864:20::532]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 04cf4623-7a94-11ef-a0ba-8be0dac302b0; Tue, 24 Sep 2024 18:42:42 +0200 (CEST) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5c4146c7b28so7279322a12.2 for ; Tue, 24 Sep 2024 09:42:42 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c5cf4972f8sm925880a12.36.2024.09.24.09.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 09:42:41 -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: 04cf4623-7a94-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727196162; x=1727800962; 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=XIfX/djb1o7xVS3XP5z4GDh2TaBNEkfpUUAYhcycsgI=; b=aIyNvEc94YTZd8hSrE1+jLXVM4eJm2xC3qIbD+JgS7A1WqAExh0+/NbUQyxRM5r8dY ZQPbSfc3AGhIaj0ReSecrYoQgbJfOq3jKN+ileHLBJotwlgc7eZqo13ZyYy3WjcQrKsg wVLTXdG+xNDlXnOZZD/PYeHtSHt4wUfFjpE+DC4jVsJqJfZfIaMpMIwSq6eP+y85TvCW hG9pdZ2oMTRVuDOij06GsO7Y9rqXRHP2jhsTbKV6gxTXJp+q7g8QQpMPjdO+wHV8uDQA fRl83yKrlw0VxZDP/SevG5/HKHD8U93hYnPFR5u+AJ4w6zppJEyufI/mPZlbsma4NUXY IMAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727196162; x=1727800962; 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=XIfX/djb1o7xVS3XP5z4GDh2TaBNEkfpUUAYhcycsgI=; b=RjKxjdCdv43RqcFrbCxoQ6jusoNd+pwXC8Xd+Rj1/mJe7LZjWnb79XXlZvyvUV4b3d adiFSIBxRVkB0OuB1frSM/c3z8vVqG3Pq6aLPi0lj7mf3R/5RSrpwn3cttuFPwE7AE8B D9c3EYcmr96HSNh1qJuXWbXK8uvdQfgm2ddLmEOCXP31MMNJ2IHJ5Gq+VYrkr1ndRH97 tw7BwlGzi9kN9QavO67VFx5FpjCknaTHfjzAdJaGj3O2CUMkWn7D+1GDZpjG1V5YHmWw 6P/2RyDcaAKXW2Ml0SZA8zpIdI2fbqttzzbtevsAhdSOp7veBpYErX0qQ6Rnydkwan6I kUbg== X-Gm-Message-State: AOJu0Yzl2+9ksWb1jRroyElx2GUSIKDIAIwlCxQ3Myo7f2aDifXysBZg 3OucCrWR8/Pf5vnl7D+i8l57w50uvSohm+7EbpbuApWPnkpakwxHrP0FCA== X-Google-Smtp-Source: AGHT+IFH13sm72E1R02O+vECbDO75b1rt+pFKcYeFs2ufdbVwFz/djvVfTzytxPcp9v+jEFnCjI0DQ== X-Received: by 2002:a05:6402:321b:b0:5c4:6568:735f with SMTP id 4fb4d7f45d1cf-5c4656873b0mr16801095a12.25.1727196161925; Tue, 24 Sep 2024 09:42:41 -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 v3 4/5] xen/riscv: add section for device information in linker script Date: Tue, 24 Sep 2024 18:42:33 +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: 1727196193626116600 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 --- Changes in V2: - use refactored DT_DEV_INFO macros. --- xen/arch/riscv/xen.lds.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index 070b19d915..549c869922 100644 --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -91,6 +91,11 @@ SECTIONS CONSTRUCTORS } :text =20 + . =3D ALIGN(POINTER_ALIGN); /* Devicetree based device info */ + .dev.info : { + DT_DEV_INFO + } :text + . =3D ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin =3D .; .init.text : { --=20 2.46.1 From nobody Sat Dec 21 17:11:10 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=1727196195; cv=none; d=zohomail.com; s=zohoarc; b=fdXGJ+43U7aTQn0qt/NzeLvTooSZYlGcxXYCkHqenjtzVa6fzituLy5acvKlnu9JpOT5KYVcQ2oskr2QMdgKCr2gg3jCDeyQqoHzyA4x+b+glV+GWUWOFLxQz0uk/MaQyo0HiokVq6k5lYmf0IVXqLWamq0A89wKxLcjpuN/nOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727196195; 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=rd0RKKyPPEB4zhpM6Q59vLfdVoXLAhKMtI06rtQIwhA=; b=PmUmHkmLoeeIQZncx2VbZfYd6Bh2YHfJ+8C1oma9Gg16kFqeTMW/gYtCVexfPlhVC5T4SUkwMApQDT2idsDEYmlTJvn1ThxitCHjdEbbNJlmcgzVMVvJpX1LpY3vXAxVNztBzy/mZeDIFSM2vzaNsF8Bu/Tyvs6koIBwmmAwAxc= 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 1727196195905680.068551575133; Tue, 24 Sep 2024 09:43:15 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.803183.1213702 (Exim 4.92) (envelope-from ) id 1st8cg-0008QW-2l; Tue, 24 Sep 2024 16:42:46 +0000 Received: by outflank-mailman (output) from mailman id 803183.1213702; Tue, 24 Sep 2024 16:42:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1st8cf-0008Nu-JR; Tue, 24 Sep 2024 16:42:45 +0000 Received: by outflank-mailman (input) for mailman id 803183; Tue, 24 Sep 2024 16:42:44 +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 1st8ce-0006ag-Jy for xen-devel@lists.xenproject.org; Tue, 24 Sep 2024 16:42:44 +0000 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [2a00:1450:4864:20::532]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 05966f9e-7a94-11ef-a0ba-8be0dac302b0; Tue, 24 Sep 2024 18:42:44 +0200 (CEST) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5c40942358eso78061a12.1 for ; Tue, 24 Sep 2024 09:42:44 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c5cf4972f8sm925880a12.36.2024.09.24.09.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 09:42:42 -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: 05966f9e-7a94-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727196163; x=1727800963; 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=rd0RKKyPPEB4zhpM6Q59vLfdVoXLAhKMtI06rtQIwhA=; b=epqeUwbjslH4INyAQr1IMeKgzanLPHbaDgF+pmgtAsvmvfDlqPYY7+d48VTnCTKpYP dVpAAVJ8TT6937C4xet9PA8SQ60imX90rpESq/7+kvWz6yive1G8dzGmJGez/QoLRVdf vFcVLEif2kLuuPEFmVmiWmTBComLphw23Y2Apk+3Mfq+995TaPDx96Y+bmpyNTDDVWqM J7RbYzWvXqvdvP9ZgWUYBGYtoJiFX4OcPungOgyaHrq3vKK7j1BmxrMzGuQJ+QahA4VB wBBqorHk+2UZb4CRswjM90XHiIdA6tVKFsSsBCYr7bMyX6hFUBXaX78OhuK0tr5S0OVh hjYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727196163; x=1727800963; 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=rd0RKKyPPEB4zhpM6Q59vLfdVoXLAhKMtI06rtQIwhA=; b=slXG26yWRuq0xpImMkWo0OAlSKsWQDopVzCU8mCFvjnDS6RdUQ2ydkvaQTqN03U6+N WQefOObYotJOQuyjrI/sFS3LaonxkhEg4/2cZfGtfrY8/yTqtDQL8ias9VRNoprK6tno atG4JnkRgdOCCCtJv9zcGoaGvNOJ8Yuv3SU8fMxfnJco4rJXydiFZNUm3iBqGV4WwEmS bSP9oSWDuD/DAj0Lt/NCkwtZQy311Rx7QAGaVum1l/wgp7ok7Z7n3J9MlrOEo+oktS7F sJJWm4p/gTPvQfq1/U5S+4OjU/SKgzNdrIXhbzVJ7JMNONF3O9NyI8vQr5SXTJGD+6zH KMAQ== X-Gm-Message-State: AOJu0YxmKc5HIBhWt/vDWbnN2SHwGpkLqFLscOSq+lW6eBnuuZEn1pmj i6AxEspgbBHx00M0qHDBIrAJhEV/XGNcxdku+4dmm/voTbfvdJovyqxKfw== X-Google-Smtp-Source: AGHT+IH93gz7SQ7dPE5qtwVgw9JtiTwj8OcCCAzycrxVvN5xbDQC+iyiAmNQmluY17ldHoAXibjqrQ== X-Received: by 2002:a05:6402:360f:b0:5c4:1372:f5ac with SMTP id 4fb4d7f45d1cf-5c5cdfb7394mr4578760a12.11.1727196163059; Tue, 24 Sep 2024 09:42:43 -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 v3 5/5] xen/common: move device initialization code to common code Date: Tue, 24 Sep 2024 18:42:34 +0200 Message-ID: <6d85c4336b473cfaf41bb7a568c9629e01d80faf.1727193766.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: 1727196197703116600 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 --- Changes in V2: - 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