From mboxrd@z Thu Jan 1 00:00:00 1970 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 B8EEAC3DA7E for ; Tue, 30 Jul 2024 12:56:33 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GzyAhO18RG6T1l1Z2fG5pJTcv+DI29aFx/xP32ymwgM=; b=LQ1US1vh6KZynp5Vc8MvoHj93m 1LpVOpBKCNvw9xliygPlgcC2jbo1TRB6GOg+loMogxSu/k4LKLN28uhnLlp280iYdsOtw5coxVweV hxiFBVvfO0jkvVgDcZQPBwBgSwF6Lgp32BkXrH41K7PlCocPYvnc5v5/tq33DzxBsWsu1sNdF3RH2 7928DNcgR5iIIPkjySDNTrceK/Ik3UyU7u/SYJIAdKgFHwlaJ2QDgCkLncqNTZpwMR7zRzJbACcpD W//1yMwt69QFZTa5WqJU5kBcUu2KKjdJVld/1WyV/AKRu7yUz80GnZ8gFIN/GtyxCjifziLrxRTQR vd5LXzaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYmOu-0000000FBph-1vCK; Tue, 30 Jul 2024 12:56:24 +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 1sYmOS-0000000FBhr-1qIK for linux-arm-kernel@lists.infradead.org; Tue, 30 Jul 2024 12:55:58 +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 6533F1007; Tue, 30 Jul 2024 05:56:19 -0700 (PDT) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 03EC93F5A1; Tue, 30 Jul 2024 05:55:52 -0700 (PDT) Date: Tue, 30 Jul 2024 13:55:47 +0100 From: Mark Rutland To: Luca Fancellu Cc: Andre Przywara , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v2 5/6] aarch64: Support PSCI for Armv8-R AArch64 Message-ID: References: <20240716142906.1502802-1-luca.fancellu@arm.com> <20240716142906.1502802-6-luca.fancellu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_055556_592955_A1FD1799 X-CRM114-Status: GOOD ( 21.31 ) 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 On Tue, Jul 30, 2024 at 12:31:14PM +0100, Luca Fancellu wrote: > Hi Mark, > > >> - > >> -AS_IF([test "x$USE_PSCI" != "xyes" -a "x$KERNEL_ES" = "x32"], > >> + [case "${enableval}" in > >> + yes|smc) USE_PSCI=smc ;; > >> + hvc) USE_PSCI=hvc ;; > >> + no) ;; > >> + *) AC_MSG_ERROR([Bad value "${enableval}" for --enable-psci. Use "smc" or "hvc"]) ;; > >> + esac]) > >> +AM_CONDITIONAL([PSCI], [test "x$USE_PSCI" = "xyes" -o "x$USE_PSCI" = "xsmc" -o "x$USE_PSCI" = "xhvc"]) > >> +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.])] > >> ) > >> +AC_SUBST([PSCI_METHOD], [$USE_PSCI]) > > > > As of this patch, if I build with --enable-psci=hvc, and boot on > > ARMv8-A, it'll fail at boot time, since the boot-wrapper won't fix up > > the SPSR (and will enter the kernel at EL2), and HVC will go to that > > kernel. > > > > I think that we either need to add support for dropping to EL1 in > > ARMv8-A, or we should have an option to build for ARMv8-R specifically, > > where we can automatically fix up the PSCI conduit. > > True, maybe the best option is to have a flag to build for armv8r? I think so. > Would --armv8r64 be ok? > > The behaviour would be: > --armv8r64 without XEN -> starting at EL2 only, setting conduit to hvc, psci_vector to VBAR_EL2, drop to EL1 and start kernel > --armv8r64 with XEN -> starting at EL2 only, psci not supported, keep xen at EL2 That sounds good. If you can sort out the logic for that, we can change the option name later if we want. That will have to interact with --enable-aarch32-bw and --enable-aarch32-kernel, so maybe it's worth having a single option to select the boot-wrapper architecture, e.g. --bw-arch=${PARAM} that takes: * "aarch64-a" // default today * "aarch32-a" // replaces --aarch32-bw * "aarch64-r" // For armv8r64 Note I've used "aarch64" since we already have ARMv9-A bits. Mark. > > Cheers, > Luca >