Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4472172pxf; Tue, 30 Mar 2021 08:36:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznyndu03lXvvXYIrEUSh9W81Yd7X068ZfC75h/j2bSOS7xfgiPyDmDrwyHvzpCJKQYZ+ha X-Received: by 2002:a17:906:d554:: with SMTP id cr20mr34344587ejc.61.1617118607373; Tue, 30 Mar 2021 08:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617118607; cv=none; d=google.com; s=arc-20160816; b=nfvX9LRGyvr+xEEaiXHbGU/znOV/bYt/wEjP8p1HstQNt9kjUqpunSAv3Z8DRjsybC ggBHdO74gHjXO0pdL7ixhSUK1759btRl+KmJn4o0wtcZbXqRupo/tr3PS6ScSuUEUCe4 i2raMAu5HuSvfEiSgOpEHeaQke/OGbv3viYhBlypaUt+GJKCl+XUFjMUGlMU67Ejqxig fjsrGwrARGcbPc+kMeXBmKLNBnRtknGEpiha0vU3E8s5kK+KvcV+uld3gXvmdZL1eako hm5NssAEtJ5i92+0n5BFlt0YhYfLBlJ+n8e7aSEMMphGjboSfMUqAW9Hzw0nnCIGN53B PakA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=Dwlv4tHLeh77jrKYyTj+pa9Z3mnzvr04IwKWMR4LIA8=; b=YRdQ5RztSuDIrNd2ZdAA2zr03G7f3o7LkemjGr4uKtb++KsNmadkZwoMY0GmxU5jgs 9t1YUPp2iWQx7MgJ3HtI5+vFiZ89MUQ9YKMl3S+KeQgbO/IuB0tVkEAc0oWP4WfPYNLi a50wvdBkBnXftofjJ4LL3RgGP3rKuUUyHm+dJyKtUwAqzdv8BHqijxma6j45/1DSrP4j iT7CaldLHOPQ3xhuRhXC9A3/cJrBZNFpAn0+RKGyzuTqs/3/EY28Cy1mSz7xLiyYt1+9 nzrQ+/g5cx+z0O/bIz726BL9+8075MP5cG4e0r5/3aWivmnGjz29cfadb9ve1zcWuKZl UMpQ== 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 dg23si15114716edb.519.2021.03.30.08.36.23; Tue, 30 Mar 2021 08:36:47 -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 S232404AbhC3Pe6 (ORCPT + 99 others); Tue, 30 Mar 2021 11:34:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:38824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232166AbhC3Pet (ORCPT ); Tue, 30 Mar 2021 11:34:49 -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 1D6E2619A7; Tue, 30 Mar 2021 15:34:49 +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 1lRGOE-004iZ4-7z; Tue, 30 Mar 2021 16:34:46 +0100 Date: Tue, 30 Mar 2021 16:34:45 +0100 Message-ID: <87blb0r6y2.wl-maz@kernel.org> From: Marc Zyngier To: Mathieu Poirier Cc: Suzuki K Poulose , Catalin Marinas , gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, anshuman.khandual@arm.com, Will Deacon , Mark Rutland Subject: Re: [PATCH v5 07/19] arm64: kvm: Enable access to TRBE support for host In-Reply-To: <20210330152314.GA2329603@xps15> References: <20210323120647.454211-1-suzuki.poulose@arm.com> <20210323120647.454211-8-suzuki.poulose@arm.com> <20210326165550.GC2009902@xps15> <20210330152314.GA2329603@xps15> 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=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: mathieu.poirier@linaro.org, suzuki.poulose@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, anshuman.khandual@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 Tue, 30 Mar 2021 16:23:14 +0100, Mathieu Poirier wrote: > > On Tue, Mar 30, 2021 at 11:38:18AM +0100, Suzuki K Poulose wrote: > > On 26/03/2021 16:55, Mathieu Poirier wrote: > > > On Tue, Mar 23, 2021 at 12:06:35PM +0000, Suzuki K Poulose wrote: > > > > For a nvhe host, the EL2 must allow the EL1&0 translation > > > > regime for TraceBuffer (MDCR_EL2.E2TB == 0b11). This must > > > > be saved/restored over a trip to the guest. Also, before > > > > entering the guest, we must flush any trace data if the > > > > TRBE was enabled. And we must prohibit the generation > > > > of trace while we are in EL1 by clearing the TRFCR_EL1. > > > > > > > > For vhe, the EL2 must prevent the EL1 access to the Trace > > > > Buffer. > > > > > > > > Cc: Will Deacon > > > > Cc: Catalin Marinas > > > > Cc: Marc Zyngier > > > > Cc: Mark Rutland > > > > Cc: Anshuman Khandual > > > > Acked-by: Mathieu Poirier > > > > Signed-off-by: Suzuki K Poulose > > > > --- > > > > arch/arm64/include/asm/el2_setup.h | 13 +++++++++ > > > > arch/arm64/include/asm/kvm_arm.h | 2 ++ > > > > arch/arm64/include/asm/kvm_host.h | 2 ++ > > > > arch/arm64/kernel/hyp-stub.S | 3 ++- > > > > arch/arm64/kvm/debug.c | 6 ++--- > > > > arch/arm64/kvm/hyp/nvhe/debug-sr.c | 42 ++++++++++++++++++++++++++++++ > > > > arch/arm64/kvm/hyp/nvhe/switch.c | 1 + > > > > 7 files changed, 65 insertions(+), 4 deletions(-) > > > > > > > > > > Marc - do you want me to pick up this one? > > > > I think the kvmarm tree is the best route for this patch, given the amount > > of changes the tree is going through, in the areas this patch > > touches. Or else there would be conflicts with merging. And this patch > > depends on the patches from this series that were queued. > > > > Here is the depency tree : > > > > a) kvm-arm fixes for debug (Patch 1, 2) & SPE save-restore fix (queued in > > v5.12-rc3) > > > > b) TRBE defintions and Trace synchronization barrier (Patches 5 & 6) > > > > c) kvm-arm TRBE host support (Patch 7) > > > > d) TRBE driver support (and the ETE changes) > > > > > > (c) code merge depends on -> (a) + (b) > > (d) build (no conflicts) depends on -> (b) > > > > > > Now (d) has an indirect dependency on (c) for operational correctness at > > runtime. > > So, if : > > > > kvmarm tree picks up : b + c > > coresight tree picksup : b + d > > > > and if we could ensure the merge order of the trees are in > > kvmarm > > greg-kh (device-misc tree) (coresight goes via this tree) > > > > Greg's char-misc tree is based on the rc releases rather than next. As such it > is a while before other branches like kvmarm get merged, causing all sort of > compilation breakage. > > > we should be fine. > > > > Additionally, we could rip out the Kconfig changes from the TRBE patch > > and add it only at the rc1, once we verify both the trees are in to make > > sure the runtime operation dependency is not triggered. > > > > We could also do that but Greg might frown at the tactic, and > rightly so. We do that all the times. Otherwise, it is hardly possible to build an infrastructure that spans across multiple subsystems *and* involves userspace. I really wouldn't worry about that. M. -- Without deviation from the norm, progress is not possible.