Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9177550pxu; Mon, 28 Dec 2020 08:30:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOGvs3EyjMZ7E+FStOrvilmD604l5ABPBCgZHAzNRCsFNzv0FLqlzny3pJUijdmVpi6Zpb X-Received: by 2002:aa7:d75a:: with SMTP id a26mr41638098eds.230.1609173029262; Mon, 28 Dec 2020 08:30:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173029; cv=none; d=google.com; s=arc-20160816; b=IzS4S2CQU70qbif6AtF0w7kF+HFlkQbBxKQr8oInem1LJeB0+Wa9w3gsTYqdYUEG1c k69qkkBJS55b054VNZmRgPMuhmJxlcSws1sQB5hOCeIpdyaqoBMlaM+uFUQA0H402XgB zTeZgEW2RoJhlGXoefrK4G2iilsyLKZby+QBSZY7dARp1DAhxKA+7++MAXuL2rmbIs9V jVzEzoGfAEUyvNl5Mr/dCClK3LQMZ6ny08PRJd6fgFWOMJYEJp3v06GumY5fgXaciwQ5 rpoim4qyU3fue3Gd7MTgCwhORxLKF3umgxEBaqOg+kdDKtwqpUc/G40baLxdTAXlUj91 ZoXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CAt1H3fx5R6oxpdziuYJ/J6Nq7pD/SmnjTc6D7DV4pA=; b=G6MKSycpSHazQrtLFJMVVtAau3DQvYctnGL6VpkYd+XzjbPCRy1OW4ugD+IV8XC8E5 dTbdvQ1xoEXwZ3Jah/HYeBevDWuWo/4oFAb+vQQWU4FLp48IpkqbTOpZJ/I8yEk5fXhO wN69F9JC4vhG7tpYIszCAPXq4nw4JFASDCKMDRtIrHGRvzRLiu8QQSNQ2Ntp1zAirvYJ fUru9POc/Zc2aWosjuEw+X884b6e4/V+Lew4gWYOrRCyK//Xu8Hgu11/fi08080JdZjW ibd1N4lHIqGn92C1nZXpBtTpTGoq/ZBwKI51oomXWSK4WvQpwNXAWwm9oIYc8bVvtN7S Nz3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="O2v/CAwt"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n23si18497548ejr.321.2020.12.28.08.30.06; Mon, 28 Dec 2020 08:30:29 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="O2v/CAwt"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730689AbgL1NHs (ORCPT + 99 others); Mon, 28 Dec 2020 08:07:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:33828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729611AbgL1NHG (ORCPT ); Mon, 28 Dec 2020 08:07:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2C03B22A84; Mon, 28 Dec 2020 13:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160810; bh=8IpST3YWY9g+hvQ29iTwf0Kvvry1FujK/Ij3tEVZcGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O2v/CAwtLGzhOlD+q2TQ1B6X09yAIkmTg5sPVZGNFwZtl4uZmtAO2qMLawbqY6Ibg I5f69VwIBYYEtvaJVBZu5Oyyi43Aa0LRlc4FqVk348I9/PA7p993PIBEtEKzCzrTRb zHZCgJ8ZOtfrcctz7Q75j7ciUo2TA1u+8YWtJKcc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Morse , Marc Zyngier Subject: [PATCH 4.9 156/175] KVM: arm64: Introduce handling of AArch32 TTBCR2 traps Date: Mon, 28 Dec 2020 13:50:09 +0100 Message-Id: <20201228124900.805414269@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Zyngier commit ca4e514774930f30b66375a974b5edcbebaf0e7e upstream. ARMv8.2 introduced TTBCR2, which shares TCR_EL1 with TTBCR. Gracefully handle traps to this register when HCR_EL2.TVM is set. Cc: stable@vger.kernel.org Reported-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/kvm/sys_regs.c | 1 + 2 files changed, 2 insertions(+) --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -161,6 +161,7 @@ enum vcpu_sysreg { #define c2_TTBR1 (TTBR1_EL1 * 2) /* Translation Table Base Register 1 */ #define c2_TTBR1_high (c2_TTBR1 + 1) /* TTBR1 top 32 bits */ #define c2_TTBCR (TCR_EL1 * 2) /* Translation Table Base Control R. */ +#define c2_TTBCR2 (c2_TTBCR + 1) /* Translation Table Base Control R. 2 */ #define c3_DACR (DACR32_EL2 * 2)/* Domain Access Control Register */ #define c5_DFSR (ESR_EL1 * 2) /* Data Fault Status Register */ #define c5_IFSR (IFSR32_EL2 * 2)/* Instruction Fault Status Register */ --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1315,6 +1315,7 @@ static const struct sys_reg_desc cp15_re { Op1( 0), CRn( 2), CRm( 0), Op2( 0), access_vm_reg, NULL, c2_TTBR0 }, { Op1( 0), CRn( 2), CRm( 0), Op2( 1), access_vm_reg, NULL, c2_TTBR1 }, { Op1( 0), CRn( 2), CRm( 0), Op2( 2), access_vm_reg, NULL, c2_TTBCR }, + { Op1( 0), CRn( 2), CRm( 0), Op2( 3), access_vm_reg, NULL, c2_TTBCR2 }, { Op1( 0), CRn( 3), CRm( 0), Op2( 0), access_vm_reg, NULL, c3_DACR }, { Op1( 0), CRn( 5), CRm( 0), Op2( 0), access_vm_reg, NULL, c5_DFSR }, { Op1( 0), CRn( 5), CRm( 0), Op2( 1), access_vm_reg, NULL, c5_IFSR },