From patchwork Thu Jun 6 13:36:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Fancellu X-Patchwork-Id: 13688521 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 AA239C25B75 for ; Thu, 6 Jun 2024 13:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OZbKRQszPDY4rm1V0oD7gTe2E8FExZ3CE4EHbC62E6U=; b=XY4oiOfagKsz1Q IjrekpwMN6h5qC08vBAyv0CLBhriuRXHJSrHOw4YcLLykurt1UqTCDojQsuKsSsyNuhxdzeJJ30l6 XaSxksdBqboR9ifCHxyEisyY0rMqhADapgdYEHVGRMMkTrvKnUNWUC3zBYJz90VqwYXtGZvRPd45G zKcO7Pi3pwUKvtu0CiXIj11Q9QuOmco6QxNmUXlBYV7dgw8vT/HBRSU7K2WW0hb68rOocDDqDuJMw xm7nvwWA3RwyrF+QuAlDg3TYNy+a+EvfnmAkW/vLpEDzbpbVbPO/Uc0a9td1jGlVHqxAzSN+EzGsr /qCzaYHN3UPyAVQqmEqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFDIW-00000009vcp-1oRy; Thu, 06 Jun 2024 13:36:56 +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 1sFDIL-00000009vWa-4As5 for linux-arm-kernel@lists.infradead.org; Thu, 06 Jun 2024 13:36:48 +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 5060D15BF; Thu, 6 Jun 2024 06:37:08 -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 804AB3F792; Thu, 6 Jun 2024 06:36:43 -0700 (PDT) From: Luca Fancellu To: linux-arm-kernel@lists.infradead.org Cc: diego.sueiro@arm.com Subject: [boot-wrapper 7/7] aarch64: Start Xen on Armv8-R at EL2 Date: Thu, 6 Jun 2024 14:36:28 +0100 Message-Id: <20240606133628.3330423-8-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240606133628.3330423-1-luca.fancellu@arm.com> References: <20240606133628.3330423-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-20240606_063646_234692_5115FAC6 X-CRM114-Status: GOOD ( 11.38 ) 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. Additionally, don't permit the usage of hvc conduit when Xen kernel is passed, because it's not supported. Signed-off-by: Luca Fancellu --- Makefile.am | 1 + arch/aarch64/boot.S | 7 +++++++ configure.ac | 3 +++ 3 files changed, 11 insertions(+) diff --git a/Makefile.am b/Makefile.am index 34fbfb1f4ff8..bafce34682c3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -112,6 +112,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 b2b9863b8d6a..0b30b82ad6d9 100644 --- a/arch/aarch64/boot.S +++ b/arch/aarch64/boot.S @@ -88,6 +88,7 @@ reset_at_el2: cmp x0, 0xf bne reset_no_el3 +#if !defined(XEN) /* * Armv8-R AArch64 is found, check if Linux can be booted. * Check MSA_frac, bits [55:52]: @@ -107,6 +108,12 @@ reset_at_el2: mov w0, #SPSR_KERNEL_EL1 ldr x1, =spsr_to_elx str w0, [x1] +#else + /* Start XEN on Armv8-R at EL2 */ + mov w0, #1 + ldr x1, =flag_keep_el + str w0, [x1] +#endif cpuid x0, x1 bl find_logical_id diff --git a/configure.ac b/configure.ac index 44459a4c849e..a5175db4148a 100644 --- a/configure.ac +++ b/configure.ac @@ -95,6 +95,9 @@ AM_CONDITIONAL([PSCI_HVC], [test "x$USE_PSCI" = "xhvc"]) AS_IF([test "x$USE_PSCI" = "xno" -a "x$KERNEL_ES" = "x32"], [AC_MSG_ERROR([With an AArch32 kernel, boot method must be PSCI.])] ) +AS_IF([test "x$USE_PSCI" = "xhvc" -a "x$X_IMAGE" != "x"], + [AC_MSG_ERROR([With Xen kernel, PSCI conduit must be smc.])] +) AC_SUBST([PSCI_METHOD], [$USE_PSCI]) # Allow a user to pass --with-initrd