From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 041993A89DC; Wed, 7 Jan 2026 15:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800426; cv=none; b=qZkRgnFON9I+8m20yW8PPFztM4RZT1Txm/9BAP2j/RVvy79w97awtsWnuP3AzENxV32sa7CsAJOgFnlqav/G0mecAHcHCLQGhzZCzdlXMaqf9ojQPV9qdqzgGMgGig05s5w6We1S878bOtCSTwm6+7UxZpWqLqSb30ak468R2YI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800426; c=relaxed/simple; bh=Xr0NRyAzk4dBNy+oJhpszKz1ke0Az0ldJi1gPQPAEJg=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=gFWhmfn1wkJh9o1akRLVNLfE0rMmArn0C7jqY15iXpWhilOiW0nco+8kLRssuorLOovxdzj6uyDtHCIrJ+d0gnhRVO1yqh5HnpzIEKNsMTV72ni6iyXIMRfEI0w6vj2RJbO4uh8x8XwNikhr0+NEkzIsWkXEa0AzQk/dtAM646s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LOZErcX2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LOZErcX2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74DE2C4CEF1; Wed, 7 Jan 2026 15:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767800425; bh=Xr0NRyAzk4dBNy+oJhpszKz1ke0Az0ldJi1gPQPAEJg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LOZErcX2LYG0+yb4trCkM6SjaIIN5aaC/qd8DDOyfR5SLQ/PZzt5cNQGiJbB4sKXV z2zwYcX+CqTPLMmFU/MLMGeWLkRaSXpVjzn9Z/gwSOOgJZoRQ3r5BNi52MEOefOoXk JvLwu1LCzhZ8dBq1BiH5c+L1hU3T1cT/u3wutxBumRGaqUv9S9zQ0bjQ/ePba4pZeM KYbWDbWJulDpTC00SC42AqKS/mco6qzTP8QXZ24aO+BDQ6FMd3fWep/5uploOzLEjF Iz+JQN2yL+xK+U195UXvwR3pQkI6tmiQxe+gux1Qfmhzky257VUJTaVhHBtK2L2WKB NFcb+0IoxSijg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vdVe2-000000007Z8-3nQ6; Wed, 07 Jan 2026 15:40:23 +0000 Date: Wed, 07 Jan 2026 15:40:22 +0000 Message-ID: <868qe9mnx5.wl-maz@kernel.org> From: Marc Zyngier To: Vincent Donnefort Cc: rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, linux-trace-kernel@vger.kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jstultz@google.com, qperret@google.com, will@kernel.org, aneesh.kumar@kernel.org, kernel-team@android.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 29/30] KVM: arm64: Add selftest event support to nVHE/pKVM hyp In-Reply-To: <20251202093623.2337860-30-vdonnefort@google.com> References: <20251202093623.2337860-1-vdonnefort@google.com> <20251202093623.2337860-30-vdonnefort@google.com> 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/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: vdonnefort@google.com, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, linux-trace-kernel@vger.kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jstultz@google.com, qperret@google.com, will@kernel.org, aneesh.kumar@kernel.org, kernel-team@android.com, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Tue, 02 Dec 2025 09:36:22 +0000, Vincent Donnefort wrote: > > Add a selftest event that can be triggered from a `write_event` tracefs > file. This intends to be used by trace remote selftests. > > Signed-off-by: Vincent Donnefort > > diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h > index 37c015b54ff6..e2de7ad64938 100644 > --- a/arch/arm64/include/asm/kvm_asm.h > +++ b/arch/arm64/include/asm/kvm_asm.h > @@ -96,6 +96,7 @@ enum __kvm_host_smccc_func { > __KVM_HOST_SMCCC_FUNC___tracing_update_clock, > __KVM_HOST_SMCCC_FUNC___tracing_reset, > __KVM_HOST_SMCCC_FUNC___tracing_enable_event, > + __KVM_HOST_SMCCC_FUNC___tracing_write_event, > }; > > #define DECLARE_KVM_VHE_SYM(sym) extern char sym[] > diff --git a/arch/arm64/include/asm/kvm_hypevents.h b/arch/arm64/include/asm/kvm_hypevents.h > index 268b3cd7a1b2..c276fd28e0bf 100644 > --- a/arch/arm64/include/asm/kvm_hypevents.h > +++ b/arch/arm64/include/asm/kvm_hypevents.h > @@ -42,4 +42,15 @@ HYP_EVENT(hyp_exit, > ), > HE_PRINTK("reason=%s", __hyp_enter_exit_reason_str(__entry->reason)) > ); > + > +HYP_EVENT(selftest, > + HE_PROTO(u64 id), > + HE_STRUCT( > + he_field(u64, id) > + ), > + HE_ASSIGN( > + __entry->id = id; > + ), > + RE_PRINTK("id=%llu", __entry->id) Not strictly related to this patch, but I find that the trace itself lacks context. For example: [001] 323.847422: hyp_enter reason=hvc [001] 323.847423: hyp_exit reason=eret_host [001] 323.847688: hyp_enter reason=hvc [001] 323.847688: hyp_exit reason=eret_host [001] 323.847706: hyp_enter reason=hvc [001] 323.847707: hyp_exit reason=eret_host [001] 323.847722: hyp_enter reason=hvc [001] 323.847723: hyp_exit reason=eret_host That's all fine as long as I'm dealing with a single guest, or even with a single vcpu. Trying to trace multiple guests, or even multiple vcpus makes the whole thing completely unusable, because I have no idea what I'm looking at. To make this useful, having some context provided by the host really is required. Thanks, M. -- Without deviation from the norm, progress is not possible.