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 51BA7C43334 for ; Thu, 30 Jun 2022 16:06:36 +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: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:In-Reply-To:References: List-Owner; bh=SmS1oV8Mw/FEQxfv5kBOhJJYjRutrswwzAhM85Jo4kA=; b=V7BeiLBSlv6EkA 2OAOlfqwTO5FcDPaPmR1EekAXi11dcvFCLekAdl6E3/jEf4+/qRdiPliINveTc3iJIA3rYfT5hKG4 5uY6KaGGRMOJGvPymgMdmQGMReCsXiqRcDIbiiSJ3X9iSNsqTwCXaJaW0o/27QD0pzYgUBYlzT/8w vcfZLuH70XA1QgoKmjwb0FH9K8JGrQgwH5FYiWNun2wXkigjkgJeeCvVivG3GVuqrcRZavNpAJ2lD iZwufTfO0/NCkc5agk1IZ6ORmlTKKFC9B0oV192XdIysYSXFfZ150MWilXyPV9l9k/x+Z/0VG3HnH aQ7wl1atsEpddwDeve7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6wfX-000UxF-8w; Thu, 30 Jun 2022 16:05:27 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6wfT-000Utg-0I for linux-arm-kernel@lists.infradead.org; Thu, 30 Jun 2022 16:05:24 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CA7F861E90; Thu, 30 Jun 2022 16:05:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3182FC34115; Thu, 30 Jun 2022 16:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656605121; bh=oYaI3Ihvbmrwelk5NmO3pQuFqHqV+AIZkaF7DDlwQbk=; h=From:To:Cc:Subject:Date:From; b=deT1ByNpVpB+pEGjxNnEL9/bOoYDIuyaWXerMUbIeOq7o7EJdMxdNnJgJuS0cttHi WrC235SjxuCy6cjdHHyqjqvdt0jbAlqJYYvlFQnqT2JMG32DT/GJJIaKPfOlx7OkTt 3zC95Ek0RHTkw9ElCexWrq8b+YizWMiGeMg50I4IFXHS6bv+uFmI2e9nWb6HZCN4MQ p3F6mpX6hpwpk7Mbkv1W05zgFWOsJjlzlFk9jlbkrIb0lGVSEbgNjWM2UMg+H6OdJL MN7k/p7rZ/IdbFsTINTwnn8ZMCxpYYUatoKMD9T4ayXzb6jYmzomVc0m1f9/FhINlU xU8LLccMRr3Yw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1o6wfP-004OGk-3K; Thu, 30 Jun 2022 17:05:19 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Cc: Will Deacon , Catalin Marinas , Mark Rutland , Ard Biesheuvel , broonie@kernel.org, danielmentz@google.com, saravanak@google.com, kernel-team@android.com Subject: [PATCH v2 0/9] arm64: Disabling SVE/SME from the command-line Date: Thu, 30 Jun 2022 17:04:51 +0100 Message-Id: <20220630160500.1536744-1-maz@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, ardb@kernel.org, broonie@kernel.org, danielmentz@google.com, saravanak@google.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220630_090523_154150_63B12744 X-CRM114-Status: GOOD ( 16.04 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This very short series reworks the way arm64 CPUs boot (yes, again) in order to opt out of some features early at boot, on top of the existing VHE-forced-into-nVHE use case and using the same idreg override infrastructure. The main victim here is SVE, because it seems that people have all sort of broken firmware out there, and that a distribution kernel cannot boot on that. And since we have a dependency between SVE and SME, disabling the former also disables the latter. The only positive aspect about this series is that it unifies the way the VHE-stuck CPUs boot with way the full-fat CPUs do (everybody takes a trip to EL1 before coming back to EL2, instead of the stay-at-EL2 approach we currently have). A small victory, which allows us to control the EL2 setup code more easily. Note that the SME code is totally untested (I don't have a model with that), but it looks obviously correct ;-), and that my SVE "platform" has a working firmware... * From v1: - Fixed glaring bug spotted by Mark where CPTR_EL2 was never really written to... - Don't write the E2H tracking flag to memory, since Ard reworked the boot flow to avoid writing to RAM without the MMU on - Added an explicit way to disable FA64 independently from SME - Made the override code able to deal with arbitrary field widths to deal with FA64 (a single-bit field...) - Now rebased on top of arm64/for-next/boot Marc Zyngier (9): arm64: Rename the VHE switch to "finalise_el2" arm64: Save state of HCR_EL2.E2H before switch to EL1 arm64: Allow sticky E2H when entering EL1 arm64: Factor out checking of a feature against the override into a macro arm64: Allow the idreg override to deal with variable field width arm64: Expose a __check_override primitive for oddball features arm64: Add the arm64.nosme command line option arm64: Add the arm64.nosve command line option arm64: Add an override for ID_AA64SMFR0_EL1.FA64 .../admin-guide/kernel-parameters.txt | 6 + Documentation/virt/kvm/arm/hyp-abi.rst | 11 +- arch/arm64/include/asm/cpufeature.h | 3 + arch/arm64/include/asm/el2_setup.h | 60 ---------- arch/arm64/include/asm/virt.h | 11 +- arch/arm64/kernel/cpufeature.c | 12 +- arch/arm64/kernel/head.S | 43 +++---- arch/arm64/kernel/hyp-stub.S | 113 ++++++++++++++---- arch/arm64/kernel/idreg-override.c | 93 +++++++++++--- arch/arm64/kernel/sleep.S | 2 +- 10 files changed, 216 insertions(+), 138 deletions(-) -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel