Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1888618pxb; Fri, 5 Feb 2021 04:08:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFLUFxa6k3Zc6N/CDS1qWNAGbBrMkFxNhXW8YuXB5RLWJESdpQ8oJlvtQ85HZ1ISy4F4OP X-Received: by 2002:a50:a684:: with SMTP id e4mr3203373edc.148.1612526886914; Fri, 05 Feb 2021 04:08:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612526886; cv=none; d=google.com; s=arc-20160816; b=DsReA+aaPIiKE6bYPlT2SLs3wPgyu40zRKX2y9djQOtVD+1Vr+KYwaGldg0zeX4mia ir9EOIQDjY2XRrx5YYJHa99+9WMlTwaYTyj5AduFnWn8J3adZFBOfgt3eDR+cY9Pizgh 3iMd/eSuENizt1F77P82ssgqV3bI/k9dnDkdCYLVbU/etWON+xgyatjrZJQKecuEzrd1 1NpIP4CNJ0jR9JB5TVdyx1F069PJ1nx1Re6yvbUIlYRig4z/vC2jA/ihSU1FvUtYxDea H99MAa02v/7vCGsr5vwl4TElZROtTSPIN8QrgHK0Wl95neUxo3Wi1V9r9sldDXY+Q+Np M8og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=2IshIxn+UBlKbEZ4jZNNAT/foAakHyR3TpJOTuVWN30=; b=zCBga5mD8uiM+ZSrI1RoiOGMfMrc5ZU/al8iZVNot9K/EijSgQ2mDdQXNJ/+4yspkX eD1VQ3z9F63VJ+ISckgyTeWQW59PhQZjTeTVugOqF+l9Ps9rgE5Kol5p2j/iC+aU/evs AGTWTQVHwNGA18iFDbIG+6tFHWLdHLHB4vJ7hjLagrkK/4y1zekK1AaoCzxC3xbMh/mF 42tNIHprPyTA/KXyLHy3L61tRDPCTfunoysrYVJBpRje/8KnUYWeqYkT/ozGT43Y/53L LdioZ6s17QLjDNeGS2u+npzSo2WavYdaa9+9kfeO3tJ4KgA5UvAx14YYOtBO47xbzgKX xrjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si90172edh.270.2021.02.05.04.07.40; Fri, 05 Feb 2021 04:08:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231303AbhBEMGT (ORCPT + 99 others); Fri, 5 Feb 2021 07:06:19 -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