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 D5933C7EE2F for ; Fri, 9 Jun 2023 16:47:27 +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:References:In-Reply-To: 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: List-Owner; bh=Tk7rvRSXNDuY4CQDA7tNtqRa1jCkU8FLHkjly8uBpLM=; b=mHDAwlcfEYDgJ8 iNII2RtcjPRKZV8bSxvb1qutY0Hm4jGIsC2ZCb2cugfWalCuft1ICtq5lJ6qcstauTyCtomFA2dca BRD/2A6xkzHA+rBy0M61dTX0eY8lScOrXNDIuae6nrKtu2ZTgIK+bFgbc796b6c5w5WXslwv5oyPZ s7L4jcFiRAH6djbIw53OIOg39gvXRVc1l+rqV+3LAQWQb985tTTg6fJDc+FUtCgMCmC8I/qJIhMkO 0+oKFYYWPiutGTKJlRGHfwRJ+m0W0KlGhj/aosalupJXjZdb/eEHeGR0vW9m7s7mQdasdKVBvhVRT vbvnAmQGmoeUPFlFu5gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7fGN-00Ddyh-1j; Fri, 09 Jun 2023 16:46:59 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7fGH-00DdwH-2X for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2023 16:46:54 +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 5D252659EE; Fri, 9 Jun 2023 16:46:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6A85C4339B; Fri, 9 Jun 2023 16:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686329212; bh=gX1HEG+z9KW3eMtUvCzJlWpVp+Aform3r5YduMPqVos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dEiM5R/4aevEb4J/vFXcGdksREbX92Xqz/xlS/hTiGXfLIw2n3IupNYnRrKDdYXoi Bxmmbzsups8snvNWlGJcu8T8M3aEthhyNW5Hiid8MCZzpUe/9sEVGzml68N40H9rxk CvaW9JoTjinLFlSfrr2VuISzdea5FShkABCHhIXo95Vi5D80XTXpatf4OxpSBxwpQ9 I+13GDZlws4N0j0NM24Ig0DlwlXoHaJhAyUiTLRgC1tWL2D8um/PjATWZASRVzgYla ChmzI+bh55vTC2KRFuiIQqeRnq+cp4P+KQAglmEiV5gZAv++KEB65l6PYb4+lZ9SQw zpJ0QM+sx0neQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.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 1q7esM-0048L7-GV; Fri, 09 Jun 2023 17:22:10 +0100 From: Marc Zyngier To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Quentin Perret , Will Deacon , Fuad Tabba Subject: [PATCH v3 10/17] KVM: arm64: Force HCR_EL2.E2H when ARM64_KVM_HVHE is set Date: Fri, 9 Jun 2023 17:21:53 +0100 Message-Id: <20230609162200.2024064-11-maz@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230609162200.2024064-1-maz@kernel.org> References: <20230609162200.2024064-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, qperret@google.com, will@kernel.org, tabba@google.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-20230609_094653_865191_B1970321 X-CRM114-Status: GOOD ( 14.55 ) 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 Obviously, in order to be able to use VHE whilst at EL2, we need to set HCR_EL2.E2H. Do so when ARM64_KVM_HVHE is set. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/arm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 14391826241c..c12276dd2cf4 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -1676,6 +1676,8 @@ static void __init cpu_prepare_hyp_mode(int cpu, u32 hyp_va_bits) params->hcr_el2 = HCR_HOST_NVHE_PROTECTED_FLAGS; else params->hcr_el2 = HCR_HOST_NVHE_FLAGS; + if (cpus_have_final_cap(ARM64_KVM_HVHE)) + params->hcr_el2 |= HCR_E2H; params->vttbr = params->vtcr = 0; /* -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel