From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F3ABC3DA5D for ; Mon, 15 Jul 2024 10:15:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.758817.1168315 (Exim 4.92) (envelope-from ) id 1sTIjo-0006EM-MU; Mon, 15 Jul 2024 10:15:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 758817.1168315; Mon, 15 Jul 2024 10:15:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sTIjo-0006EF-I4; Mon, 15 Jul 2024 10:15:20 +0000 Received: by outflank-mailman (input) for mailman id 758817; Mon, 15 Jul 2024 10:15:19 +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 1sTIjn-0006E9-K5 for xen-devel@lists.xenproject.org; Mon, 15 Jul 2024 10:15:19 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20621.outbound.protection.outlook.com [2a01:111:f403:200a::621]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 212bb5a4-4293-11ef-8776-851b0ebba9a2; Mon, 15 Jul 2024 12:15:17 +0200 (CEST) Received: from BL1P222CA0018.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::23) by DM6PR12MB4332.namprd12.prod.outlook.com (2603:10b6:5:21e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.28; Mon, 15 Jul 2024 10:15:13 +0000 Received: from BN3PEPF0000B069.namprd21.prod.outlook.com (2603:10b6:208:2c7:cafe::db) by BL1P222CA0018.outlook.office365.com (2603:10b6:208:2c7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.28 via Frontend Transport; Mon, 15 Jul 2024 10:15:12 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by BN3PEPF0000B069.mail.protection.outlook.com (10.167.243.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7784.5 via Frontend Transport; Mon, 15 Jul 2024 10:15:12 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 15 Jul 2024 05:15:12 -0500 Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Mon, 15 Jul 2024 05:15:10 -0500 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: 212bb5a4-4293-11ef-8776-851b0ebba9a2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BfhICrSY34LDbxvFvCF4U/6zt7nmz9yBM4klTgd9fU60j4bpvG+GzHllpLTTjz3Rcb9dJtZ6T6JHMO0nJSBuS2GGT4pPXNO8OMtzDhkgwU7bvFXmmEG0axfMu2Lh8cz7AoLb48uFrENYhnS2p6/Yv+yb0j7uAgHcKmKpgtrQ4DEaP8lfVeAOrSkVrDggoaZoN9AUbObEdvHbpkzEeV9aNcsOLJtXsWdULv30VUB0Kl+CU17WgtzVnIEbamcBgAYfGpNryRsCQzBR0cP01+NHH7QcoeeOODzJEzrwkESyaWlGrKc9JIGqIzqGuuQDseWT8kOa7EwSsxeajeMAdwVSeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yg3+d9VsWm1DnUTslS/oveDOZBCjtkbsH3/s9DogokQ=; b=neko306aGUcTolGQoFMkphDDeVSHfLXCrv5dYNg4WnENTEoeZC9IyECn1cV9Yu3U7ciDzV7iGSXh+V3KkjWU9F4lMM2vpJgbe2a1MlWxCx6uEUZF4hzJioXx43OmizKrSxh1aXrX23aCkWOJzm0cKDLOuyh2KrzgESMBOMn7FBffHuh+JPQZQxDpRdMTbuCdqq2WV4BXm6ZHGl4pHNmY5W6C7hXnWH3fLbTNlEr+CwySPufLnLIY+GMMiQW+tjbt4CvQkkVBCrHNipV4pIl8LC8Iwbus255nKYCKfxE+EblJs5PzEBRVWLTP2kCylcHlwFuN0SwdaBLRHhyfbwfzSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yg3+d9VsWm1DnUTslS/oveDOZBCjtkbsH3/s9DogokQ=; b=tFXQN9+3BmMJMONZzIbsAtxvlAOfVcZnCHICUD7YCk98ljPzo7CrEs20Yecp6df2z3KGlRwIRx9mhlIjBsOnwd37LtIk/SkavrOwYcmJ1aDDiSWyDL7eCKI5jLj9Vs1jZ3sPIObA3xHSIJWvAxlK7wTKb8Ff1wpmM3z8JEGaHgk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Message-ID: <98144517-5abe-4a82-81b4-6a459826fb2f@amd.com> Date: Mon, 15 Jul 2024 12:15:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 1/8] xen/device-tree: Move Arm's setup.c bootinfo functions to common To: Oleksii Kurochko , CC: Shawn Anastasio , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini , Bertrand Marquis , Volodymyr Babchuk , "Daniel P. Smith" References: Content-Language: en-US From: Michal Orzel In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B069:EE_|DM6PR12MB4332:EE_ X-MS-Office365-Filtering-Correlation-Id: d0c5838c-245f-413c-4568-08dca4b703bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?SWVMMmovcWZvSzlRRS96clFkUFZnZ0pJdWRHZ2luaHFwK2NBNmxnNUttR2tH?= =?utf-8?B?NGZwLzcvdVZTU1NySUhUWVFIZ2RrNUxpc1RDemZWMFBlN2ZKWktsd1RBSUR1?= =?utf-8?B?QUZVQVdFMjh0WFM2dVZycWloejRRd3FCTGp2dHF4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Q?4J0yN7oIGc09GIsMWpPYRNAE4cUp8NlV?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2024 10:15:12.7627 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0c5838c-245f-413c-4568-08dca4b703bc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B069.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4332 Hi Oleksii, In general, the patch looks ok (apart from Jan comments). Just a couple of remarks. On 12/07/2024 18:22, Oleksii Kurochko wrote: > > > From: Shawn Anastasio > > Arm's setup.c contains a collection of functions for parsing memory map > and other boot information from a device tree. Since these routines are > generally useful on any architecture that supports device tree booting, > move them into xen/common/device-tree. > > Suggested-by: Julien Grall > Signed-off-by: Shawn Anastasio > Signed-off-by: Oleksii Kurochko > --- > Changes in V6: > - update the version of the patch to v6, to show that it is based > on the work done by Shawn in the patch v4. > --- > Changes in V5: > - add xen/include/xen/bootfdt.h to MAINTAINERS file. > - drop message "Early device tree parsing and". > - After rebase on top of the current staging the following changes were done: > - init bootinfo variable in with BOOTINFO_INIT; > - update the code of dt_unreserved_regions(): > CONFIG_STATIC_SHM related changes and getting of reserved_mem > bootinfo_get_shmem() ?? > - update the code of meminfo_overlap_check(): > add check ( INVALID_PADDR == bank_start ) to if case. > - update the code of check_reserved_regions_overlap(): > CONFIG_STATIC_SHM related changes. > - struct bootinfo was updated ( CONFIG_STATIC_SHM changes ) > - add shared_meminfo ( because of CONFIG_STATIC_SHM ) > - struct struct membanks was update with __struct group so is > neeeded to be included in bootfdt.h > - move BOOTINFO_ACPI_INIT, BOOTINFO_SHMEM_INIT, BOOTINFO_INIT to generic bootfdt.h > - bootinfo_get_reserved_mem(), bootinfo_get_mem(), bootinfo_get_acpi(), > bootinfo_get_shmem() and bootinfo_get_shmem_extra() were moved to xen/bootfdt.h > - s/arm32/CONFIG_SEPARATE_XENHEAP/ > - add inclusion of because there are function in which > are using container_of(). > --- > Changes in v4: > - create new xen/include/bootinfo.h rather than relying on arch's > asm/setup.h to provide required definitions for bootinfo.c > - build bootinfo.c as .init.o > - clean up and sort bootinfo.c's #includes > - use CONFIG_SEPARATE_XENHEAP rather than CONFIG_ARM_32 to guard > xenheap-specific behavior of populate_boot_allocator > - (MAINTAINERS) include all of common/device-tree rather than just > bootinfo.c > --- > MAINTAINERS | 2 + > xen/arch/arm/include/asm/setup.h | 187 +----------- > xen/arch/arm/setup.c | 432 ---------------------------- > xen/common/Makefile | 1 + > xen/common/device-tree/Makefile | 1 + > xen/common/device-tree/bootinfo.c | 459 ++++++++++++++++++++++++++++++ > xen/include/xen/bootfdt.h | 196 +++++++++++++ > 7 files changed, 660 insertions(+), 618 deletions(-) > create mode 100644 xen/common/device-tree/Makefile > create mode 100644 xen/common/device-tree/bootinfo.c > create mode 100644 xen/include/xen/bootfdt.h > [...] > diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h > new file mode 100644 > index 0000000000..7cd45b3d4b > --- /dev/null > +++ b/xen/include/xen/bootfdt.h > @@ -0,0 +1,196 @@ > +#ifndef __XEN_BOOTFDT_H__ AFAIR, to avoid violating MISRA rule 21.1, we should avoid introducing new macros with double underscore. > +#define __XEN_BOOTFDT_H__ > + > +#include > +#include > +#include > + > +#define MIN_FDT_ALIGN 8 > +#define MAX_FDT_SIZE SZ_2M 2M blob limit is Arm64 specific. What will be the limit on RISCV? Shouldn't it be moved to some arch specific file? ~Michal