From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (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 3D6D11519B4 for ; Sat, 20 Dec 2025 20:53:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766264023; cv=none; b=AWXHrC9/03Fdlt6TvvAYW8i8J/5cnKA4GPF1FfHi5cOJGG2DOXyU03gmoa4OpD7v01ANLzsxjSKd7tG2sTT5KXAE0p7qTZuKOaVsIk7af4v0VBkHE9fbkSutOifuyH2G6Nvoj0e0QK58nwgsQRtkMaWOkI/KEVvpBErpInpK3b8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766264023; c=relaxed/simple; bh=K+KuHqJg1FRGblU6iiqUXxMI0JXi+aRJtcCkXuxtAok=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=urnJMGODTZi/NekhbeYzJnYwFEBLOZ2TOWBCnmF5KM22vYw01NJiWVfpcHS+mCV+opGn50dZ7FEVwbcR/gUqZVgrTz4U/c8PC7EtV9TsgdggnQ6Ak5XSHMARRGxHrXnSELBryAhgChcjh8+0IpBuu1SUKsLIwvRjyuslpcs2Ax8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=xbyUQdWU; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="xbyUQdWU" Received: from ehlo.thunderbird.net (c-76-133-66-138.hsd1.ca.comcast.net [76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 5BKKrXQ11956365 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Sat, 20 Dec 2025 12:53:33 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 5BKKrXQ11956365 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2025112201; t=1766264014; bh=o7GIzRu6Ys7F4oWVl0vSKQIgGvUZho4KeGQ1Ufp66Eo=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=xbyUQdWUbfU16/nhb7/NrLgBZ1Oq7f8aeRnQAQCOVSIErn09zpqHBtD3TmJ20BFCe +PQrgaOLau6FRaRQc5uYe3rpLV9Q9Qq/Vqbib1f6DjAhKdQZo4iI51md8uDyrJIdfc OwcQxmPLmX0xPDwwOmdfsLUO9U5O/bjZjEf5O+fPSz6yMMD+iRXtil2R9gQaYdH3Py z/5htPWrz4K/hyo8j67iGhjnLyhWBOEIhtnE++lcYqASL2GFLYm/oS7RUWFO3oaFnP oLShysJq0hawoayygyi6MiHwtEed59STDS0bN6AWAscN++rvrkHncsW3VzHYgzxlEG gJohOBXQKENvA== Date: Sat, 20 Dec 2025 12:53:31 -0800 From: "H. Peter Anvin" To: Uros Bizjak CC: Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , "x86@kernel.org" , LKML , Andrew Morton Subject: =?US-ASCII?Q?Re=3A_Do_we_still_care_about_compilers_w?= =?US-ASCII?Q?ithout_=5F=5Fseg=5Ffs_and_=5F=5Fseg=5Fgs_support=3F=3F?= User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: 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-Transfer-Encoding: quoted-printable On December 19, 2025 11:47:50 PM PST, Uros Bizjak wro= te: >On Sat, Dec 20, 2025 at 12:24=E2=80=AFAM H=2E Peter Anvin wrote: >> >> As of Linux 6=2E16, we require: >> >> gcc 8=2E1 or higher >> clang 15=2E0=2E0 or higher >> >> If my reading of the release notes is correct, then both versions *shou= ld* >> supported __seg_fs and __seg_gs, but we have: >> >> config CC_HAS_NAMED_AS >> def_bool $(success,echo 'int __seg_fs fs; int __seg_gs gs;' | $= (CC) -x >> c - -S -o /dev/null) >> depends on CC_IS_GCC >> >> We don't even try on clang=2E >> >> Being able to actually rely on the compiler for this would make a lot o= f >> things cleaner=2E For one thing, I'm trying to untangle a bunch of ugl= iness in >> the code sharing between realmode and proper flat mode code=2E=2E=2E >> >> Uros, you seem to have touched this code as recently as earlier this ye= ar; any >> thoughts? > >To enable __seg_gs support with clang, you will first need the patch at [= 1]=2E > >Second, clang does not emit %gs: prefix by itself when the address >from __seg_gs named address space is used in asm()=2E This can be worked >around by leaving __percpu_arg(x) defined to __percpu_prefix "%" #x >for clang=2E > >Finally, you will hit issue #93449=2E > >[1] https://lore=2Ekernel=2Eorg/lkml/20240526175655=2E227798-1-ubizjak@gm= ail=2Ecom/ > >Uros=2E > Yeah=2E It's sad that compatibility functionality seems to be as low on th= e priority list as it is=2E However, it looks like it might still be possib= le to do the boot code cleanups even within the limitations of the current = clang, bugs and all=2E=2E=2E