From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 C1FDA3563DD for ; Sun, 12 Jul 2026 19:19:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783883984; cv=none; b=XUxCs3Xb/DhqSPS6EqC56Jai/K6dSis0VkH5snfKkVwsrk+VCLnXCaIgi9cP/f0GtwxxCqVWh5nUVBnZU/GN2GUifq68uRnInQ7lmSyyXJeDeYYDMWrwdnzLWf6h6qUgsJd9+TS1nDSTdAxVGr08DlLZIhWnhh15J9BClUZ7O94= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783883984; c=relaxed/simple; bh=gfZgT+iv2oj2lcKtRdSuGg71IzxCGTjr9ADXjGGkxVI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l9gTFIYdAbNo2WaoZeAgsZ+gTZSraKBuVqfju0r/aYk1qThWVwPKQHHjWhqJPnINxanCzzXEFAT628BrWhb4Ht7iatbiqZhmIa7wyUiHv3Fqv2XhFVUcuOdj6HNvl/tgRXuGCe1dGCmaqR2vPS504t8/AWkNa2HrQfBqLcE/WBA= 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=VXgB/zVP; arc=none smtp.client-ip=209.85.128.54 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="VXgB/zVP" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-493b8d92a4eso53905e9.1 for ; Sun, 12 Jul 2026 12:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783883981; x=1784488781; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding: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=vEU3y3lXMNFSsQ9hphclmAmUhcp5miEUyosWJijgi/Q=; b=VXgB/zVPmLXmWnFAkPSSq1QJS8UzzzbSdW4uYa/avJTFd6CzX1DZeNb3YwhQNMHqx7 LYV0HJxBov2qA5bMn+yq2sogfVg8y5EQHFtkhYBQXUfqjQDkw56QM4e36GXfXBgsemF1 CZ+38Atahez873gNUbeOvPtEV8d16xCx59thEpWkRUCjXqdInjHHa4XpnrG4wZVFs9WX XgYtOgyshnD+b3IzrVcizo45yhTya9jsvm254V11RuD5Vg2/U+DDttt2aGC43/yxXNhZ Ejfj5W0cxMekQzkKEg7P624BxxMqvyRrFOTujHD9ZUt+GBFWSNl7c8/hC+2i9OHJGGQf y35Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783883981; x=1784488781; h=in-reply-to:content-transfer-encoding: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=vEU3y3lXMNFSsQ9hphclmAmUhcp5miEUyosWJijgi/Q=; b=nDi+jYWpLvbYZ+/BywpWFFUwm7DiGTNWgRjNgneOGcgp4yyUvjPuRYVH7z4U37lFWw HhpxfEuWz0uzDGSUdJs/zG2N9NjqMIIOBQ0sRPfcZOWkerj4KzNT6s+oMf/fNkWiQbsc iO3kk3q2tX/iWH4UBiTyT/ybdntXf5wzFZRjiGmo5PoLjxzwbax0ZtZK/T1ih2t+fHyL 0Ia+lG516Pkm1etESV2nZnI14kTFStD0M6MpZH+/HyFf+KrGuOHM5ctq8UvcMcYM9Eis c64w9vTjE/yX1Z+ebXVS4TUpKQXNaL7vwX0U5eYMymqj/9l4OsOKCM11BlJh3GvVgdUR jtOQ== X-Gm-Message-State: AOJu0Yw+SaMjc9Z0REkz09/9jdw/t5YaG9KnaRaVjlsBDCERloCR6e6W d7WQr4gCY6cnUXYEdB+/5wPxMZQaGqdP+P5OKPoZKEMk+yPnqg0QN0r6hq2Wb6g1Ng== X-Gm-Gg: AfdE7cmuw/UPJrgcfufopk6Sr6UXQrAEu6Y9K5jXDO13doHuVtNklvyReia4l3tjp8o Zd1y+YRU8U9sI2M3f+Eb0Dn4vqvCkuq8BOJtwyaLT1GHJowU2o8mEWT1N++0zK1Gd95b28mFh81 MK7EadcX7BbSQOINbM0o8MbyCb5Hu+zCtA0hPw9SgKVdxq60+UsABE0kxd5kOk34Wmv8df2jgva 3dWDYxiJSJSRkAF2Vuvnb3ptSCxzK04Q3+kpmfnqinFd1HWI/msakLJ0UOY1mMMtFjRh1tKWmKl ETRbq1WUxL8uQnRYEnAxUpwtT96gfR8bw1QPSsJFqFDB4FTWMJfSR3Mzp0B0X5TZEuDupLCXH5p yAxYEHZc7cV71fa+G7b6RgWqm01Ch53qEafCiH2YHv5QIUXoiZ32nAOEvBNYj9z9okSBuzpbkPS 4TrzifHlLfo8P9cZJkS59sc4r6cwlXc/NUfFNCtLgKf0ZhgwCI X-Received: by 2002:a05:600c:6085:b0:493:ae5f:d29f with SMTP id 5b1f17b1804b1-493f8bc151fmr2729225e9.3.1783883980658; Sun, 12 Jul 2026 12:19:40 -0700 (PDT) Received: from google.com (220.60.76.34.bc.googleusercontent.com. [34.76.60.220]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493fbae1cdbsm124580445e9.10.2026.07.12.12.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 12:19:39 -0700 (PDT) Date: Sun, 12 Jul 2026 19:19:35 +0000 From: Mostafa Saleh To: Fuad Tabba Cc: 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, vdonnefort@google.com 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Hi Fuad, On Sun, Jul 12, 2026 at 05:19:22PM +0100, Fuad Tabba wrote: > Hi Mostafa, > > On Sun, 12 Jul 2026 at 16:38, Mostafa Saleh wrote: > > > > When the hypervisor tracing (CONFIG_NVHE_EL2_TRACING) is disabled, it > > defines a static inline stub for trace_clock(). > > > > However, trace_clock() is already declared as an extern function in > > linux/trace_clock.h which is pulled in EL2 compilation. > > The rename itself looks correct and complete: all three sites (the > declarations and stubs in nvhe/clock.h, the definitions in clock.c, > and the two callers in trace.c) are updated, and no other reference to > the old names remains under arch/arm64/kvm. > > Two small things... > > > > > If the file is included when CONFIG_NVHE_EL2_TRACING > > is disabled (by including it manually in setup.c) it will cause: > > In file included from arch/arm64/kvm/hyp/nvhe/setup.c:22: > > > > ./arch/arm64/kvm/hyp/include/nvhe/clock.h:14:19: error: static declaration of ‘trace_clock’ follows non-static declaration > > > > 14 | static inline u64 trace_clock(void) { return 0; } > > > > | ^~~~~~~~~~~ > > > > on GCC and a linker error on LLVM (it seems to change the linkage to > > global) > > > > Although that is not a problem at the moment, as no other files > > include . That does not seem to be the intent of > > this code and that will cause issues with more users as the SMMUv3 > > driver. > > > > Signed-off-by: Mostafa Saleh > > > > -- > > git am only treats a three-dash "---" line as the scissors; the "--" > here is two dashes, so mailinfo keeps everything above the diffstat. > Worth a "---" on the repost so the note stays out of the log. > ops, I will fix that. > > 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 :) Yes, that shouldn't be a problem, I just added hyp_ prefix, but I am ok with any suggestions! Thanks, Mostafa > > Reviewed-by: Fuad Tabba > Tested-by: Fuad Tabba < fuad.tabba@linux.dev> > > Test: builds fine with the different config enables. > > Cheers, > /fuad