Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp495433pxf; Wed, 31 Mar 2021 08:30:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPISH0RI/0+jsNve6QFy5rC+4+S/yDOZOzzRcUibi5QDEpZPHxOqthjZwwrjZibZhIDekV X-Received: by 2002:a17:906:400b:: with SMTP id v11mr4163260ejj.194.1617204608145; Wed, 31 Mar 2021 08:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617204608; cv=none; d=google.com; s=arc-20160816; b=QwemJSuaa4xAyys493/GpNAUR7zroljEtULMOIawN6B19BM6VI35P+9EDTpojOzMCM g7hSAPO7xlqnZzoxsN2tzGWFkQAS3kCWQ9Kj/TrWDsH9rB8TTzPDdihUTByNlGE7BHt6 tBqKS8TvUyYg0VLfYIJ0d3S36u9VGc+PoRBcG95iZOl/IkEVC1TuN1vJ86v7H/wVN/II ZVpmpen1G5/pFc13gyr4LbJzi1pJCTpAm0zqd0pUMQkX6wSbtAjmQ92VOjo2S84uCcYJ qTxgGg7kyph7omd5hY5XqW+SS6AOUeXiatX32Zs4rGZsCGSEr2YS5skrU3pnBGqQFATv O3wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=B4CR8IUgY25Qub1n/08rq25lu59oF+iwXyxKPTgY6Cs=; b=V4Il6UzrApyq19UgFsykUT45I+B4zzMmCL/HzD4+RdotgavVZoFWD04S0jmrtTyAe7 vA9JeIlpjIEU3UPdCoeI+dPiXiO4oiuyn/6qMNPDDvQPU8388Sz+NzKsJelBVFRGTfB3 bk1YT0EE+wa8QwkIYG342l3fbFSmO4NMwl9xNSiXZvPjGuePwSx82HwuNN4VVMI/jfHa gtMKf8PQndEW9aolkrObKr4KXzg2UBFTUxw8d9oycfWZgtKvkK3ELelJrdCkAfmNRVm1 ST8qfoH4KuQO3ZFQgrx9MQ0fyM7jertguagz/2rTd5uWOEqABeS9eApMG2UCwt+vadOb ibEg== 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si1732345eji.701.2021.03.31.08.29.43; Wed, 31 Mar 2021 08:30:08 -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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236030AbhCaP2q (ORCPT + 99 others); Wed, 31 Mar 2021 11:28:46 -0400 Received: from foss.arm.com ([217.140.110.172]:45002 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235512AbhCaP2Q (ORCPT ); Wed, 31 Mar 2021 11:28:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4F3CDD6E; Wed, 31 Mar 2021 08:28:15 -0700 (PDT) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB3793F792; Wed, 31 Mar 2021 08:28:13 -0700 (PDT) Subject: Re: [PATCH v5 07/19] arm64: kvm: Enable access to TRBE support for host To: Suzuki K Poulose , Marc Zyngier Cc: 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 References: <20210323120647.454211-1-suzuki.poulose@arm.com> <20210323120647.454211-8-suzuki.poulose@arm.com> <87r1jxq7ax.wl-maz@kernel.org> From: Alexandru Elisei Message-ID: Date: Wed, 31 Mar 2021 16:28:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? [1] https://lore.kernel.org/r/20210323180057.263356-1-alexandru.elisei@arm.com Thanks, Alex