From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00C3E1F461D for ; Mon, 1 Dec 2025 16:04:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764605055; cv=none; b=plfXLqGzGWYNvMGND5pT+sq3nDQ9lzHfargy0py6FH5PO5bGjkR+kLocqR5vx89xmyib95gRogYgqtoCWsomPN0D1m6C5nrgxnVcStQu5m7KFE7IwebJ/J4o037Rhr6eoQZpsuACwsVv1fPEqXvue5YKdJhvlBJmKHB5+xTpRlA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764605055; c=relaxed/simple; bh=Z2YOr5kYk9GxOy65Jpo9uyk4Ob8LGIIPugQHeveeqto=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BP6WgwsQ2uFVCoNWD6W5pTxubzW1NFR2XM/sO9XJFDj7nVVRYCmvf6JvbKO1RNwTrcCb60bPtOarBWo60aOWzXVKKtBEPVcplWjW8Rwy7s0KfCcWhZaEbqYTJapR4EMElN4naE8K6br/3Z7r/P18N9/6VFsv5U1aHXOqlO92YPE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=CYDdi4Wb; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CYDdi4Wb" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-597c83bb5c2so1140964e87.3 for ; Mon, 01 Dec 2025 08:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1764605052; x=1765209852; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=b9hMtV3PXrMhCjLem0M5KT+SZ8RXBResg7Pv80Fl+Ng=; b=CYDdi4Wb3ba5hX34N01p83gKLJQEA72a23rdSC/iXQwFIiMSzhT9cx7gnR7MTOnm+b xjvzw/qSn7IDnfVSlGiN9EFVXGE1B+9NXAu5N95CnDA45t/5jnsRLzrhQS/a+SawgjsD mIn12wFQ9TyXw8nMNyfsRLxTRRvWXnD2BhPYtANfm821onh0Lx9btcHFxnaAP+PeEs+9 txxZhwnvVqFRvH3YlSFxQ4leNQqpbpSzo1nHBXJTkhcdqPfrpgwo2LTKabVhA0ICOLf+ RrNQkjAUkSDApBUi+QvnamO8J0sQXROaRzGTrw4Z/qACkxeBsVBXjWi7v68QbzzLrSPG dCeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764605052; x=1765209852; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b9hMtV3PXrMhCjLem0M5KT+SZ8RXBResg7Pv80Fl+Ng=; b=qKBU4xl7k/OzbGjNlaQ2MF794jMajabFM/WlM3MeC/9EgZxb7qTnf1v8w2eEZ4/zPp AGo/wDm86+nCSeODMBIEf1Icih6UzKvibc1E37lCP26LUkyBCvXQM0Eu6E+NdY8R3jYN fSqyHwKL6qJ1fHwdl63tr+Kk9J7qJIDCmEFFmfe6MY9t37vh/PtoxgEeeRGBLdDrZMH9 7mPmv5cFob/h5CZkCP1SM+hq8+CkHRmDmlLWWZkiiM94irL4JlyI6JrAXqFeUUwMejk4 EZP188RWZMu8+/0cBtV8Tn5D2HAPHiyK3A5yAB9fXpSCB8FlxNdCfKXKrncDHbaIGr3N OOyQ== X-Forwarded-Encrypted: i=1; AJvYcCXVLvge7FUHlcyMzOf3JjVv377g55bPptLstq0fcuPsLF5N/EbNqAQFLv7jeRDQXg7WpaI55A5t+0oqoNw=@vger.kernel.org X-Gm-Message-State: AOJu0YyVKtDK8SyPAaDgHmyOhj8NScnD2He0xkReg3ut+32gB9oQW+Wo 8/RAYZUfeblx86fjoUdv8aiN/ovmBf7vsj9wcka2BLUDISVXd9+sAmMDqTqVJLH7KQ== X-Gm-Gg: ASbGncvUKoUgVSEhM2bM2+CPBkcgbOhtdJxeQQb7+AmqF8PdezXtACK+hK9XPxbf6Rn J66+Mly6kbnNYdVacZ/YOa7KKW3wiBcSo7sKnEI+grysDVQPUTylrOuuNwMFEhFBUOSmTuRuTAr x/D9UD3TwOgLhxChJy/Dx3Qai8Tf/rM8NxZBiypicWHArdenYAyQau9mntYNVq0tgIPS3s4m1Yo o9XCBwZdSTBHqEqCjCPFTH/9Eq9gi0CjBQk7oSgDlDvaQwzCOLowiVHIAG1/ymbDSqiPvFex0SJ AieVswlzcvO3JF3oDk9Hnpr2syZtDEI4c+FAha2edFsj/htieNkafVwtHgPS2PUeubnIHf9y8Bq Xjs54vNcy22pxAyAaBsrVivqK+CjpxosQr2mEZJzmJDugu8rPtF85pYoOQQdV82Jb0JPiXu7G6t 800jOfcqZxz+647/COdVjJb2gifbKZj6kWbeDw6U3sKrMkdt7qPg== X-Google-Smtp-Source: AGHT+IGwL72Aeg7rfy2TscsPc6xQDUxQw9XmpdcK/OUqxD4opRrcqN2Rq5mq6/N45bshnzXhV6B/iw== X-Received: by 2002:a05:6512:1595:b0:595:831d:22eb with SMTP id 2adb3069b0e04-596a3e9fda1mr14183062e87.1.1764605051684; Mon, 01 Dec 2025 08:04:11 -0800 (PST) Received: from google.com (120.54.38.34.bc.googleusercontent.com. [34.38.54.120]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-596bfa48c90sm3661068e87.80.2025.12.01.08.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Dec 2025 08:04:11 -0800 (PST) Date: Mon, 1 Dec 2025 16:04:07 +0000 From: Vincent Donnefort To: Marc Zyngier 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 v8 26/28] KVM: arm64: Add hyp_enter/hyp_exit events to pKVM hyp Message-ID: References: <20251107093840.3779150-1-vdonnefort@google.com> <20251107093840.3779150-27-vdonnefort@google.com> <87345vfiqj.wl-maz@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87345vfiqj.wl-maz@kernel.org> On Sun, Nov 30, 2025 at 07:00:52PM +0000, Marc Zyngier wrote: > On Fri, 07 Nov 2025 09:38:38 +0000, > Vincent Donnefort 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 > > > > 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 > > #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 > > + > > +#include > > + > > +#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. And you haven't seen what I had for arm_smccc_1_2_smc() > > 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". The idea of those events is just to know when we enter and exit the hypervisor, purely from a timing point of view. In ACK, we already have other separated events that can give the "cause" for entering or exiting the hypervisor. I haven't added them to that series because I thought it was big enough. So happy to add now or do a follow-up, once we're done with that one? > > Thanks, > > M. > > -- > Jazz isn't dead. It just smells funny.