Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp502126pxf; Wed, 31 Mar 2021 08:39:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwAzwg2377x2JbjNO85K946sEibZF7/kilGVgi+IHt8JF5R5/3aceIOkyzkvaWIg6v90Jq X-Received: by 2002:a17:907:2d9f:: with SMTP id gt31mr4108060ejc.233.1617205161794; Wed, 31 Mar 2021 08:39:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617205161; cv=none; d=google.com; s=arc-20160816; b=Gz6psvw3eKg/7TuZuG9/VSLFBylh3LqMnBCi5ik8BqNw/gzogu6K/ePfAsqU/wZX2M EmfeNOAHpqEq7IQQhgOMgq/nZsrkzjAqsGS+wyRq6N0Uy9Q/tCfElyGhrUnc4XXpff92 Ym0iiXm+cdQt1e3S4c7EMXs3w/UtMssuJVt+u6+k3+E7N/X9hjixdCsaBWruWPHqeoaP 6afFFtDGIWLLu9e1VdYbJAy5mdJfNhEIwe8KmrM/cu0OfukVarEdzRfi9IilKEkEu3vq C5+73m+zioVq6IYqpsE1bCCowdCdwRQRrASATDoN6zanSTOnmscvZh1hGgbSqeulJG8y /o9Q== 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:subject:cc:to:from:message-id :date; bh=Ca/9jqD/cMrWl2uVkRSLQ461VsPWIu1oVND/OIC6Tyw=; b=ZOa79u5RO+2NqD/tEsNG6ZRY3u0qEhPVJQfi35/TA8UlyQVXREjQwCz/Nvc5h3k6wc jB0Xjz+TFOJENJVdHftWvnbAhS+ijF+OOjxl2pHzg1vubNFS4VUXhMi+8+w9fKMMa49r s1aExIpw3Avf5+zboX6nvrIOJj9jfnO1sIKWrtsJzMSJZHPtmRdRB3opylUUKE3ZC/Mp 5YSeH445m8+lTu4AdeFBa4ORC0ks6lgGbBq7BAk09Vz0JeOmqQJgsu8Hj1u8zBuFyqpE HOW5BChEZZiTmRuYvTkiAYnHd1rXXtdJqnAhzsK70nA8kha8t9MrsSVGe3BxW4urfl8O YWjA== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b26si1878590eja.162.2021.03.31.08.38.57; Wed, 31 Mar 2021 08:39:21 -0700 (PDT) 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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235965AbhCaPiC convert rfc822-to-8bit (ORCPT + 99 others); Wed, 31 Mar 2021 11:38:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:60100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235683AbhCaPhg (ORCPT ); Wed, 31 Mar 2021 11:37:36 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 0DB5861019; Wed, 31 Mar 2021 15:37:36 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lRcuU-004vnX-5m; Wed, 31 Mar 2021 16:37:34 +0100 Date: Wed, 31 Mar 2021 16:37:33 +0100 Message-ID: <871rbvqqpu.wl-maz@kernel.org> From: Marc Zyngier To: Alexandru Elisei Cc: Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, anshuman.khandual@arm.com, catalin.marinas@arm.com, Will Deacon , Mark Rutland Subject: Re: [PATCH v5 07/19] arm64: kvm: Enable access to TRBE support for host In-Reply-To: References: <20210323120647.454211-1-suzuki.poulose@arm.com> <20210323120647.454211-8-suzuki.poulose@arm.com> <87r1jxq7ax.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: alexandru.elisei@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, anshuman.khandual@arm.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 31 Mar 2021 16:28:46 +0100, Alexandru Elisei wrote: > > Hello, > > On 3/30/21 12:12 PM, Suzuki K Poulose wrote: > > Hi Marc > > > > On 30/03/2021 11:12, Marc Zyngier wrote: > >> Hi Suzuki, > >> > >> [+ Alex] > >> > >> On Tue, 23 Mar 2021 12:06:35 +0000, > >> Suzuki K Poulose wrote: > >>> [..] > >> > >>>   #define MDCR_EL2_TTRF        (1 << 19) > >>>   #define MDCR_EL2_TPMS        (1 << 14) > >>>   #define MDCR_EL2_E2PB_MASK    (UL(0x3)) > >>> diff --git a/arch/arm64/include/asm/kvm_host.h > >>> b/arch/arm64/include/asm/kvm_host.h > >>> index 3d10e6527f7d..80d0a1a82a4c 100644 > >>> --- a/arch/arm64/include/asm/kvm_host.h > >>> +++ b/arch/arm64/include/asm/kvm_host.h > >>> @@ -315,6 +315,8 @@ struct kvm_vcpu_arch { > >>>           struct kvm_guest_debug_arch regs; > >>>           /* Statistical profiling extension */ > >>>           u64 pmscr_el1; > >>> +        /* Self-hosted trace */ > >>> +        u64 trfcr_el1; > >>>       } host_debug_state; > >>>         /* VGIC state */ > >>> diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S > >>> index 5eccbd62fec8..05d25e645b46 100644 > >>> --- a/arch/arm64/kernel/hyp-stub.S > >>> +++ b/arch/arm64/kernel/hyp-stub.S > >>> @@ -115,9 +115,10 @@ SYM_CODE_START_LOCAL(mutate_to_vhe) > >>>       mrs_s    x0, SYS_VBAR_EL12 > >>>       msr    vbar_el1, x0 > >>>   -    // Use EL2 translations for SPE and disable access from EL1 > >>> +    // Use EL2 translations for SPE & TRBE and disable access from EL1 > >>>       mrs    x0, mdcr_el2 > >>>       bic    x0, x0, #(MDCR_EL2_E2PB_MASK << MDCR_EL2_E2PB_SHIFT) > >>> +    bic    x0, x0, #(MDCR_EL2_E2TB_MASK << MDCR_EL2_E2TB_SHIFT) > >>>       msr    mdcr_el2, x0 > >>>         // Transfer the MM state from EL1 to EL2 > >>> diff --git a/arch/arm64/kvm/debug.c b/arch/arm64/kvm/debug.c > >>> index dbc890511631..7b16f42d39f4 100644 > >>> --- a/arch/arm64/kvm/debug.c > >>> +++ b/arch/arm64/kvm/debug.c > >>> @@ -89,7 +89,7 @@ void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu) > >>>    *  - Debug ROM Address (MDCR_EL2_TDRA) > >>>    *  - OS related registers (MDCR_EL2_TDOSA) > >>>    *  - Statistical profiler (MDCR_EL2_TPMS/MDCR_EL2_E2PB) > >>> - *  - Self-hosted Trace Filter controls (MDCR_EL2_TTRF) > >>> + *  - Self-hosted Trace (MDCR_EL2_TTRF/MDCR_EL2_E2TB) > >> > >> For the record, this is likely to conflict with [1], although that > >> patch still has some issues. > > > > Thanks for the heads up. I think that patch will also conflict with my fixes > > that is queued in kvmarm/fixes. > > How should I proceed with the patch [1]? For the next iteration, should I rebase > it on top of kvmarm/fixes or on top of kvmarm/fixes + this series? On top of kvmarm/fixes, please. I'll merge that branch into 5.13 anyway, as it is taking some time to land upstream. I'll take care of the conflicts, and shout if I need help! Thanks, M. -- Without deviation from the norm, progress is not possible.