From patchwork Wed Jul 31 14:11:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Fancellu X-Patchwork-Id: 13748844 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 8D029C3DA64 for ; Wed, 31 Jul 2024 14:14:26 +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=f7luZx2DOU2MWFZlbvC1OthW7ZXQg6xYWXRk7Y1TmNs=; b=HjL2AYM7o8/t6Yx+1wTtROAwIU kNVUroo4zsINhBSV29pfGWblbDxXQkOkGJ4clcFwxzIwefUuF5+yOwezxLjLR9RCXNLgURKGC/sb7 WBqcyLbwDGbOhkE4hcDzwgSBi2nh4QJakK/yB/r0P4Xr69DteKJuBT9qYdaZV0U6UhOs9UbT+zATR j3zDUn61W3VhSUJcTzKWb9NTyEepzPW+YWprXRLX6qFBb0X6GqMkdg6bQv4WYAwGFvqqidqxv/YsZ cnoIFLavd0pK+LiPkGmi/9XG3KMrg7LWVE54aytvAkw4qG+yw6ZcjDRFxKuJf2UkaalRICcgJk8GT jFnp0jog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZA5m-00000001RLH-1KFw; Wed, 31 Jul 2024 14:14:14 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZA2v-00000001QF3-1oT7 for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 14:11:19 +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 E613C1595; Wed, 31 Jul 2024 07:11:41 -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 A0BCA3F5A1; Wed, 31 Jul 2024 07:11:15 -0700 (PDT) From: Luca Fancellu To: mark.rutland@arm.com, andre.przywara@arm.com Cc: linux-arm-kernel@lists.infradead.org Subject: [boot-wrapper v3 4/4] aarch64: Start Xen on Armv8-R at EL2 Date: Wed, 31 Jul 2024 15:11:03 +0100 Message-Id: <20240731141103.2559706-5-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240731141103.2559706-1-luca.fancellu@arm.com> References: <20240731141103.2559706-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-20240731_071117_584678_AB268033 X-CRM114-Status: GOOD ( 11.82 ) 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 --- Changes from v2: - Major rework, reason in the cover letter. --- Makefile.am | 1 + arch/aarch64/boot.S | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 62e2988c0dd3..0aee117eb827 100644 --- a/Makefile.am +++ b/Makefile.am @@ -113,6 +113,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 0b4f6824045a..d50ff48d83de 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