From patchwork Tue Jan 16 19:26:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elias El Yandouzi X-Patchwork-Id: 13521087 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 8B459C47258 for ; Tue, 16 Jan 2024 19:38:01 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.668158.1040172 (Exim 4.92) (envelope-from ) id 1rPpFy-0004La-51; Tue, 16 Jan 2024 19:37:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 668158.1040172; Tue, 16 Jan 2024 19:37:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rPpFy-0004LR-2D; Tue, 16 Jan 2024 19:37:54 +0000 Received: by outflank-mailman (input) for mailman id 668158; Tue, 16 Jan 2024 19:37:53 +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 1rPp5S-0003Xv-QV for xen-devel@lists.xenproject.org; Tue, 16 Jan 2024 19:27:02 +0000 Received: from smtp-fw-80009.amazon.com (smtp-fw-80009.amazon.com [99.78.197.220]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 384ebc32-b4a5-11ee-98f1-6d05b1d4d9a1; Tue, 16 Jan 2024 20:27:02 +0100 (CET) Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-pdx-2a-m6i4x-8a14c045.us-west-2.amazon.com) ([10.25.36.210]) by smtp-border-fw-80009.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2024 19:26:59 +0000 Received: from smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev (pdx2-ws-svc-p26-lb5-vlan3.pdx.amazon.com [10.39.38.70]) by email-inbound-relay-pdx-2a-m6i4x-8a14c045.us-west-2.amazon.com (Postfix) with ESMTPS id 61AFB8A88F; Tue, 16 Jan 2024 19:26:59 +0000 (UTC) Received: from EX19MTAUEB001.ant.amazon.com [10.0.44.209:25181] by smtpin.naws.us-east-1.prod.farcaster.email.amazon.dev [10.0.28.244:2525] with esmtp (Farcaster) id d5980af4-5f49-4af7-90df-632bef320357; Tue, 16 Jan 2024 19:26:58 +0000 (UTC) Received: from EX19D008UEA003.ant.amazon.com (10.252.134.116) by EX19MTAUEB001.ant.amazon.com (10.252.135.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 16 Jan 2024 19:26:45 +0000 Received: from EX19MTAUEB001.ant.amazon.com (10.252.135.35) by EX19D008UEA003.ant.amazon.com (10.252.134.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 16 Jan 2024 19:26:45 +0000 Received: from dev-dsk-eliasely-1a-fd74790f.eu-west-1.amazon.com (10.253.91.118) by mail-relay.amazon.com (10.252.135.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40 via Frontend Transport; Tue, 16 Jan 2024 19:26:44 +0000 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 Sender: "Xen-devel" X-Inumbo-ID: 384ebc32-b4a5-11ee-98f1-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1705433222; x=1736969222; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aYNk7nmnUy0AklxdrRg4GNXCK3HA+7wbY/AdUPNJirw=; b=uO7Ic/EPVcSsiLVodvkwfdiz05YSUI2JztFCr+KXgEKGJIiX+k4cCt/x qVO3JhGOuofIezBUuC4E7L9HPu1jGpgUpVh4sD/Xj0372qIxbra2jzoO/ QwJF40J85wR4pca1stBYJUNlNbUrLiq8eVd6Wz/megYCFhQz2m/pYUIS2 g=; X-IronPort-AV: E=Sophos;i="6.05,200,1701129600"; d="scan'208";a="58701687" X-Farcaster-Flow-ID: d5980af4-5f49-4af7-90df-632bef320357 From: Elias El Yandouzi To: CC: , , , Julien Grall , Stefano Stabellini , "Bertrand Marquis" , Michal Orzel , Volodymyr Babchuk , Elias El Yandouzi Subject: [PATCH v2 (resend) 24/27] xen/arm32: mm: Rename 'first' to 'root' in init_secondary_pagetables() Date: Tue, 16 Jan 2024 19:26:08 +0000 Message-ID: <20240116192611.41112-25-eliasely@amazon.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240116192611.41112-1-eliasely@amazon.com> References: <20240116192611.41112-1-eliasely@amazon.com> MIME-Version: 1.0 Precedence: Bulk From: Julien Grall The arm32 version of init_secondary_pagetables() will soon be re-used for arm64 as well where the root table starts at level 0 rather than level 1. So rename 'first' to 'root'. Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi ---- Changelog in v2: * Rebase * Fix typo diff --git a/xen/arch/arm/mmu/smpboot.c b/xen/arch/arm/mmu/smpboot.c index b6fc0aae07..fb5df667ba 100644 --- a/xen/arch/arm/mmu/smpboot.c +++ b/xen/arch/arm/mmu/smpboot.c @@ -84,32 +84,30 @@ int prepare_secondary_mm(int cpu) #else int prepare_secondary_mm(int cpu) { - lpae_t *first; + lpae_t *root = alloc_xenheap_page(); - first = alloc_xenheap_page(); /* root == first level on 32-bit 3-level trie */ - - if ( !first ) + if ( !root ) { - printk("CPU%u: Unable to allocate the first page-table\n", cpu); + printk("CPU%u: Unable to allocate the root page-table\n", cpu); return -ENOMEM; } /* Initialise root pagetable from root of boot tables */ - memcpy(first, per_cpu(xen_pgtable, 0), PAGE_SIZE); - per_cpu(xen_pgtable, cpu) = first; + memcpy(root, per_cpu(xen_pgtable, 0), PAGE_SIZE); + per_cpu(xen_pgtable, cpu) = root; if ( !init_domheap_mappings(cpu) ) { printk("CPU%u: Unable to prepare the domheap page-tables\n", cpu); per_cpu(xen_pgtable, cpu) = NULL; - free_xenheap_page(first); + free_xenheap_page(root); return -ENOMEM; } clear_boot_pagetables(); /* Set init_ttbr for this CPU coming up */ - init_ttbr = __pa(first); + init_ttbr = __pa(root); clean_dcache(init_ttbr); return 0;