lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87345vfiqj.wl-maz@kernel.org>
Date: Sun, 30 Nov 2025 19:00:52 +0000
From: Marc Zyngier <maz@...nel.org>
To: Vincent Donnefort <vdonnefort@...gle.com>
Cc: rostedt@...dmis.org,
	mhiramat@...nel.org,
	mathieu.desnoyers@...icios.com,
	linux-trace-kernel@...r.kernel.org,
	oliver.upton@...ux.dev,
	joey.gouly@....com,
	suzuki.poulose@....com,
	yuzenghui@...wei.com,
	kvmarm@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org,
	jstultz@...gle.com,
	qperret@...gle.com,
	will@...nel.org,
	aneesh.kumar@...nel.org,
	kernel-team@...roid.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 26/28] KVM: arm64: Add hyp_enter/hyp_exit events to pKVM hyp

On Fri, 07 Nov 2025 09:38:38 +0000,
Vincent Donnefort <vdonnefort@...gle.com> wrote:
> 
> The hyp_enter and hyp_exit events are logged by the hypervisor any time
> it is entered and exited.
> 
> Signed-off-by: Vincent Donnefort <vdonnefort@...gle.com>
> 
> diff --git a/arch/arm64/include/asm/kvm_hypevents.h b/arch/arm64/include/asm/kvm_hypevents.h
> index d6e033c96c52..ce3953bc884a 100644
> --- a/arch/arm64/include/asm/kvm_hypevents.h
> +++ b/arch/arm64/include/asm/kvm_hypevents.h
> @@ -7,4 +7,21 @@
>  #include <nvhe/trace.h>
>  #endif
>  
> +HYP_EVENT(hyp_enter,
> +	HE_PROTO(void),
> +	HE_STRUCT(
> +	),
> +	HE_ASSIGN(
> +	),
> +	HE_PRINTK()
> +);
> +
> +HYP_EVENT(hyp_exit,
> +	HE_PROTO(void),
> +	HE_STRUCT(
> +	),
> +	HE_ASSIGN(
> +	),
> +	HE_PRINTK()
> +);
>  #endif
> diff --git a/arch/arm64/kvm/hyp/include/nvhe/arm-smccc.h b/arch/arm64/kvm/hyp/include/nvhe/arm-smccc.h
> new file mode 100644
> index 000000000000..4b69d33e4f2d
> --- /dev/null
> +++ b/arch/arm64/kvm/hyp/include/nvhe/arm-smccc.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#include <asm/kvm_hypevents.h>
> +
> +#include <linux/arm-smccc.h>
> +
> +#undef arm_smccc_1_1_smc
> +#define arm_smccc_1_1_smc(...)					\
> +	do {							\
> +		trace_hyp_exit();				\
> +		__arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__);	\
> +		trace_hyp_enter();				\
> +	} while (0)

Huh. No, please. Don't override existing kernel constructs behind
everybody's back. I know that tracing folks love to play that sort of
game, but I really don't want any of that here.

Just define a wrapper that is KVM-specific, and use that.

Then from a semantic perspective, an SMC call, an ERET back to EL1
host, and an ERET back to EL1 guest are all very different events that
you lump under the "exit" category. That's not right. Same thing for
"enter".

Thanks,

	M.

-- 
Jazz isn't dead. It just smells funny.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ