From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.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 CABAA3B3C11 for ; Mon, 13 Jul 2026 08:34:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783931691; cv=none; b=VrUGv0MAI1JsrAZbak+5vIW91BSg4hZ0k9eNguRd4MWUJS/QRLzDNCntYT3oWQwa9jko0vSM6Fsu5UuMoT78TEnCSMojAhA4CtOgg/z5QOcH/5cFe+XMu+Rf3mGT9KQX/8FuJWlxChEGmSqtA0ccVQ854DQEXJ/R/AWODZq1Qxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783931691; c=relaxed/simple; bh=wJFyum8OzWxEFOauuOZPm9XZ/v8c5PZ6ZjXZToOK3Kk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YOgqC8ODEELQ1fNkW7mn6pCB+oYh6CN5QhkdsB++iDnL2RXTZOLTFBRHq8hRkxR5fcx9MrpvZIos5t8Y0cVI+u2Uh4JcwcrIr2q1BiDFp/8+hp34EbS8IhzBzeSEsXeqiyNeLPHR00jTxBT5qWC63GJT/ObHkl1Kg93GycYS5FM= 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=bOpo/l8a; arc=none smtp.client-ip=209.85.221.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="bOpo/l8a" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-47c2b362ee2so2646855f8f.1 for ; Mon, 13 Jul 2026 01:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783931678; x=1784536478; 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=IORCMjoCzaHOJmqaTllBN0mOSKfFshqyOTA44CSojUk=; b=bOpo/l8aTggGkN75bIousiuqKiLFop0q4aCEh6oe+HrqA/m/XIy+YwlsvnmCfN2z6+ u86MNktiWpU12/Idjbjo/Aqvouvf/oBobC+btLTSJacD/CGgj+0+KCdTl35T6Ie9PaJR j//f3IrX7dRF0rDpq5ua7EVj9MSJyNAG5SmqGL45X3f+K1gCOZy7xagO7pPoq8LXl1iA fzKyAAl3m9eCFTy0NpVTe9NNH5qfCN/vvInvfwnJpZ2nwaN8hmDXhEq+Ad0jcAp7aWpB LONoJ7zrioY9z43fFzrjthPQtCro7I+GLHoGZNHYezcKO+S65/wfb1lAeVdqDfJoG4Lj 378w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783931678; x=1784536478; 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=IORCMjoCzaHOJmqaTllBN0mOSKfFshqyOTA44CSojUk=; b=GuEf4i1JDpTrv4c3O0Atbp/UbjUh92DsB/GNSeS6zvIIxqxDhnzsc0IuPxcFKtT6hW zW5b23dkXSSsY2hCGnq9iArh71EINjeKf/WXVdaQHS6MJICtejSidF/g9fYRG38xzyEj WktWdMXvJOtVyzciqaIswQlPSizJKOB4aICahJvbxLtLUCochmAofDokXT/M7g2i0/oI vweE7ZQzJNG5YOw/0wcCfKo1p6yrETMuUFjVVTNssVBuueafS4cPZgnw4hPpIL9mcbvC Evuku91PK+TjpiqAuil8rLxwesmfz+YrjhBwDZYzFBe2ZtJtlIP+9LwWFYQZMTijaNKZ 75LQ== X-Forwarded-Encrypted: i=1; AHgh+RrSyFXbM+ZSPa1s11g0HnC+sR7KgfPPoVukzA/vYofc9LuV0uoqAizbHa8IJC7K1BCY7CjIS96V7s7cxvk=@vger.kernel.org X-Gm-Message-State: AOJu0YxLXPQQWf1OOPAI2wvjudVwfdkyvcz8mUs0HNBCH+teKvOf+WRq UZu39V5rsfsUdf+/ooudnj7fQ20ZsvwoAw5ExPk7sLQEz3Ckp0WAGX5d77IFRj5Qyg== X-Gm-Gg: AfdE7ck+nyN1x+b4fhx0kkku9g/PjJN6up0dJZQJi3eU5yExqjPAt414PKQSA0FiRct iWmC9ketKjXA7KqD2qyMEghyrMgaHEL0jHFbgVkX1cWtEGampFSHhIxQhSz+l4fYhpk0MGz440W WrUjX3OrsWdu+A5DNY2RxhSaXgZ1g1nR1E30azE+rwZzYwtFJZaBYuvTW7o8MsJz4V1GgzD/aUF 4bryiDV7q8e2hB53zM9h98YFamDazY4oj1pbyFX9Jsyb/2dHx4jz+8BZpLkb+o0H84vxGmQJ0IH QVyOljgHBNoQEaeGjZDrnZqbS01vrDb74Bhmxu6fT+lrKzuulmcvbnWhpZnrEQYN6dfFHAbi0Sq aic6C3y0YAwflVExTrP0xPO9Id46xuGHZil788LK1utjMdv6VZjmVT0acN7y7xeZm2xQ+F4oV67 G+wy2k/ORVXJ9Du3ik5ZjNOLd9hY4RaeFAwf/exQoTqvo2iOvvlM4= X-Received: by 2002:a05:6000:2907:b0:470:2fb1:3dbc with SMTP id ffacd0b85a97d-47f2dce7c3emr9513923f8f.35.1783931677010; Mon, 13 Jul 2026 01:34:37 -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-47aa039ad21sm83093111f8f.20.2026.07.13.01.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 01:34:36 -0700 (PDT) Date: Mon, 13 Jul 2026 09:34:32 +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: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() ? > > Thanks, > Mostafa > > > > > > > > > > > Yes, that shouldn't be a problem, I just added hyp_ prefix, but I > > > > am ok with any suggestions! > > > > > > Didn't I say naming is hard? :) How about, el2_? Not really happy with > > > that either tbh... but can't think of a better one... > > > > > > /fuad > > > > > > > > > > > Thanks, > > > > Mostafa > > > > > > > > > > > > > > Reviewed-by: Fuad Tabba > > > > > Tested-by: Fuad Tabba < fuad.tabba@linux.dev> > > > > > > > > > > Test: builds fine with the different config enables. > > > > > > > > > > Cheers, > > > > > /fuad