From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 C678D3B7759 for ; Mon, 13 Jul 2026 08:55:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783932925; cv=none; b=ftps3LleQMcliblYTDmrm4lx6wWOt3d0M14J+huCUuo4F8bUHKwBAm/sA0fSHiWMx/I7bGgbQyv+TVaUlqHvvfCeZUuKNxe+PSI+p/sPMN5pQQPZ7KcBSb8gEM7UsEOk1Mv6+aPi+M2PsM78sJMMALcxVABrze/fa1UCidlPhQQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783932925; c=relaxed/simple; bh=wQjoMGo4RQSfpyYZ+IGZ2yaanIQu1MXkMPtV0NCk25Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZY7ckgzIunhL2fNND2jdfXOc3iPfax50rcz1bZc0RlnUr987xQ8RH148t6eHO5Awx2VC4Hh7kAOGa9x3BRBjh9kTEB8nfe4bsRJ6GrKw3O5PNb5F01iMXxFQu7eN9iSEygH8TOiitJyvL45qCD2G09wdwRqV0in/Jc49UR8rWAs= 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=rQvmaEa/; arc=none smtp.client-ip=209.85.221.42 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="rQvmaEa/" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-476d8e647e9so2969490f8f.0 for ; Mon, 13 Jul 2026 01:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783932922; x=1784537722; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=BtqEp6WILuHu3z7cOSw6EYTxyyE81/3b++ePQIGwGRA=; b=rQvmaEa/ZsD/5uxT9dM2bwYddmQ4l+YxoQLuJvfOgP1L4v+nlL8M2o7aXQHBkYvV0t QCTpjhDCGkR1MHg46MurdqMTEu6DDZC1ZX+bdjnOc4yxI4y88dZYo2BSRYlbJSKGWRVk ICU3kKS4I3Qhr3aXOudBwiiy/kxwQ8LxJZ7ZgVVbJZoFQ4wzyOUrp/KFjEADUmRfE0C3 K7IcTL7wlPfP8YXmSXi+VOlQBit4vL/QiG1RnaaCkbBY+42IJP2QUUPzigoRRVLKrbUB gtCNmKnKshqtPUtI7dlAobTBWt6DADl1M0KEZ37DmfjnlhhlSLirHGUpYMAu+oaiOOO+ uNTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783932922; x=1784537722; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=BtqEp6WILuHu3z7cOSw6EYTxyyE81/3b++ePQIGwGRA=; b=QrpVYFzhyfDmMh9qi4vz+sxvCKr6cVLiES4rLhj4wq+lfNHwJsL3p2NdjiqqhAJitJ qygepbWpgH05OzUvsTdb7awXb1BxKf7vglaJ9D7gSvuniPWrCS4DINdr58uQRMNRtGMm PNuwxHLJ+igzaT6TnL/BlepVrEa5G0CFeyz5Huasqe9XcIVT+eCrsAdvWOWnDDPw6wm3 EzFo5M6pV1TdV+qOyJklf4IsNFg5Vg8cPEJhYKtYUIwxTU2KYF/oQx5Phlmr1Qp9Gk0Q Ah9i0rk+HePk9hzOwYvAXxI7FZGFYy07YB+ag4N1EiiH1lCKWxeGBDm6NhAW2nfqItlK 179Q== X-Forwarded-Encrypted: i=1; AHgh+RrFElb4SUpjn4gqe1RQgsPyCArBldd9eqGFUYQovIyT7zmxYOMKPaDO9elIVGauXic8lJRWyvfr0BY4KHg=@vger.kernel.org X-Gm-Message-State: AOJu0YwDs3f8yXT5ELfyBk2Zw06Ijx05muKphRcgFIiFOUb34KHV9sw+ A9sYtSV5b6p4aX/NgdVzCTiIxrUB1skDXklqV9Dr9EVhxdQreUDxtDb0jjvtQssurw== X-Gm-Gg: AfdE7cmatdLq3TO8qRdmD0J9Yx5p2nCqPgyMplcl+yZImxx0zD8w1oU1ocsWacFU5Qm ZdCCL6FqxTRcg5cHMb8E8zRL/1MTHMR4hC4moPup8IhYXfCzCM91oKEXn6irUkbwqyoKyvRi/xT a9HBnGpm89p/uW/ZSwCE/KjM6XBsAkF0prO/Na8RTuc8KegxEp/+X5wlI8hlL/7E8dlG0U5vwXR ZMsTKRAp6fxeAwv2jT3Z8yFBfvNnOtKkpwo1zk3X2KRRDX47Tjloh+o23XCZdJEX0ykKDhTLo1a wKeVlo8CWZ4nSWOtRpE0pr/hlav3iOBnuKSa+Y6RWsJEzfO4bLaunmFu4vTc5J3zp5ZtbzaRoMB WnG05/Z/oXot3QjOkRJ0dYTkwpnjiLSwcnCcZxUcF83sG3dyar33wOVUMJM9QCpyXKb1yOAJASY MYrAwh2Jrqz4NvL8xs389a1dRRl8pu9lxHecT4QlK/AHvl7CfR/N8= X-Received: by 2002:a05:6000:2688:b0:47d:f440:fb62 with SMTP id ffacd0b85a97d-47f2dcef535mr8659990f8f.57.1783932921619; Mon, 13 Jul 2026 01:55:21 -0700 (PDT) Received: from google.com (137.69.77.34.bc.googleusercontent.com. [34.77.69.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47df6a31dd5sm40641410f8f.16.2026.07.13.01.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 01:55:21 -0700 (PDT) Date: Mon, 13 Jul 2026 09:55:17 +0100 From: Vincent Donnefort To: Mostafa Saleh Cc: Fuad Tabba , linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, maz@kernel.org, oupton@kernel.org, seiden@linux.ibm.com, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org Subject: Re: [PATCH] KVM: arm64: Avoid naming collision in tracing Message-ID: References: <20260712153835.2264905-1-smostafa@google.com> 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: On Mon, Jul 13, 2026 at 08:40:58AM +0000, Mostafa Saleh wrote: > On Mon, Jul 13, 2026 at 09:34:32AM +0100, Vincent Donnefort wrote: > > On Mon, Jul 13, 2026 at 08:26:35AM +0000, Mostafa Saleh wrote: > > > On Mon, Jul 13, 2026 at 09:11:27AM +0100, Vincent Donnefort wrote: > > > > [...] > > > > > > > > > > > > > > > > > > I did not add Fixes tag as this is currently dormant and not breaking > > > > > > > > anything. > > > > > > > > --- > > > > > > > > arch/arm64/kvm/hyp/include/nvhe/clock.h | 8 ++++---- > > > > > > > > arch/arm64/kvm/hyp/nvhe/clock.c | 4 ++-- > > > > > > > > arch/arm64/kvm/hyp/nvhe/trace.c | 4 ++-- > > > > > > > > 3 files changed, 8 insertions(+), 8 deletions(-) > > > > > > > > > > > > > > > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/clock.h b/arch/arm64/kvm/hyp/include/nvhe/clock.h > > > > > > > > index 9f429f5c0664..c2ccd0e8bf22 100644 > > > > > > > > --- a/arch/arm64/kvm/hyp/include/nvhe/clock.h > > > > > > > > +++ b/arch/arm64/kvm/hyp/include/nvhe/clock.h > > > > > > > > @@ -6,11 +6,11 @@ > > > > > > > > #include > > > > > > > > > > > > > > > > #ifdef CONFIG_NVHE_EL2_TRACING > > > > > > > > -void trace_clock_update(u32 mult, u32 shift, u64 epoch_ns, u64 epoch_cyc); > > > > > > > > -u64 trace_clock(void); > > > > > > > > +void hyp_trace_clock_update(u32 mult, u32 shift, u64 epoch_ns, u64 epoch_cyc); > > > > > > > > +u64 hyp_trace_clock(void); > > > > > > > > > > > > > > hyp_trace_clock overlaps the host side: arch/arm64/kvm/hyp_trace.c > > > > > > > already has a struct hyp_trace_clock and static helpers > > > > > > > hyp_trace_clock_enable() / hyp_trace_clock_show() for the debugfs view > > > > > > > of the same clock. No actual collision, so this is only a readability > > > > > > > point, but a reader grepping hyp_trace_clock now gets two unrelated > > > > > > > things. Maybe you'd want to consider a different name, but naming is > > > > > > > hard :) > > > > > > > > If we were to rename: the clock is a "hyp_clock" so probably trace_hyp_clock() > > > > is the right thing here. > > > > > > > > while the "hyp_trace_" is the prefix for hyp_trace.c file content. > > > > > > > > Although I would like to see why we pull trace_clock() from the kernel into EL2. > > > > That bit sounds wrong and if we have a way around perhaps that's better? > > > > > > Most include path look like this: > > > In file included from ./include/linux/ftrace.h:11, > > > from ./include/linux/kprobes.h:28, > > > from ./include/linux/kgdb.h:17, > > > from ./arch/arm64/include/asm/cacheflush.h:11, > > > from ./include/linux/cacheflush.h:5, > > > from ./include/linux/highmem.h:8, > > > from ./include/linux/bvec.h:10, > > > from ./include/linux/blk_types.h:10, > > > from ./include/linux/writeback.h:13, > > > from ./include/linux/memcontrol.h:23, > > > from ./include/linux/resume_user_mode.h:8, > > > from ./include/linux/entry-virt.h:6, > > > from ./include/linux/kvm_host.h:5, > > > > > > Although, some files have ./arch/arm64/include/asm/cacheflush.h > > > directly. > > > > Ha sad, no way around that... > > > > So about trace_hyp_clock() / trace_hyp_clock_update() ? > > > > Makes sense, I will respin with that. Thanks. And small nit for the patch title: use "hyp tracing" to distinguish from the kernel tracing. > > Thanks, > Mostafa >