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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD325C433DB for ; Fri, 5 Feb 2021 12:07:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8588B64FCB for ; Fri, 5 Feb 2021 12:07:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231946AbhBEMHC (ORCPT ); Fri, 5 Feb 2021 07:07:02 -0500 Received: from marcansoft.com ([212.63.210.85]:50440 "EHLO mail.marcansoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232135AbhBEMCg (ORCPT ); Fri, 5 Feb 2021 07:02:36 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 7297B42056; Fri, 5 Feb 2021 12:01:48 +0000 (UTC) Subject: Re: [PATCH v6 05/21] arm64: Initialise as nVHE before switching to VHE To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: Mark Rutland , Jing Zhang , Prasad Sodagudi , Srinivas Ramana , Suzuki K Poulose , Catalin Marinas , Alexandru Elisei , James Morse , Ajay Patil , kernel-team@android.com, David Brazdil , Will Deacon , Ard Biesheuvel , Julien Thierry References: <20210201115637.3123740-1-maz@kernel.org> <20210201115637.3123740-6-maz@kernel.org> From: Hector Martin 'marcan' Message-ID: <1dbffcd4-5b20-404c-94af-c985a96785e2@marcan.st> Date: Fri, 5 Feb 2021 21:01:46 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210201115637.3123740-6-maz@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: es-ES Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/02/2021 20.56, Marc Zyngier wrote: > As we are aiming to be able to control whether we enable VHE or > not, let's always drop down to EL1 first, and only then upgrade > to VHE if at all possible. > > This means that if the kernel is booted at EL2, we always start > with a nVHE init, drop to EL1 to initialise the the kernel, and > only then upgrade the kernel EL to EL2 if possible (the process > is obviously shortened for secondary CPUs). Unfortunately, this is going to break on Apple SoCs, where it turns out HCR_EL2.E2H is hard-wired to 1 - there is no nVHE mode. :( >>> mrs(HCR_EL2) & (1<<34) 0x400000000 >>> msr(HCR_EL2, mrs(HCR_EL2) & ~(1<<34)) >>> mrs(HCR_EL2) & (1<<34) 0x400000000 -- Hector Martin "marcan" (marcan@marcan.st) Public Key: https://mrcn.st/pub