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 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 ACDE8C433DB for ; Fri, 5 Feb 2021 14:05:29 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 1DFD164FCC for ; Fri, 5 Feb 2021 14:05:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DFD164FCC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=marcan.st Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 919444B3EF; Fri, 5 Feb 2021 09:05:27 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CzYF3mUpcaqF; Fri, 5 Feb 2021 09:05:25 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 83E634B3E1; Fri, 5 Feb 2021 09:05:25 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 349084B3CB for ; Fri, 5 Feb 2021 07:01:57 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8gm9n8Qnw9pG for ; Fri, 5 Feb 2021 07:01:54 -0500 (EST) Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id A91854B390 for ; Fri, 5 Feb 2021 07:01:54 -0500 (EST) 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 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-Language: es-ES X-Mailman-Approved-At: Fri, 05 Feb 2021 09:05:24 -0500 Cc: kernel-team@android.com, Srinivas Ramana , Catalin Marinas , Ard Biesheuvel , Will Deacon , Ajay Patil , Prasad Sodagudi X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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 _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 3673BC433DB for ; Fri, 5 Feb 2021 12:03:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BAD3964E05 for ; Fri, 5 Feb 2021 12:03:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAD3964E05 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=marcan.st Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LXOsTntLIVbXRxBDbiDNqDIOUTcA3c3ao2olZe/1axc=; b=TKPdYy/NQpAUnlLiDZF8NS1O5 EJSkkPZMon4CHm0HWvFYGmPMenCHlVfTK0HpZG9tXgMmibPjS1A2Ke3hOqvK1a8N5PSIiqIERhFRR 4GF6XmwQDRis16P+UjjxoaCV6sCMEyRRs6nQgw+dXNXRcXTA92nFKf12Qos31ccwiM2mRYAgDzVEZ 64LxDzc4cgn7SbjPzidz2nKhfCon4qsHSg6ceea/Z/Pv3jhMIa+EDOd1ldfSeNFSj5mK1px5X4wYd 1P60/9dnO3w8v243Wf5GBJtoaknrqmZ9XMARKLZXNcYM2GvqFW8c2yo16r/S4xpuZtG3m9C/WP+c0 AXAPw/NSQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7zoD-0002Fh-MK; Fri, 05 Feb 2021 12:01:57 +0000 Received: from marcansoft.com ([212.63.210.85] helo=mail.marcansoft.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7zoA-0002FL-O1 for linux-arm-kernel@lists.infradead.org; Fri, 05 Feb 2021 12:01:56 +0000 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 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-Language: es-ES X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_070154_922218_CC8FE588 X-CRM114-Status: GOOD ( 14.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Jing Zhang , kernel-team@android.com, Srinivas Ramana , Suzuki K Poulose , Catalin Marinas , Ard Biesheuvel , Will Deacon , James Morse , Ajay Patil , Prasad Sodagudi , Alexandru Elisei , David Brazdil , Julien Thierry Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel