From patchwork Wed Aug 9 22:48:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Anastasio X-Patchwork-Id: 13348615 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 2D6DCC0015E for ; Wed, 9 Aug 2023 22:49:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.581446.910151 (Exim 4.92) (envelope-from ) id 1qTrzJ-0004Dq-3k; Wed, 09 Aug 2023 22:49:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 581446.910151; Wed, 09 Aug 2023 22:49:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTrzJ-0004Di-0z; Wed, 09 Aug 2023 22:49:09 +0000 Received: by outflank-mailman (input) for mailman id 581446; Wed, 09 Aug 2023 22:49:08 +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 1qTrzI-0004DZ-C0 for xen-devel@lists.xenproject.org; Wed, 09 Aug 2023 22:49:08 +0000 Received: from raptorengineering.com (mail.raptorengineering.com [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f1df0abe-3706-11ee-b282-6b7b168915f2; Thu, 10 Aug 2023 00:49:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 72BEA828663A; Wed, 9 Aug 2023 17:49:05 -0500 (CDT) Received: from mail.rptsys.com ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id KJP5SenASSx8; Wed, 9 Aug 2023 17:49:04 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 65E8C8285387; Wed, 9 Aug 2023 17:49:04 -0500 (CDT) Received: from mail.rptsys.com ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4YyV_GkeTTjy; Wed, 9 Aug 2023 17:49:04 -0500 (CDT) Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38]) by mail.rptsys.com (Postfix) with ESMTPSA id E59BF8285225; Wed, 9 Aug 2023 17:49:03 -0500 (CDT) 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: f1df0abe-3706-11ee-b282-6b7b168915f2 DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 65E8C8285387 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD; t=1691621344; bh=Azi1XUqDdDmUx2jIDtnQNFXM9Pbptush/zECpYWLo5U=; h=From:To:Date:Message-Id:MIME-Version; b=Tud/wSlJhl7HchSQ5SvLl70ie8GlGp2LwCt+9k9oF8K/Xc8rdBmlX/t6AXjVOXfq3 7NKixkfgPKq0is0cSpOGUehd4+Fp4jVmUM6bD2tjvS/l5pXJPA1cybgff92zLJj07A xELUtNZ6S5Hy61BMkHlA6b71gskUVKcKKqABaCOg= X-Virus-Scanned: amavisd-new at rptsys.com From: Shawn Anastasio To: xen-devel@lists.xenproject.org Cc: Timothy Pearson , Andrew Cooper , Jan Beulich , Shawn Anastasio Subject: [PATCH v3 0/3] xen/ppc: Add early Radix MMU support Date: Wed, 9 Aug 2023 17:48:52 -0500 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 (v3: Apologies for the noise, but v2 was submitted in error and was missing a few changes to patch 3 that were discussed) Hello all, This series adds support for bringing up the Radix MMU with basic identity-mapped page tables. In order to simplify the memory layout, the series changes XEN_VIRT _START to 0xC000_0000_0000_0000, which has a couple of convenient properties. When the MMU is off, the top 4 address bits are ignored by the hardware, so this is equivalent to physical address 0. When the MMU is enabled, the top 4 address bits are used to select the memory quadrant, and 0xC corresponds to quadrant 3 which is used for kernel memory. Thus, by linking the kernel here and ensuring its physical load address is 0x0, we are able to run at the correct address both before and after the MMU is enabled. Additionally, as the Radix MMU was only added in ISA 3.0 (POWER9), this series also drops support for POWER8 for now, to avoid having a non-working build configuration in-tree. Thanks, Shawn Shawn Anastasio (3): xen/ppc: Bump minimum target ISA to 3.0 (POWER9) xen/ppc: Relocate kernel to physical address 0 on boot xen/ppc: Implement initial Radix MMU support xen/arch/ppc/Kconfig | 7 +- xen/arch/ppc/Makefile | 2 + xen/arch/ppc/arch.mk | 1 - xen/arch/ppc/include/asm/bitops.h | 9 + xen/arch/ppc/include/asm/config.h | 2 +- xen/arch/ppc/include/asm/mm.h | 18 ++ xen/arch/ppc/include/asm/page-bits.h | 3 +- xen/arch/ppc/include/asm/page.h | 179 ++++++++++++++++++ xen/arch/ppc/include/asm/processor.h | 34 ++++ xen/arch/ppc/include/asm/regs.h | 138 ++++++++++++++ xen/arch/ppc/include/asm/types.h | 1 + xen/arch/ppc/mm-radix.c | 265 +++++++++++++++++++++++++++ xen/arch/ppc/ppc64/head.S | 42 +++++ xen/arch/ppc/setup.c | 3 + xen/arch/ppc/tlb-radix.c | 96 ++++++++++ 15 files changed, 791 insertions(+), 9 deletions(-) create mode 100644 xen/arch/ppc/include/asm/bitops.h create mode 100644 xen/arch/ppc/include/asm/mm.h create mode 100644 xen/arch/ppc/include/asm/page.h create mode 100644 xen/arch/ppc/include/asm/regs.h create mode 100644 xen/arch/ppc/mm-radix.c create mode 100644 xen/arch/ppc/tlb-radix.c --- 2.30.2