From patchwork Fri Dec 20 14:30:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Murray X-Patchwork-Id: 182290 Delivered-To: patch@linaro.org Received: by 2002:a92:1f98:0:0:0:0:0 with SMTP id f24csp611046ilf; Fri, 20 Dec 2019 06:34:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxUYWcdO0wcFRdaxOeWkDzu3fBbs0F5+Fi62dhk9qiyrobxOIs7LX+v9BRxtAFbRh3VcnKt X-Received: by 2002:aca:ec4f:: with SMTP id k76mr1632567oih.156.1576852485255; Fri, 20 Dec 2019 06:34:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576852485; cv=none; d=google.com; s=arc-20160816; b=JI3hjmLTI04tVKYvFhJHxOPwPu92aiQz47PWxLlEpxZMuY+XSLs+vzw45hOSZYOHV3 QCjCc8bzf3eO7e2t9/u9KnZujWyxTwEXHqKV5Ja6NliXoPJycdq1TtqmeAx92A3okVSe KOlLSgTvhTZx1mWRIfndAAq1cDUM5fNwEI+UBKvFKSW4O8V0VlwDxy3R8DQ0Tti/+9Az 2SA0h2u20nCiS65hJ5tx1/F6H4g7Uiw8/HT8h7M46W3WrtgwdxaNTRTKJWR7QL2JHQOq 05IbFNFc7ymdH3iZ4FoNtj9V5SmfYdYIfalZ4LMuTzxJIr1Q9jcHgJvFDQsngrjJyveC LzWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tyXcipWvSgJKvjvVdDvo593Z3XPmHSDMoXkO3Ii76Qg=; b=gxWkOUdchMkAwG875IAfqyiQuNr5/xC/6m7Ma0Orhpm2SQE5UHBf7z9BTo2CpJNZXS 4lVsgsfvhX13o9zs0xCdLp+dk0Sw4j75qPFZOXOdVUAEeJrPsd3MLb2OK7gopv0pkRiE 2F1HQqEXLKGQP79Z81Z1fGA04T6l/KhRh4opxNy2DYKrHp5QbnttY49SMLUaLMQIBURK 2XZWTKprfUNV0gWnO3VF+X9yPr9guQus+57QHYufV/aHqVwpIEBQi7azhdFhLjUxMnt0 JDnaKNOgT4v5L2xNGX75czp2DS9CQZpsOvCFuQgi9T80lfwHc7aY4cDnKDEg1Z/L2RUC yelg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w64si4972237oib.185.2019.12.20.06.34.45; Fri, 20 Dec 2019 06:34:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728193AbfLTOca (ORCPT + 27 others); Fri, 20 Dec 2019 09:32:30 -0500 Received: from foss.arm.com ([217.140.110.172]:51282 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727946AbfLTOay (ORCPT ); Fri, 20 Dec 2019 09:30:54 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3A33711D4; Fri, 20 Dec 2019 06:30:54 -0800 (PST) Received: from e119886-lin.cambridge.arm.com (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 61B7D3F718; Fri, 20 Dec 2019 06:30:52 -0800 (PST) From: Andrew Murray To: Marc Zyngier , Catalin Marinas , Will Deacon Cc: Sudeep Holla , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland Subject: [PATCH v2 10/18] arm64: KVM/debug: use EL1&0 stage 1 translation regime Date: Fri, 20 Dec 2019 14:30:17 +0000 Message-Id: <20191220143025.33853-11-andrew.murray@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191220143025.33853-1-andrew.murray@arm.com> References: <20191220143025.33853-1-andrew.murray@arm.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sudeep Holla Now that we have all the save/restore mechanism in place, lets enable the translation regime used by buffer from EL2 stage 1 to EL1 stage 1 on VHE systems. Signed-off-by: Sudeep Holla [ Reword commit, don't trap to EL2 ] Signed-off-by: Andrew Murray --- arch/arm64/kvm/hyp/switch.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.21.0 diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c index 67b7c160f65b..6c153b79829b 100644 --- a/arch/arm64/kvm/hyp/switch.c +++ b/arch/arm64/kvm/hyp/switch.c @@ -100,6 +100,7 @@ static void activate_traps_vhe(struct kvm_vcpu *vcpu) write_sysreg(val, cpacr_el1); + write_sysreg(vcpu->arch.mdcr_el2 | 3 << MDCR_EL2_E2PB_SHIFT, mdcr_el2); write_sysreg(kvm_get_hyp_vector(), vbar_el1); } NOKPROBE_SYMBOL(activate_traps_vhe); @@ -117,6 +118,7 @@ static void __hyp_text __activate_traps_nvhe(struct kvm_vcpu *vcpu) __activate_traps_fpsimd32(vcpu); } + write_sysreg(vcpu->arch.mdcr_el2 | 3 << MDCR_EL2_E2PB_SHIFT, mdcr_el2); write_sysreg(val, cptr_el2); if (cpus_have_const_cap(ARM64_WORKAROUND_1319367)) {