Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9231539pxu; Mon, 28 Dec 2020 09:58:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyl7PNQHJ7ADzlVM3I0wGKdM4lIgJZ5aRgtI2F6EZSal8gJ3UGtskn8L4JzOAA9ObO7rIsq X-Received: by 2002:a05:6402:3546:: with SMTP id f6mr19595105edd.242.1609178302105; Mon, 28 Dec 2020 09:58:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609178302; cv=none; d=google.com; s=arc-20160816; b=Z8Vk1zO4RntDuoXeYNtQqD4c6oFgh8vmbFaAP0maYBHAxFLFwE2YEhdBrPr94qhZ7N IZyotvJ9amZZdWz5aE1RPagAa/m55a7fQUdWPLLuC5PAPet8PxPfhx76jjNsi4juBs4l EtuuKfzNXnLfKLAeoSFxb38qC5CDlnet15+5+ZupyDkx3YfYbY4r2h9z7FvYh/iAL4HR YW4dRjZBqFNJmhBBoe15Tu1bIzYtIj49BK0ao/M5ExeQ/uREDvRk0z3t8JlbJMryR1yK 3nldAznvH4pX/M4Hr5V4R5T6WvNwl95jQfmJDFaKMunjchB6g7Uh5RYcqEctKsvOriqU RtCw== 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=6AzHfO+xGNseUaPGOgQV/sLxnS3GvIjjQLDtLq75emo=; b=K664IRmIE1atGtfs02jAA/C8n9YUGJ33XXDv2yT6+FpfXXG0bbqIRwLOQ/tbdkYFJN 42o8JocNzDFKrra7mgy9232DQFQmJoLAj6HP6H9tSDIoC6A84o4fOM0F5jdv1UDsEAq9 N1SXVKHmp/UFXWh+7z6XtSg3xyk2XM/e3m4RWOj+zFHcDKDuMwvfCwKPUR03LTcxPmUy Hem3gDVfO+qYr3HUuf05apm9+YwUAvrNGt/5sdBbH+/syX6HvpDirKOI8P6rAErBDvVL CnniB4FUaUkO8cfI4nsUPRxE1FJ/YHROpOzfFRB3xL7nK1FL0MP2Y4bhUPUlqPY3EDqz DyaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rAx0iyVW; 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 gf2si13034143ejb.154.2020.12.28.09.57.59; Mon, 28 Dec 2020 09:58:22 -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=rAx0iyVW; 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 S1733055AbgL1NTW (ORCPT + 99 others); Mon, 28 Dec 2020 08:19:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:47926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733023AbgL1NTS (ORCPT ); Mon, 28 Dec 2020 08:19:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E5650208BA; Mon, 28 Dec 2020 13:18:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161517; bh=CyLpaegTezDKg5h28YKOQECTFbI0IVQUAWUYwAU9eI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rAx0iyVW/llqNa+FOCnl9caZWjIUOBFMXMVnk4D4iFVlzF3NkQykpocdzBJ8unQiQ /n7WN9H+Q1JbCsQqqX5kUToszytX1x9nao8VGeIDaVV2f1hw6qh5BE0Amq+8ZC340O N4L3OuGHFB99IS8dOr8ZUl+oCazsr9ejTfDdCIes= 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.14 210/242] KVM: arm64: Introduce handling of AArch32 TTBCR2 traps Date: Mon, 28 Dec 2020 13:50:15 +0100 Message-Id: <20201228124915.009802482@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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 @@ -158,6 +158,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 @@ -1286,6 +1286,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 },