From nobody Thu Nov 21 21:26:22 2024 Delivered-To: importer@patchew.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; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1723628621; cv=pass; d=zohomail.com; s=zohoarc; b=cMQLsk/nKjDtGaVHW2kUFJAjYLgJ55GwKgp109Wy4A265WzBoCoSGEqxe0CnalIZP9ucl1BbImsD3mFEMUi3L8RrDpstvmK6g2qisifi9cfvMfJMDIJDCPPM36CykX662baHo8xl3uFmFoFqCPuOtyRqlDn+LlxgSsBlAidxtTk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723628621; h=Content-Type: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=orGz9J979LxEriGwI1+0fdMAD1Fr4iF2kav9HAlL6Qs=; b=DbuuJWgJw4Q9baKSmM0v6Ao6ffSfi3o5Kyh8HCen4qAlJtMR10+IppQ7eOKI0miT+0Uqu7qbxIfmZHzGAE4/QrytzXhyL+F6EgvVH+fyehgc7rmHTKix3YZZFv6I+rZM52yMZ/5qJE+ffyhIOfGjiOSTSe1ojYGtzWWkaepHeTI= ARC-Authentication-Results: i=2; 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; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1723628621010617.4733030418164; Wed, 14 Aug 2024 02:43:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.777024.1187221 (Exim 4.92) (envelope-from ) id 1seAXG-0003ol-B3; Wed, 14 Aug 2024 09:43:18 +0000 Received: by outflank-mailman (output) from mailman id 777024.1187221; Wed, 14 Aug 2024 09:43:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1seAXG-0003oe-5w; Wed, 14 Aug 2024 09:43:18 +0000 Received: by outflank-mailman (input) for mailman id 777024; Wed, 14 Aug 2024 09:43:17 +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 1seAXF-0003ca-Fw for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 09:43:17 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2060a.outbound.protection.outlook.com [2a01:111:f400:7e88::60a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a171d51f-5a21-11ef-a505-bb4a2ccca743; Wed, 14 Aug 2024 11:43:16 +0200 (CEST) Received: from SN7PR04CA0097.namprd04.prod.outlook.com (2603:10b6:806:122::12) by SJ2PR12MB7848.namprd12.prod.outlook.com (2603:10b6:a03:4ca::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.24; Wed, 14 Aug 2024 09:43:12 +0000 Received: from SA2PEPF00003AE6.namprd02.prod.outlook.com (2603:10b6:806:122:cafe::f0) by SN7PR04CA0097.outlook.office365.com (2603:10b6:806:122::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.24 via Frontend Transport; Wed, 14 Aug 2024 09:43:12 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SA2PEPF00003AE6.mail.protection.outlook.com (10.167.248.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 09:43:11 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug 2024 04:43:10 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug 2024 04:43:10 -0500 Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 14 Aug 2024 04:43:09 -0500 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: a171d51f-5a21-11ef-a505-bb4a2ccca743 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s0qpplCp1mi4XpRKzFq6WeIk9QJSrmHnTXHtWiq1moQhl5gxT16O2MNT05DCqc1x2muXbKmai86BevbC/av2YzARGezSDgDNU0Se5HGygUNumbpbMs4R5LiMMHmusHV3UjVCNPNGOXfJoa0yFnY2HMPwk23LBULrLWxW83d0gfPVdBn0Xm1KMFvKAv9Pb7pGJs+Y04M7EM9k9ku41XfAfLrrg9Ht60iK71+KBP2lEGXzLu2SjGfRQ27WDyxwirWOfZ5JIB2SatkZtYuyrsV+CbB6MNLWKZQzPYGuSa5fwvQymuzQ490Mm+vT15bUfQoWqKjuM7QmYSPiSIFrJ4R4KA== 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=orGz9J979LxEriGwI1+0fdMAD1Fr4iF2kav9HAlL6Qs=; b=tUPKdumYV4OpEnMeq++83RZhlmJmO2cgHr5Xkhdq1aYI9g2K9r1rTbIliSMwf130oSXYAzzUgIuIIpKYV9inpX2kAiLkTVSRuMjj8zxCaJcPWg5JBm6Vg7tHDouM7hkBKFJnzMbE5kLPiSGtOc4tgm63OvqU3U+ImJIWf4Xke7DYNoC8k9P9o6sryz5whvFlenQD9shRZTxE0LcfoH7xrt7QNSHYbbB16YNL71rp6/SaUGTr8lCDwOD28w8PrfheXbP3pZRn0eBlo8f44E8nFH/pROS/OS3okzVSITWmE045w+zSjozpw34vvHoFoXx7pZTOaKiJcvtVo3fYRwwumA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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=orGz9J979LxEriGwI1+0fdMAD1Fr4iF2kav9HAlL6Qs=; b=aRUoEUY695z0czFU50zs1OT8u3NeMqek/m+vgRwKGw2OAIRcdsDw9hvgtJm5MIDa2DzJuNX7AKFL3WfnGke1fUGn2XohD6x/WNIV1Ci6I6eAWD3U7vIomld4L/w1FhDoXtD9zEsXgHH8vYoWI7cH4wDM+zjG0vR0gPvlwZ1UpUg= 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 (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; 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=SATLEXMB04.amd.com; pr=C From: Michal Orzel To: CC: Michal Orzel , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH 1/2] xen/arm: Drop {boot_}phys_offset usage Date: Wed, 14 Aug 2024 11:43:02 +0200 Message-ID: <20240814094303.23611-2-michal.orzel@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240814094303.23611-1-michal.orzel@amd.com> References: <20240814094303.23611-1-michal.orzel@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00003AE6:EE_|SJ2PR12MB7848:EE_ X-MS-Office365-Filtering-Correlation-Id: c9c49482-f50c-4d68-7074-08dcbc4582ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fE4ENF/VFDH3P8YrIJDMdYn6IZpYyw51jY5jmQjt8lU6ScQ5melR8Vdx7IQT?= =?us-ascii?Q?ymx5R1r1rXqUAu6PGBoPgICdO2RYMYkL4QNPh8glZw5g/JFBrEOvzHcxbK9a?= =?us-ascii?Q?sJd2yIrYtj3G2fk7a4Sy2MYqoGYZumpmkI0/xhamvhPx4UwPZiJZo+oTpx+7?= =?us-ascii?Q?aIgMjmmZGxzY5nEfYEM3tsDicvyX3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q?L9rnSft4EwU2cEY3rSFm/JUsZxOHPfA863/5A54qN7s3S3liGvnYJEpW9qMx?= =?us-ascii?Q?Udt3liV4QJqWngzutcFmZOxTjvdPF/ermZ4Jgf1573k86ia2DHTVQ6wLW7dh?= =?us-ascii?Q?yNo/w9KWQI9FK0AJEqb95b9Rclz6MtlzY4yUUdF1++q3vQBdCYYj9aBtySZS?= =?us-ascii?Q?US0CaeSMWT/67jVrgyGj3yRcoct3dChkMVkIPiitB/bvACoF1lK/jGfGO84f?= =?us-ascii?Q?kmeGXQ0DOjMpiDDYnm/Wsp9ivicmUVp+BlByw686WOABp1sLsc0zS0dSa3ec?= =?us-ascii?Q?p9JGYJ8jaoFrkcuPgENdjSmu3Lg/0AqNFgo3wUjJebz2EjzM2w=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 09:43:11.4128 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9c49482-f50c-4d68-7074-08dcbc4582ec 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00003AE6.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7848 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1723628622844116600 Content-Type: text/plain; charset="utf-8" boot_phys_offset stores the physical offset (PA-VA), is calculated in the startup head.S code and passed to start_xen() as a first argument. There is no point in using it given that we can ask MMU to translate a VA for us using e.g. virt_to_{mfn,maddr}. Drop usage of these variables from the C world. Signed-off-by: Michal Orzel Acked-by: Julien Grall --- It should also simplify the LLC coloring last patch: https://lore.kernel.org/xen-devel/20240502165533.319988-14-carlo.nonato@min= ervasys.tech/ --- xen/arch/arm/include/asm/mm.h | 2 +- xen/arch/arm/mmu/setup.c | 16 ++++++---------- xen/arch/arm/setup.c | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h index f6ba611f01f7..5abd4b0d1c73 100644 --- a/xen/arch/arm/include/asm/mm.h +++ b/xen/arch/arm/include/asm/mm.h @@ -199,7 +199,7 @@ extern unsigned long frametable_base_pdx; #define PDX_GROUP_SHIFT SECOND_SHIFT =20 /* Boot-time pagetable setup */ -extern void setup_pagetables(unsigned long boot_phys_offset); +extern void setup_pagetables(void); /* Map FDT in boot pagetable */ extern void *early_fdt_map(paddr_t fdt_paddr); /* Remove early mappings */ diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c index 57042ed57b4a..9664e85ee6c0 100644 --- a/xen/arch/arm/mmu/setup.c +++ b/xen/arch/arm/mmu/setup.c @@ -17,6 +17,8 @@ /* Override macros from asm/page.h to make them work with mfn_t */ #undef mfn_to_virt #define mfn_to_virt(mfn) __mfn_to_virt(mfn_x(mfn)) +#undef virt_to_mfn +#define virt_to_mfn(va) _mfn(__virt_to_mfn(va)) =20 /* Main runtime page tables */ =20 @@ -52,8 +54,6 @@ DEFINE_BOOT_PAGE_TABLE(xen_fixmap); */ static DEFINE_PAGE_TABLES(xen_xenmap, XEN_NR_ENTRIES(2)); =20 -static paddr_t phys_offset; - /* Limits of the Xen heap */ mfn_t directmap_mfn_start __read_mostly =3D INVALID_MFN_INITIALIZER; mfn_t directmap_mfn_end __read_mostly; @@ -138,9 +138,7 @@ static void __init __maybe_unused build_assertions(void) =20 lpae_t __init pte_of_xenaddr(vaddr_t va) { - paddr_t ma =3D va + phys_offset; - - return mfn_to_xen_entry(maddr_to_mfn(ma), MT_NORMAL); + return mfn_to_xen_entry(virt_to_mfn(va), MT_NORMAL); } =20 void * __init early_fdt_map(paddr_t fdt_paddr) @@ -228,14 +226,12 @@ static void xen_pt_enforce_wnx(void) * Boot-time pagetable setup. * Changes here may need matching changes in head.S */ -void __init setup_pagetables(unsigned long boot_phys_offset) +void __init setup_pagetables(void) { uint64_t ttbr; lpae_t pte, *p; int i; =20 - phys_offset =3D boot_phys_offset; - arch_setup_page_tables(); =20 #ifdef CONFIG_ARM_64 @@ -290,9 +286,9 @@ void __init setup_pagetables(unsigned long boot_phys_of= fset) xen_second[second_table_offset(FIXMAP_ADDR(0))] =3D pte; =20 #ifdef CONFIG_ARM_64 - ttbr =3D (uintptr_t) xen_pgtable + phys_offset; + ttbr =3D virt_to_maddr(xen_pgtable); #else - ttbr =3D (uintptr_t) cpu0_pgtable + phys_offset; + ttbr =3D virt_to_maddr(cpu0_pgtable); #endif =20 switch_ttbr(ttbr); diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index cb2c0a16b824..cfe19e15b0be 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -304,7 +304,7 @@ void asmlinkage __init start_xen(unsigned long boot_phy= s_offset, /* Initialize traps early allow us to get backtrace when an error occu= rred */ init_traps(); =20 - setup_pagetables(boot_phys_offset); + setup_pagetables(); =20 smp_clear_cpu_maps(); =20 --=20 2.25.1 From nobody Thu Nov 21 21:26:22 2024 Delivered-To: importer@patchew.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; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1723628618; cv=pass; d=zohomail.com; s=zohoarc; b=CcW51iUd622xxhRl9THQXDFbpcR49CTk0zAxxFv1RdFR76ZwgU9Bf+1QZ1k+NWwUoyjQjKdmL+KmJybNvR6EgZoUD8jeN2r8t2FQGdDNxnV5GznsUoP9saupUY57dbxyOJ4g8RWGPvKn5hg80493rlYLUCdWp62BzLXO0TOjfqo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723628618; h=Content-Type: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=/KSw71JxdXit9FabNCWRoEsweJcGEQpXx+neZF5JHpw=; b=Rs9xP9thMEFkfFfWcqCBaNmxn4jz/y7AxHcfWyEZFN88n1SxqqEBcNmL0633A0XIR+Q4s7jX99c4510jnkiJcPP8QLplPmsQjPl4vccy1BoaD9MlzHmlFDrh7ndTYAzQcjF5GpIKlmMdw9/FDUTInLbDlmiyIbtX/I/smh8KL0c= ARC-Authentication-Results: i=2; 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; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1723628618245351.61976652311864; Wed, 14 Aug 2024 02:43:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.777025.1187231 (Exim 4.92) (envelope-from ) id 1seAXI-00043c-Hy; Wed, 14 Aug 2024 09:43:20 +0000 Received: by outflank-mailman (output) from mailman id 777025.1187231; Wed, 14 Aug 2024 09:43: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 1seAXI-00043V-D1; Wed, 14 Aug 2024 09:43:20 +0000 Received: by outflank-mailman (input) for mailman id 777025; Wed, 14 Aug 2024 09:43:19 +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 1seAXH-0003ca-80 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 09:43:19 +0000 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on20600.outbound.protection.outlook.com [2a01:111:f403:2409::600]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a2e36b3b-5a21-11ef-a505-bb4a2ccca743; Wed, 14 Aug 2024 11:43:18 +0200 (CEST) Received: from CH0PR03CA0019.namprd03.prod.outlook.com (2603:10b6:610:b0::24) by DM4PR12MB6182.namprd12.prod.outlook.com (2603:10b6:8:a8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Wed, 14 Aug 2024 09:43:13 +0000 Received: from CH1PEPF0000AD74.namprd04.prod.outlook.com (2603:10b6:610:b0:cafe::82) by CH0PR03CA0019.outlook.office365.com (2603:10b6:610:b0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend Transport; Wed, 14 Aug 2024 09:43:13 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by CH1PEPF0000AD74.mail.protection.outlook.com (10.167.244.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 09:43:12 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Wed, 14 Aug 2024 04:43:12 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug 2024 04:43:12 -0500 Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 14 Aug 2024 04:43:10 -0500 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: a2e36b3b-5a21-11ef-a505-bb4a2ccca743 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dWOqeU1nAq+2cvtQX5tRnE/zITUXXT2NzSLWFyMqhBXe1GCrD5HZDgXPe4wjwPWMQlSwcV600B/NsNo7qsWtcW8PYujwpOX+Yo6eR0gK8SAdUm7r0eTVStzraLSZKMr8f69v/VtELxO3oaRXKwZKzkQ6IBMzFJjZ8c9hbMY/FJgGYBsy6n0B9L0LyNsWS5tdjkze7IhuvCYzKiyoOPvnRc86yMbomgH5iQeDbgqcC5nbT410hjBNU1h6Rmr/PqvodN9EsXivHpucLBFi+MKT6eqY0YlxB/vl7+Tovd7fBA/4ce+WrQZmOJqqPTcVU6SrinVPdlgLbVjfDz440dSfww== 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=/KSw71JxdXit9FabNCWRoEsweJcGEQpXx+neZF5JHpw=; b=wk/BisZmXFd1rRG5KLiRA03+9ryeUeN6+mMudxeAqf4OxkW5GaWymoZAVbEGwwG6fi1eBaejCgSRXFf7267fRRqbyu6vmF/TwAMCIYBi1e1AYQ0wYNUmKe4vKN+7P/u/Ll8enuz1TWbYhIBjsxMRAtcBFMoM7tqQCadJg65LyypBejasgiLOhjMMmTxM/0h7jH0jUEMpEcQhtCFDjJ7ZUGvQYkB1EO8j8RnWVNsya7SuCQ5ZJhILND3Wp+W5JC1fQwYFD+giH3SEblReUMn2cQjbNCgBIte0YYDw7JH8SYDVlAG/Vhwu/jKYqshfIGQHmh2yLWmvAruRcQ5lUPZc6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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=/KSw71JxdXit9FabNCWRoEsweJcGEQpXx+neZF5JHpw=; b=Fq/redV3mqWGjtlIjb1g+BSnJwgAZyZioPMZ0CrppCZzUb7a1fpLcZDlGOly8pMIgXXnMYJgYOCJzu7eNQIgzFqdiQHatPENQjgVotGJfULgrD9g4lrmP+ubwwW+kbabIeUWyRC6+RDmrbOD9wXlE/sabikN0c4JzY6G0SEzVYk= 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 (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; 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 From: Michal Orzel To: CC: Michal Orzel , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH 2/2] xen/arm: head: Do not pass physical offset to start_xen Date: Wed, 14 Aug 2024 11:43:03 +0200 Message-ID: <20240814094303.23611-3-michal.orzel@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240814094303.23611-1-michal.orzel@amd.com> References: <20240814094303.23611-1-michal.orzel@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD74:EE_|DM4PR12MB6182:EE_ X-MS-Office365-Filtering-Correlation-Id: ee0edfc1-42ce-494b-15ec-08dcbc4583d4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Jo4kmQBdWLqLq/OQ8nOBkZtPFo78CRZyRkahpHOnONZrd7jVaSBeG6uC/+M8?= =?us-ascii?Q?HhZkeO3FMzqUk0VPFXaaqA24ivELb/2pq1Wb0/mlynKg6HXiEIyciIMnJiPE?= =?us-ascii?Q?MWVTtFdx01NAYUI/PCpZHT6dAtDW2BUR1T+v9pUVG7ssk3gSokFtUWaMlhhi?= =?us-ascii?Q?hIAQDviejcPaAp8e4k8YYs5Ds5OeNl4Iev4B9ZE2rOQ0asawnX9MqPBmr7H/?= =?us-ascii?Q?lvy7w66c26deRJ21kSrW7wT+BU/2g3ZkkrVW6YPKwSXuaaqa44PUxc9e65QZ?= =?us-ascii?Q?GBfjZcWOcK2q3N8RT/LP4XVY1t1Xha9EpNA3GXvuxgMsRVMtb92r/yjG7cVO?= =?us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2hg+0SEBf5fmRQdL4DFifTrk/vX93aUzZ?= =?us-ascii?Q?cAftUSKBA0foa1uJNh1jhQJO4lchljLj4Fh2m/l2TBLfRgqhrrr2fJx+8Cpd?= =?us-ascii?Q?e+CdK8uyqtI+9UJG+RKsV6mTtjSH47SZJGkV1do6DZFvWUUAWIDPrZkB4uFG?= =?us-ascii?Q?37BJ5Zqcg8TWo57Pr8JYxYYMveLxzzbxTRtN/BMEDeX2DVUMdfvzQ+j3lZqx?= =?us-ascii?Q?OGOMKZrRJr/OZ62mitz73su76EwmEM4w?= 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)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 09:43:12.9466 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee0edfc1-42ce-494b-15ec-08dcbc4583d4 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: CH1PEPF0000AD74.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6182 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1723628620638116600 Content-Type: text/plain; charset="utf-8" Given no further use in C world of boot_phys_offset, drop it from the argument list of start_xen() and do the necessary changes in the startup code head.S (most notably modifying launch not to expect 2 arguments to pass to C entry point). Both on arm64 and arm32, phys offset (stored in x20 or r10 respectively) is still needed, so that it can be used in e.g. create_table_entry, therefore keep it on the list of common register usage. Signed-off-by: Michal Orzel Acked-by: Julien Grall --- xen/arch/arm/arm32/head.S | 12 +++++------- xen/arch/arm/arm64/head.S | 12 +++++------- xen/arch/arm/setup.c | 3 +-- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S index b488a21a71ba..a96d5d35038f 100644 --- a/xen/arch/arm/arm32/head.S +++ b/xen/arch/arm/arm32/head.S @@ -101,9 +101,8 @@ primary_switched: bl zero_bss PRINT("- Ready -\r\n") /* Setup the arguments for start_xen and jump to C world */ - mov r0, r10 /* r0 :=3D Physical offset */ - mov r1, r8 /* r1 :=3D paddr(FDT) */ - mov_w r2, start_xen + mov r0, r8 /* r0 :=3D paddr(FDT) */ + mov_w r1, start_xen b launch ENDPROC(start) =20 @@ -141,7 +140,7 @@ GLOBAL(init_secondary) secondary_switched: PRINT("- Ready -\r\n") /* Jump to C world */ - mov_w r2, start_secondary + mov_w r1, start_secondary b launch ENDPROC(init_secondary) =20 @@ -243,8 +242,7 @@ ENDPROC(cpu_init) * * Inputs: * r0 : Argument 0 of the C function to call - * r1 : Argument 1 of the C function to call - * r2 : C entry point + * r1 : C entry point * * Clobbers r3 */ @@ -256,7 +254,7 @@ launch: sub sp, #CPUINFO_sizeof /* Make room for CPU save record */ =20 /* Jump to C world */ - bx r2 + bx r1 ENDPROC(launch) =20 /* Fail-stop */ diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index 2fa07dc3a04b..14c3720d80f8 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -260,9 +260,8 @@ primary_switched: bl zero_bss PRINT("- Ready -\r\n") /* Setup the arguments for start_xen and jump to C world */ - mov x0, x20 /* x0 :=3D Physical offset */ - mov x1, x21 /* x1 :=3D paddr(FDT) */ - ldr x2, =3Dstart_xen + mov x0, x21 /* x0 :=3D paddr(FDT) */ + ldr x1, =3Dstart_xen b launch END(real_start) =20 @@ -303,7 +302,7 @@ FUNC(init_secondary) secondary_switched: PRINT("- Ready -\r\n") /* Jump to C world */ - ldr x2, =3Dstart_secondary + ldr x1, =3Dstart_secondary b launch END(init_secondary) =20 @@ -407,8 +406,7 @@ END(cpu_init) * * Inputs: * x0 : Argument 0 of the C function to call - * x1 : Argument 1 of the C function to call - * x2 : C entry point + * x1 : C entry point * * Clobbers x3 */ @@ -421,7 +419,7 @@ FUNC_LOCAL(launch) mov sp, x3 =20 /* Jump to C world */ - br x2 + br x1 END(launch) =20 /* Fail-stop */ diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index cfe19e15b0be..961d3ea6700b 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -287,8 +287,7 @@ void __init init_pdx(void) size_t __read_mostly dcache_line_bytes; =20 /* C entry point for boot CPU */ -void asmlinkage __init start_xen(unsigned long boot_phys_offset, - unsigned long fdt_paddr) +void asmlinkage __init start_xen(unsigned long fdt_paddr) { size_t fdt_size; const char *cmdline; --=20 2.25.1