Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4399213pxf; Tue, 30 Mar 2021 07:03:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJaXlaUMII7rXHA1tjkZ1mBP7fUuyjxHShtpzcBCMPw9vzd2mZiGOXudSVql87EbxZNZpi X-Received: by 2002:a17:906:7f01:: with SMTP id d1mr34315372ejr.136.1617112983450; Tue, 30 Mar 2021 07:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617112983; cv=none; d=google.com; s=arc-20160816; b=wTbDlraqg+2M86M1bmKz9Ik9EpY5oOT/mJRfgw/Fz7baOQDaX+FbQrXsxjFFHkQaBg 6h3ah9PoI4DM9+D00jWMtFnUmwGVjvUpkW5A52CzXwDxXdk8qul4WrsDOrcOHsmZZ+Ww EJTJc/QNJhqk1kGd7qNtiZqw8DiJ+rlN6B3YdRP6U8Yl7KIr/y2JAi5VZY/1PrFQSaw2 cN3S7ynuqpQDD3Kq615R2ftE5NNjs2BC1j/KKVJf6tUFHdgS1kHPNzRZ5nN6zNi51YUV kO2S/iD+5Swetxo1n5XTVEpoXZqvuins/+XsMmqMjb72tgiD5aKR2t1rv84FtMDeW2fg MfBQ== 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=Co35LNticNSWoFqfeuhj7qkiXANJ8bVKRjFAdCdd4T8=; b=rxOKJ1HJcURHJz1G9XK+pl5b/h6Y7MZQOvYOo769Lvr30WKsC71aZZ2/uBJ8q+gNjy cMCIz1c7zQ+jCVKjiIgBVGpr1l77e7h/SxZRJZkiMtFbudFLcZULwh9e93Ij3hPm7b/P pBAEHmfcEPM+G+rVGdxyGHkQUHiUThLLq+UpFWfgBl72B9XFu2EsYg3o83tG1F/Ku8Ox 80XWxtd4cP1c6zFzAypwRXjy1d7HS7T2RmUKAsPK86MH46ScplDMua5EnZTYadXLoI4Q MnuSZ0Rp/0l6Y5MF1Z/TS7NeBCDG1eYbMIh5aVv/vganyG7iO4uc9R3rMF76LyMhs1g0 iJdQ== 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 qx6si15376112ejb.468.2021.03.30.07.02.40; Tue, 30 Mar 2021 07:03:03 -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 S232166AbhC3OA1 (ORCPT + 99 others); Tue, 30 Mar 2021 10:00:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:37612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbhC3OAT (ORCPT ); Tue, 30 Mar 2021 10:00:19 -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 020996044F; Tue, 30 Mar 2021 14:00:19 +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 1lREum-004h4b-Tm; Tue, 30 Mar 2021 15:00:17 +0100 Date: Tue, 30 Mar 2021 15:00:16 +0100 Message-ID: <87ft0crbbj.wl-maz@kernel.org> From: Marc Zyngier To: Suzuki K Poulose 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 , Alexandru Elisei 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> <87mtukrg6o.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=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: 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, Alexandru.Elisei@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 14:34:23 +0100, Suzuki K Poulose wrote: > > On 30/03/2021 13:15, Marc Zyngier wrote: > > On Tue, 30 Mar 2021 12:12:49 +0100, > > Suzuki K Poulose wrote: [...] > >> May be we could do this check at kvm_arch_vcpu_load()/put() ? > > > > That would extend the tracing blackout period enormously, wouldn't it? > > I'm not sure that's the best thing to do... > > Sorry for not making this clear. We could check if the SPE/TRBE is > available on this CPU (including the PMB/TRB_IDR bits and a set a flag > in the VCPU on every kvm_arch_vcpu_load() and cleared on put. > The actual switching code could check this flag and check if the unit > is enabled and then do the actual save/restore as we do below. > (We may be able to even check if unit is enabled there, need to double > check this.) Ah, gotcha. Yes, this seems like a reasonable thing to do. We have the per-vcpu debug flags already, and you could piggy-back on that. Thanks, M. -- Without deviation from the norm, progress is not possible.