From nobody Sat Feb 7 17:55:35 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68C5D6BFC0; Thu, 8 May 2025 08:57:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746694676; cv=none; b=iAMeXG8gy6EkraG9iKYNkxCWbnK6uevMLTEjm99RSUePTO9cae5BXApgD+fJxZ8y/6d18zPkG50gt7HHSHumZSUlvQ67uCSLU9OFbePbjLHSMSSAelyKcyuVFyw2Ks47429i8ZximnnrEUTMMUULhHuhRt59AouwX+W/LhFQPj0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746694676; c=relaxed/simple; bh=wHPATXC9LkJsZRMeS2x8lNdgUXoYaxjzLb5iBN80POk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JniV7WAaodf2rj7jbpn/PQTnwgV3XAFYi9kv0UXCpGlX7wKh6f9iHDES8A2lI/Z9PBXKZs0l45UZmOwE3injKVNhF18+Apv4KJvxaTCnEd6J8SLlkQqCLzDXa/LS44Z/x3LdFXmootBM30TNKNB/q0xGHbvPA1uVhYIw/7cQzv4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m+bi/J7r; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m+bi/J7r" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48B85C4CEEB; Thu, 8 May 2025 08:57:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746694675; bh=wHPATXC9LkJsZRMeS2x8lNdgUXoYaxjzLb5iBN80POk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m+bi/J7r34LfUr94fxQXkxjMN93ATfTaQ26PPYNkdilIHd3MkJ78rtWPVgL7iTZ3c DZZEL8XgkNfveoCLgQemc6R6LWGfBb98fV4a/b9oqP+4ttnKUy7KLhFbwHZYBtQgKE kaWTMbPIwphXJyXeF3QoOwjNv4B7c7egGeE/fiAzh57y9UdQx0acsfVHhWmVHBeeGu DcDcmZlpKWfcHJfQeAwvwfTyo7RyhpSvmnPKdUhic3BKS8Gh7m0ZLad/d4DcHQhLaA hPd5scmwhnFt8Acf71o5Tz8i1C/PxZyzByZBIDgJd0u2pznhweP4PDli34VM/Wrnn/ vaGJoIVprpjpQ== Date: Thu, 8 May 2025 10:57:51 +0200 From: Ingo Molnar To: Johannes Berg Cc: "linux-kernel@vger.kernel.org" , "linux-tip-commits@vger.kernel.org" , lkp , "x86@kernel.org" , linux-um@lists.infradead.org Subject: [PATCH -v2] accel/habanalabs: Don't build the driver on UML Message-ID: References: <202505080003.0t7ewxGp-lkp@intel.com> <174664324585.406.10812098910624084030.tip-bot2@tip-bot2> <007a7132d1396912b1381e96cc4401a10071ed24.camel@sipsolutions.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <007a7132d1396912b1381e96cc4401a10071ed24.camel@sipsolutions.net> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" * Johannes Berg wrote: > +linux-um >=20 > On Wed, 2025-05-07 at 18:40 +0000, tip-bot2 for Ingo Molnar wrote: > >=20 > > To resolve these kinds of problems and to allow to be inclu= ded on UML, > > add a simplified version of , which only adds the rdtsc() de= finition. >=20 > OK, weird, why would that be needed - UM isn't really X86. >=20 > > arch/um/include/asm/tsc.h | 25 +++++++++++++++++++++++++ >=20 > Feels that should be in arch/x86/um/asm/ instead, which I believe is > also included but then at least pretends to keep the notion that UML > could be ported to other architectures ;-) >=20 > > +static __always_inline u64 rdtsc(void) > > +{ > > + EAX_EDX_DECLARE_ARGS(val, low, high); > > + > > + asm volatile("rdtsc" : EAX_EDX_RET(val, low, high)); > > + > > + return EAX_EDX_VAL(val, low, high); > > +} >=20 > Though I also wonder where this is called at all that would be relevant > for UML? If it's not then perhaps we should just make using it > unbuildable, a la >=20 > u64 __um_has_no_rdtsc(void); > #define rdtsc() __um_has_no_rdtsc() >=20 > or something like that... (and then of course keep it in the current > location). But looking at the 0-day report that'd probably break > building the driver on UML; while the driver doesn't seem important we > wouldn't really want that... >=20 > Actually, that's just because of the stupid quirk in UML/X86: >=20 > config DRM_ACCEL_HABANALABS > tristate "HabanaLabs AI accelerators" > depends on DRM_ACCEL > depends on X86_64 >=20 > that last line should almost certainly be "depends on X86 && X86_64" > because ARCH=3Dum will set UM and X86_64, but not X86 since the arch > Kconfig symbols are X86 and UM respectively, but the UML subarch still > selects X86_64 ... >=20 >=20 > I dunno. I guess we can put rdtsc() into UML on x86 as I suggested about > the file placement, or we can also just fix the Kconfig there. The Kconfig solution looks much simpler to me too :) Patch attached, does this look good to you? Thanks, Ingo =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> From: Ingo Molnar Date: Wed, 7 May 2025 20:25:59 +0200 Subject: [PATCH] accel/habanalabs: Don't build the driver on UML The following commit: 288a4ff0ad29 ("x86/msr: Move rdtsc{,_ordered}() to ") removed the include from the accel/habanalabs driver, which bro= ke the build on UML: drivers/accel/habanalabs/common/habanalabs_ioctl.c:326:23: error: call t= o undeclared function 'rdtsc'; ISO C99 and later do not support implicit fu= nction declarations [-Wimplicit-function-declaration] Make the driver depend on 'X86 && X86_64', instead of just 'X86_64', thus it won't be built on UML. Suggested-by: Johannes Berg Reported-by: kernel test robot Signed-off-by: Ingo Molnar Cc: Ofir Bitton Cc: Oded Gabbay Link: https://lore.kernel.org/r/202505080003.0t7ewxGp-lkp@intel.com Reviewed-by: Johannes Berg --- drivers/accel/habanalabs/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/habanalabs/Kconfig b/drivers/accel/habanalabs/Kc= onfig index be85336107f9..1919fbb169c7 100644 --- a/drivers/accel/habanalabs/Kconfig +++ b/drivers/accel/habanalabs/Kconfig @@ -6,7 +6,7 @@ config DRM_ACCEL_HABANALABS tristate "HabanaLabs AI accelerators" depends on DRM_ACCEL - depends on X86_64 + depends on X86 && X86_64 depends on PCI && HAS_IOMEM select GENERIC_ALLOCATOR select HWMON