From nobody Sun Feb 8 05:55:00 2026 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 CFB7B34F49B for ; Tue, 23 Dec 2025 20:20:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766521256; cv=none; b=WQr9RvSJx3Jv0GtARdco3+cigXryA+6ke8qEBUnNrzX7oCxIkCh7MAoG76i37wycDDjD72tfTwhwAEavVNA89W5vbQ4+wepTFopTTClmpagqCIEk8b42Vr7aUPbSp6OLGAqbLPzntlq+jNf4N3XLiymSRzCXk6BLlIbh8wukQYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766521256; c=relaxed/simple; bh=Fap4dzvqS7aEWoYiTrUtxE9+Mc6X0pvPwNckvkCiCSM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Hx2gcoeRTVhK7r+b6bwvFqQ0LGutkzzmCa6EP+f0+wFC2TuZVOCmAA3/6ZdNb85HPD7Cye+A1FJP5ejy1Kv9u8uKHSrQuIaCbk2W7jKm6AgscJLuauQI96irq+2OspXGEYotIKzeWgvK0SnptSXWSw/V2OOWVsc3r2C2pU7qNcA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eI7tg6om; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eI7tg6om" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-64d2c50f0d6so4214881a12.3 for ; Tue, 23 Dec 2025 12:20:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766521252; x=1767126052; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QRGzBsOiCH2SoWHbAYqLbD7CkoVm8aBS7G/P/WUjHt4=; b=eI7tg6omN5WLkbFNK7AHjXJoJdv300QeOLQCet2wJ9m/2OeyXHYYw86llhVFaIsSsN UBmiOof72u4vbDx7viLxgQvBWW0I+kk31AM3GMd5wvhXM8nnwK61W1vGxbuurlzGEK+Z kLr7KboNp0uNHbDIRMn9fHxscvK9bweBYu5GKd1gwgqZZOT8leFPop0PNBuTEEloaU5q 0K/EDin7Km0u+PptLDLk/VZe+DKNjVde9wyCt2/fTF5qChptu0f0uxkX7QVBaRI6/sBr lvCkYxwOewRnxHawBkyM//Z+OfTN7QZK8TKD1j7FCvr/jiwdA1nk3/I+JQa3aRDpQYIT Y3Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766521252; x=1767126052; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QRGzBsOiCH2SoWHbAYqLbD7CkoVm8aBS7G/P/WUjHt4=; b=d0tMpbwXRJcwBPDdGGFqsWabTNWzvECdBDH0WdC9RXT7FJdjXL1Cadi6wOdPfLN0Z3 MpPn2i/Dj/0qqL9x81muxUflAc54DWnOPphacx2dGdgCOgxD4pYyE2Jvx6JNMPRnufhF kE3W7yPI3LgAyn91IgMUNJaZLtegZroTnPPoaiwDCZvrFoGSRlT1kNdQcrEIHxbvesld pN6q9wbPU4F3oSySpVdiG+AXQCZiKoWB0Ot+Z1Wmzxw80hIWc4QwkWB0Ji69/jVpBUh6 xBkV+j//MMJfa7YZ1uRkR+Z86ZFEtst4+M3Ybba7lvtOZrMJTjtHdmmTg0+V6Matk3lb 2Wyg== X-Forwarded-Encrypted: i=1; AJvYcCXjyyJBJcWK/mXfWeRl3drKStEMZvgiXiOznRnV3HFHX1dEA5PjfGLXUetI3zjOCdhHVgXxxswgEqxThDE=@vger.kernel.org X-Gm-Message-State: AOJu0YwfnfscZXbY9oDS/nUdh8UySt0V4gkZC+HNNKPjhVWUYPGdQlIj SZO4fhScZ2vFVOGh75+85pxnAr496y3uYMN+sqP/FQeHPUJcookozmG7 X-Gm-Gg: AY/fxX7YGmL9iLQznXSDenhWVQQWizibRdqn/eeACQzmvb9FVBOIVLI9DDBd2klJ00j nZ6JKhXP70sVG6yjKbQjQuISH31+YCiK23VgLYnoLTLzv72u20vqozywk7uugpF6xW5ypRG/Zft 44N9+WaJ6BwvKpovyOWCsPomDgu/8ouMuEdkdKnB8JdqeD/kKEwoOrTpciCEBDSNzJcPN3bqaiY igs/EMEJFzE7Wi6e2/Jl5jOKaHLV2MEmvbgZlawcdHcbRsYAFG+L+9CvHkUeK1IRyhX+e6jFQMx GrSCUIkIbx/2RRGKkIEKgLRFNFxRUOHsAdADAA8id3hM0jZtcIzegJFG18T/qpTMZ/8A8ITPJuw qwls0iHJMd5rkpp/N7U1yiBf0Wmc3t8kjQ1uO8STXAyeAWuO2k/LG5hlGIX3GPZ8nFdLgd1MqjB TwjinpyTCrLiOQjF2KFhP6GVe48FxbZFRqk3D/O9BzKp8= X-Google-Smtp-Source: AGHT+IETyWd+uT3WCjL/DyttBZRJAT99br/qspYA0txF59SLkKiZWJb7hHjhjTN3fmgqw5g/71IorA== X-Received: by 2002:a05:6402:2685:b0:64b:5c4e:e695 with SMTP id 4fb4d7f45d1cf-64b8edbb83cmr12564298a12.29.1766521251541; Tue, 23 Dec 2025 12:20:51 -0800 (PST) Received: from fedora ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-64b91599844sm14707177a12.25.2025.12.23.12.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Dec 2025 12:20:50 -0800 (PST) From: Uros Bizjak To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Uros Bizjak , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Linus Torvalds Subject: [PATCH 3/3] compiler-gcc: Remove obsolete RELOC_HIDE() macro Date: Tue, 23 Dec 2025 21:18:58 +0100 Message-ID: <20251223202038.91200-4-ubizjak@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251223202038.91200-1-ubizjak@gmail.com> References: <20251223202038.91200-1-ubizjak@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove the RELOC_HIDE() macro from include/linux/compiler-gcc.h. The GCC specific macro was historically used to workaround very old compiler bugs (including pre-4.1 ppc64 GCC). These compilers are long obsolete. The generic RELOC_HIDE() macro should be used instead. The removal of the GCC specific macro results in the following code size reduction: text data bss dec hex filename 28526453 4823511 737108 34087072 20820a0 vmlinux-old.o 28520945 4823463 737108 34081516 2080aec vmlinux-new.o ./bloat-o-meter vmlinux-old.o vmlinux-new.o add/remove: 4/14 grow/shrink: 189/674 up/down: 4433/-7865 (-3432) ... Total: Before=3D24103512, After=3D24100080, chg -0.01% Signed-off-by: Uros Bizjak Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Linus Torvalds --- include/linux/compiler-gcc.h | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 5de824a0b3d7..081e658754b9 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -10,31 +10,6 @@ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__) =20 -/* - * This macro obfuscates arithmetic on a variable address so that gcc - * shouldn't recognize the original var, and make assumptions about it. - * - * This is needed because the C standard makes it undefined to do - * pointer arithmetic on "objects" outside their boundaries and the - * gcc optimizers assume this is the case. In particular they - * assume such arithmetic does not wrap. - * - * A miscompilation has been observed because of this on PPC. - * To work around it we hide the relationship of the pointer and the object - * using this macro. - * - * Versions of the ppc64 compiler before 4.1 had a bug where use of - * RELOC_HIDE could trash r30. The bug can be worked around by changing - * the inline assembly constraint from =3Dg to =3Dr, in this particular - * case either is valid. - */ -#define RELOC_HIDE(ptr, off) \ -({ \ - unsigned long __ptr; \ - __asm__ ("" : "=3Dr"(__ptr) : "0"(ptr)); \ - (typeof(ptr)) (__ptr + (off)); \ -}) - #if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__) #define __latent_entropy __attribute__((latent_entropy)) #endif --=20 2.52.0