From patchwork Tue Jul 16 14:29:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Fancellu X-Patchwork-Id: 13734558 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 360BDC3DA59 for ; Tue, 16 Jul 2024 14:31:27 +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=Eqxzabz0wwYTrZF5TJC5vlM43CBhbgHRKDk/6mspQFs=; b=uHiNDWxkxQ6pWPRmYNfvn7gqpM esNadVf68Gn8hU9ifNhJBoY1aiQkJGDa0Yzz87a/axSzqAMAQCxElZFBr7hEtACo00H69mdLd3ZGg RxVVqfvz7cRAVI2g5v4EVox7fwTMOnNjZj4JnPn53QFfQ3r/VH9X/7N1NGQTfcNlH0ddGDshr8yUU wZvjnuBxs6UsNt3OKxE78up46/1RYp6e8TPjpeDXvM2OLJthqJM/aCsgbcJXOvnC1sV3K5mfIRXtQ 7DNR0fKEYkC5F4lpGxduVTM4A6Oc05AeSPY5qZ3p4e52bEOM8Mnddiv4LEI2VWAGK1ji5DV9aIxcZ U4fsG2XQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTjCy-0000000AjGT-3Zij; Tue, 16 Jul 2024 14:31:12 +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 1sTjBI-0000000AiIe-1XcN for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2024 14:29:30 +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 54D761063; Tue, 16 Jul 2024 07:29:53 -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 600A03F762; Tue, 16 Jul 2024 07:29:27 -0700 (PDT) From: Luca Fancellu To: andre.przywara@arm.com, mark.rutland@arm.com Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 6/6] aarch64: Start Xen on Armv8-R at EL2 Date: Tue, 16 Jul 2024 15:29:06 +0100 Message-Id: <20240716142906.1502802-7-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240716142906.1502802-1-luca.fancellu@arm.com> References: <20240716142906.1502802-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-20240716_072928_475985_4C0A35DC X-CRM114-Status: GOOD ( 10.39 ) 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. Signed-off-by: Luca Fancellu --- v2 changes: - Don't write 1 on flag_keep_el since now the logic will jump to reset_no_el3 and write it there. - removed check for smc conduit when Xen is booted, change commit message. --- Makefile.am | 1 + arch/aarch64/boot.S | 2 ++ 2 files changed, 3 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 2a8234f7a17d..38ed4ed48985 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,7 @@ reset_at_el2: mov w0, #SPSR_KERNEL_EL1 ldr x1, =spsr_to_elx str w0, [x1] +#endif bl cpu_init_armv8r_el2