From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52BF9C43616 for ; Wed, 31 Mar 2021 15:38:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23E5661028 for ; Wed, 31 Mar 2021 15:38:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236207AbhCaPiD convert rfc822-to-8bit (ORCPT ); Wed, 31 Mar 2021 11:38:03 -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.