Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp821324pxb; Tue, 3 Nov 2020 13:30:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJq4HDqXBmxqIGgF7fcJcscV5gd3rVqayayUdVKDbCHRYRELXn+s3ZtS8jHgBDspUiFtJs X-Received: by 2002:a50:e705:: with SMTP id a5mr23945712edn.29.1604439025751; Tue, 03 Nov 2020 13:30:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439025; cv=none; d=google.com; s=arc-20160816; b=kQtCuXc9V12z4Nbt2f1y0HRdtr6fEeec2yPeGv4WUqW29eFnEkLoomA5w2B0gxYZ+1 gAKEIuiA8aqitXMf5fkKDgmMu6gTubHZcuvqcVj8ISd1BVcWdCgIkVmsvlrYvNEIetQT Ia7vrSZ82T9ohKV+VhdYR7haDEqf53HEPztwut3PcU/LffKbL/ukS2V3XI6R8UvS1ij/ 1Oz7wC5g/8onKWOj8l9NVTViKhEJZXGTcxAAcqTRisAgA05UJi3CW2CXpiQGIsXln1GK qjOLNI3CFRoZhS5EiO4wYGdCvH9XtnvHxv+BtS80hPNFRAGLLrWMN9V6wvEqmgJg2Xqg mdjQ== 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=41vZcMrponsahOSLjtcumgkQsA2ZoBrKxDCeQiqziWQ=; b=eeZurv4wHvIdoN+/C0UYAQP6aL7jLIAWV1cRLbN1M+jTQffPBPkE22+VYSYVDcYtl3 E/KDhYaTGLvxSHwfM6MkzbTqaJqveSUVSjorTQ8SHtD8jsRbqNhcyR6xenfAS2MRFrh9 nOJSw4eKENA62avKjTPctXQpDUhsMU4WOm9Qt3KYriQinL5+blho0i8P7rm7+C0+xoca RlKLh/nrRyaQ1RIsEWoo/b5T7+rqwv/ty6NVO89J+bG4u+UIaAKgBa2bRensOct+p/gH RUiLnl8fQKo9uBRTH3q8HSBDYvpx+YjC9nFYWQooCgLp0Ci5AYfOD6mABPvmiNEWeGoj lBxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wKgMlpn9; 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=fail (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 bk9si13636ejb.42.2020.11.03.13.30.02; Tue, 03 Nov 2020 13:30:25 -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=@kernel.org header.s=default header.b=wKgMlpn9; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732408AbgKCV1Z (ORCPT + 99 others); Tue, 3 Nov 2020 16:27:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:36794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733281AbgKCVAq (ORCPT ); Tue, 3 Nov 2020 16:00:46 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4A0A32053B; Tue, 3 Nov 2020 21:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437245; bh=7/hHWmELrywRyUTfND9I6MH97zefn481LNViXn29u3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wKgMlpn9+dfgg+omjX6KmcdtfzkDSsy8WgeRVox9u+DJjl0SMq7BZG6/Tvtl4qXnM E+iyzLY185CnRi3TRx3/nyXwiJ9DVcS153vQLAgpocBMqeBWS62O0prrSjEbeQnkgZ zudFuAppPMHQvNCLoseRtt+FU225hpXPuirvuO2s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier Subject: [PATCH 5.4 209/214] KVM: arm64: Fix AArch32 handling of DBGD{CCINT,SCRext} and DBGVCR Date: Tue, 3 Nov 2020 21:37:37 +0100 Message-Id: <20201103203310.183833763@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@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 4a1c2c7f63c52ccb11770b5ae25920a6b79d3548 upstream. The DBGD{CCINT,SCRext} and DBGVCR register entries in the cp14 array are missing their target register, resulting in all accesses being targetted at the guard sysreg (indexed by __INVALID_SYSREG__). Point the emulation code at the actual register entries. Fixes: bdfb4b389c8d ("arm64: KVM: add trap handlers for AArch32 debug registers") Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20201029172409.2768336-1-maz@kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/kvm/sys_regs.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -209,6 +209,7 @@ enum vcpu_sysreg { #define cp14_DBGWCR0 (DBGWCR0_EL1 * 2) #define cp14_DBGWVR0 (DBGWVR0_EL1 * 2) #define cp14_DBGDCCINT (MDCCINT_EL1 * 2) +#define cp14_DBGVCR (DBGVCR32_EL2 * 2) #define NR_COPRO_REGS (NR_SYS_REGS * 2) --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1746,9 +1746,9 @@ static const struct sys_reg_desc cp14_re { Op1( 0), CRn( 0), CRm( 1), Op2( 0), trap_raz_wi }, DBG_BCR_BVR_WCR_WVR(1), /* DBGDCCINT */ - { Op1( 0), CRn( 0), CRm( 2), Op2( 0), trap_debug32 }, + { Op1( 0), CRn( 0), CRm( 2), Op2( 0), trap_debug32, NULL, cp14_DBGDCCINT }, /* DBGDSCRext */ - { Op1( 0), CRn( 0), CRm( 2), Op2( 2), trap_debug32 }, + { Op1( 0), CRn( 0), CRm( 2), Op2( 2), trap_debug32, NULL, cp14_DBGDSCRext }, DBG_BCR_BVR_WCR_WVR(2), /* DBGDTR[RT]Xint */ { Op1( 0), CRn( 0), CRm( 3), Op2( 0), trap_raz_wi }, @@ -1763,7 +1763,7 @@ static const struct sys_reg_desc cp14_re { Op1( 0), CRn( 0), CRm( 6), Op2( 2), trap_raz_wi }, DBG_BCR_BVR_WCR_WVR(6), /* DBGVCR */ - { Op1( 0), CRn( 0), CRm( 7), Op2( 0), trap_debug32 }, + { Op1( 0), CRn( 0), CRm( 7), Op2( 0), trap_debug32, NULL, cp14_DBGVCR }, DBG_BCR_BVR_WCR_WVR(7), DBG_BCR_BVR_WCR_WVR(8), DBG_BCR_BVR_WCR_WVR(9),