From nobody Sun Feb 8 10:34:13 2026 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) (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 947E634D3BE for ; Tue, 23 Dec 2025 20:20:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.67 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766521254; cv=none; b=bhP2m0sO8JE5lVRWqzxoMHDKat17aGcxd1KpTuBBkKSDXx3EV4ie/D26Nokk25JaWTb8HBkoBJxeoPcO1BTm3d3M+WRxaL9afKT0xqve/Vjl6kd/uFHFFfkMQNG5xfXE6N3FqK8t+YcK3Mw/XR0VeDnY9GzZk0xDEzuAsEud9Tk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766521254; c=relaxed/simple; bh=ms1zZeiQfEjd3f4G2q7OYjPMPVH6vxabg3pLiE8b8uM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZxDaBiuq850xfWZ7UAAVz0TzfdioivYj7EiXkpMK2mhjIavR8EeyaHcXoJFDmtHo29zK9VtpQIRFo4pg6zW0zzd1FMRAy+pFhPSTEhFoquvPrBUGXQ5lVecdKyu2XRtworKX5sKOMBVnI+H5FONKG4/kXfKV6C2pRVj7bHJWtR8= 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=jkNu26KJ; arc=none smtp.client-ip=209.85.208.67 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="jkNu26KJ" Received: by mail-ed1-f67.google.com with SMTP id 4fb4d7f45d1cf-64b61f82b5fso7020605a12.0 for ; Tue, 23 Dec 2025 12:20:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766521250; x=1767126050; 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=na9YxYYO7P8v4DQcfqJUIioved/R6y06CaLpOWA32xk=; b=jkNu26KJfXxUuvcZDt9WDtFWLpiptZH0hjRToK0QPFjJ9/P0+xY/1Vj2tKmKhf0hTK 6wV4ZOrvZ9DE/NdTE/rBlZRUedk8ukiyCLju2i9FTHJ4bIHReCnEdujLawlEWjyJot1o L4VaBv+w5pZwF7J9WudkIBwAbcMKLelHZKADMHjmALXQa6ynKVBvYQycngiPPWP1q30H ar97rzefcffbdRlkWgySup3/gDga19CG8VHC680Kx2swENCgujgURPIwh+Z1fv/uui5L HOFBltFChDjpiBHd8athsyowj0//Unp/h/HOCxZTy1pNRvwVQBQxBfKIHLOdcZzN4zPN DwsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766521250; x=1767126050; 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=na9YxYYO7P8v4DQcfqJUIioved/R6y06CaLpOWA32xk=; b=N/ow7I3fMGD07Avd6kVKcBPtHGwoOSRzwJeE04hN1COLy7BPjwxnOEYrSP43ACAs/N Q8yRbev/cNxekmdozhjhlwc+eFhzTYr1np45zRDy3KldGUt7jLIIWeo1OedoC7shPwxk l3Hbq4sYUUsc/TkOun4RNvEznKL0sE7ah12nnuwcOCSqc75a5arGpoTfV4kXBveOEn+E BEQsmiHhC9ms5E6hUUgXfx9lNl7h1qN8dNvdGaNpKqx7Yg9L4npRudz95t1fuM7ioq9t m60baw4TsmlgRtYxj1T8n8fBjYYT6QGYUpkYEAVZgiWV2/8ZW8ItV1lXhB44MZjBX0bm 7PCg== X-Forwarded-Encrypted: i=1; AJvYcCXSJT3ovDsPyPVy0q6zghdnFneUYOT9351QhaKHALHIo82SVh3/x1zllEfzZBRuEhXuXNCWta7J5/wlHaQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxPgylrDJD9BbS+1sO/4Q477QAWqyC8e5blX8WkwmFmaLYNSGRB G4y+VfKPXbaizfIX/Bs/mI9wNo43Qu7aJq4423/HG7As2AB2+afDW6Ef X-Gm-Gg: AY/fxX4Jm/FHkEean+MWN51foy5jPX7Z2AiYk/DRanki1Ac9YGO04HMIBshlni7IVxH wF3v5ojKYofck5dZ9xgAU/hOg4YF+g+fll8O5IohlR0kkHNf0sTkBrJEIOEnwahbiHKi+Z142s4 8XuWeH+zSgn2ZChI5IaHqVyMT90wKJterADGcCmdtJoV23GgJQ1DZUlhNc6kTFsT0h/q0o70Sw/ 8ipGZthaQGvMhe5giYOHFjouDh4XIHU1mNaB2VTR1621oapY4Pfe+gXi52L1SLjJtumv7Nuk02b OardeXg30onDZen5UbVFPMJ5FeGMdaE06qFYusnTwAWc0MhvTer46Zk0XjHLH9TNBFo1v+CN+FZ IiavvcBdKQwZ23+8au+cLo2n+WhxwpPqaWsdtD00aaTh0VIj6xn4hOQ6EX3ppZ9oKOo5It6sBt/ IH3RY+yIodtxBE+dFiFutRGL0h69Dr1NR0LRV7X2pTGUgBACj6sKM6DQ== X-Google-Smtp-Source: AGHT+IEHHthUaSRWAxw10vJbbtOB2NNqYykQoeuSuWcza8ElwBqfBfecJqUti/qYyZ0k+9X4qoKS5w== X-Received: by 2002:a17:907:94cf:b0:b7d:1a23:81a0 with SMTP id a640c23a62f3a-b8037297276mr1426200466b.63.1766521249655; Tue, 23 Dec 2025 12:20:49 -0800 (PST) Received: from fedora ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-64b91599844sm14707177a12.25.2025.12.23.12.20.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Dec 2025 12:20:48 -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" Subject: [PATCH 2/3] x86/boot: disable GCC min-pagesize assumption in boot code Date: Tue, 23 Dec 2025 21:18:57 +0100 Message-ID: <20251223202038.91200-3-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable GCC treats absolute addresses smaller than min-pagesize param (defaulting to 4kB) as assumed results of pointer arithmetics from NULL. The following code, when compiled with -O2 -Warray-bounds (included in -Wall): int foo (void) { return *(int *)0x123; } will emit a rather cryptic warning: warning: array subscript 0 is outside array bounds of =E2=80=98int[0]=E2=80= =99 [-Warray-bounds=3D] 1 | int foo (void) { return *(int *)0x123; } | ^~~~~~~~~~~~~ cc1: note: source object is likely at address zero Currently, the warning is supressed by the GCC specific RELOC_HIDE() macro that obfuscates arithmetic on a variable address so that GCC doesn't recognize the original var, and make assumptions about it. The GCC specific RELOC_HIDE() macro was introduced to work around certain ppc64 specific compiler bug in pre-4.1 GCC. This bug was fixed long ago, and replacing GCC specific macro with a generic one triggers the above warning in copy_boot_params(). The early boot environment does not guarantee any minimum page size, so explicitly setting the minimum page size to zero by adding --param=3Dmin-pagesize=3D0 to the compiler flags when building the x86 boot code with GCC inhibits warnings for addresses below 4kB. The option is guarded by CONFIG_CC_IS_GCC since it is GCC-specific. No functional changes intended. Signed-off-by: Uros Bizjak Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" --- arch/x86/boot/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index 3f9fb3698d66..372e67d2a855 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile @@ -55,6 +55,9 @@ KBUILD_CFLAGS :=3D $(REALMODE_CFLAGS) -D_SETUP KBUILD_AFLAGS :=3D $(KBUILD_CFLAGS) -D__ASSEMBLY__ KBUILD_CFLAGS +=3D -fno-asynchronous-unwind-tables KBUILD_CFLAGS +=3D $(CONFIG_CC_IMPLICIT_FALLTHROUGH) +ifdef CONFIG_CC_IS_GCC +KBUILD_CFLAGS +=3D $(call cc-option,--param=3Dmin-pagesize=3D0) +endif =20 $(obj)/bzImage: asflags-y :=3D $(SVGA_MODE) =20 --=20 2.52.0