From patchwork Thu Oct 17 09:55:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Fancellu X-Patchwork-Id: 13839812 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 611E7D2126D for ; Thu, 17 Oct 2024 10:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+2LM/Gh6G6ZmOqRhESdZZWhJZ0Yxqio+A7yy1o9baHk=; b=Iiz1f5LMYBsMOQsqMoBpPTQj+J 0oF4nAld89JEP9jyn/tbjXVLtKIuYaeXouwRD5yLu/C2rTtDyNhBItxGV9KsjsTPen4n3IuKhmMBh OpFJfTapgrCyz3tWkENEtnlxUzESlDfE291Ln079yNRqKDKlnYjm1RBn6QWPbsBJgTsznp8V/I447 BXhymNBKGw0iQ5tf/YaBOYTb/OZmiqMvTMNnoBkYrsqH4T/ch30yzLkflh8hgUHN5GQcnY7l3lAaR YZyCQEIZR+tNnJ7zLX9GxQk6wpUn+lWTe0BSEgFwPKR5B723do9yVbe7vbo5ROlWeHo44kLG44Pvq +vxD4mLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1Nex-0000000EVM8-0CYN; Thu, 17 Oct 2024 10:23:11 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1NEC-0000000ER2H-15L5 for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2024 09:55:39 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8D9F41595; Thu, 17 Oct 2024 02:56:01 -0700 (PDT) Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C4F93F71E; Thu, 17 Oct 2024 02:55:31 -0700 (PDT) From: Luca Fancellu To: mark.rutland@arm.com, andre.przywara@arm.com Cc: linux-arm-kernel@lists.infradead.org Subject: [boot-wrapper v4 4/4] aarch64: Start Xen on Armv8-R at EL2 Date: Thu, 17 Oct 2024 10:55:20 +0100 Message-Id: <20241017095520.939464-5-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241017095520.939464-1-luca.fancellu@arm.com> References: <20241017095520.939464-1-luca.fancellu@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_025532_379407_409A7EDC X-CRM114-Status: GOOD ( 10.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When bootwrapper is compiled with Xen support and it is started at EL2 on Armv8-R AArch64, keep the current EL and jump to the Xen image using the SPSR_KERNEL as spsr_el2 value. Signed-off-by: Luca Fancellu --- v4 changes: - no changes --- Makefile.am | 1 + arch/aarch64/boot.S | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index aecda694fd6c..a8d5c1b96822 100644 --- a/Makefile.am +++ b/Makefile.am @@ -127,6 +127,7 @@ XEN_CHOSEN := xen,xen-bootargs = \"$(XEN_CMDLINE)\"; \ compatible = \"xen,linux-zimage\", \"xen,multiboot-module\"; \ reg = <0x0 $(DOM0_OFFSET) 0x0 $(KERNEL_SIZE)>; \ }; +DEFINES += -DXEN endif if INITRD diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S index 565397823cb4..3fcc63bf2437 100644 --- a/arch/aarch64/boot.S +++ b/arch/aarch64/boot.S @@ -100,7 +100,7 @@ ASM_FUNC(jump_kernel) mov x1, x21 mov x2, x22 mov x3, x23 -#if defined(BOOTWRAPPER_64R) +#if defined(BOOTWRAPPER_64R) && !defined(XEN) // On Armv8-R Linux needs to be booted at EL1 mov x4, #SPSR_KERNEL_EL1 #else