Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9095452pxu; Mon, 28 Dec 2020 06:31:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlq9Ox2Ahy0WGJ8kSyN5tg8jhybejDbPfoBis5cK2HtO5oeIU/q1FroNiqXJmRookqR8F9 X-Received: by 2002:a17:906:e250:: with SMTP id gq16mr40564439ejb.382.1609165901264; Mon, 28 Dec 2020 06:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165901; cv=none; d=google.com; s=arc-20160816; b=ODBdgJfMUVlTEjJNX6tOy8KUDkVsCu85WhKcJJbQg21lc8Z5c5aqj1Ho34v5t8W9rv vdyKy21KvFb8BJrQ/87fezXWMOy+LKJs0Rq7FxBA0dXAgV/u1xsCE/avg2cmaDsepX/O FYPxOSCvZ+JdQr1pZW7S5mmmImY7zbVcjC8ZOnCZfMY4waqCFJAMVaXT1z9s3j+dJWUK m7S5qX1ZAfqjw08YUIMomNqjC/dJ/lk2p9MJky6TkuJBC8OWLW6jWRT9SsuyVq2Zx7Eg PYpN0ZliMAemStZzGa7vTcYz6k639BLe6Qqllerv3mxAlogjtqNk6/WoVJnWH5mDuiFp a63A== 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=RdbUYUZB2n+DKjE2fGgGdfLtUlZkWuAtsEDvbeYu2oM=; b=fABTikbBdBubMf+9pCrrDJQeVy5ttdkri271SMdkYUzhy6H5HBEBEN/8OvBsjIhRzc urczA2279u335FUfVeHj8oaeDpk8Al7Q0ajAcjUy4/503RdNIQEkvown9razxUeky943 KNRLUO3DenbWUP6v5ccg8RZJqxB2DMh8wc4ErtHJnYpSPPqaoODhvvI2deG6YIoL9WKe zGuwCdGAIPqODvH3CwbsJ2R3K3ELfDeUFdbl7OLJf6Nq7qIsIJYd7K89xtk71hakWMxX ue5jW2NEc/u8yd7pVhEnyAqAtdNPJBoTO7MyJvZxsEU+rbt9MJcqsITwUfjXvjWRFGvq wGMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Oc1Nd6Bg; 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 h16si18745474ejt.260.2020.12.28.06.31.17; Mon, 28 Dec 2020 06:31:41 -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=Oc1Nd6Bg; 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 S2502535AbgL1O1w (ORCPT + 99 others); Mon, 28 Dec 2020 09:27:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:34872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502262AbgL1O1U (ORCPT ); Mon, 28 Dec 2020 09:27:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C73C4207B2; Mon, 28 Dec 2020 14:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165625; bh=YUvDYKl1YaQMAKEZb9Jty3IKzOJ0k5YRbzPmcB8eCt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oc1Nd6Bg2cjBDVwKcbXZHupxzfjs6MLEdyLJ/z3AX09Me1qJZR45wLeHkfGwyws4T qcbaMcxPEkJVZ8xMxb7ZA/yyubUHRdiLGKqa5FREYvEBYygORpHmypfv+9/W7W+pQe 0mO/RIFhoBGJ9eVAj8uZdqxdB5+FKo9AnZl3vy/8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Morse , Marc Zyngier Subject: [PATCH 5.10 597/717] KVM: arm64: Introduce handling of AArch32 TTBCR2 traps Date: Mon, 28 Dec 2020 13:49:55 +0100 Message-Id: <20201228125049.515721353@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 @@ -214,6 +214,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 @@ -1987,6 +1987,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 },