From nobody Fri Apr 3 06:26:50 2026 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 51111328B68 for ; Wed, 18 Feb 2026 13:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771422930; cv=none; b=sC8apdk5qc+YO2S1Gv5lH4KXJCjTVtqcgsV2uWOJli/2wZ2DJLW6Y/pzpad2/BIWnEbsQc7e+J6ElvwfSO+nu8sHrCZW6IspmOH4lWR0WRTKnB320GdOVgTKWRe1UsvA8DCwkJEQNOpO3Y+6bYBlN/75ypheSu+P0vvQ/ZdAaLE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771422930; c=relaxed/simple; bh=BiLneci1FK46sach3sdMy6tPWWE3BR2X5QIldl/JzEs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DW81vLBzWqTjN/ewAMX94QlgZp49sPLvxYFdXsY0V3aSHpInQ43r3zskR5GBFoVqw5OiJJjr7oQlawjZyWfo//czq9NM5qpiBwLY3TQALm7DFk4PzqZ15qr+LPc7hEXKEiVQK0owoc7uCFWLhuRarnDPRoiTTCPF+uDQ56JRV7U= 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=gOgbnjq4; arc=none smtp.client-ip=209.85.128.48 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="gOgbnjq4" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-482f2599980so58258085e9.0 for ; Wed, 18 Feb 2026 05:55:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771422928; x=1772027728; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qpUqZ44H6ppPXVfHdsCSm6rNqXBhx7MqHmFJNrZutq4=; b=gOgbnjq4QuLfoae7C8S25T3bqji8ZUJz7sXnOk7wUH8bht+fTzUbjVTcApQy6E3qhd 8MSFh71sa8kY7EbCXcRTqvOqu0ru0bspxGMT2jw5y/rkDc2mm/jnhIxfvyAs5ZYzWH0R 7XtLSaCrvRkoq6oJbm1saSce5OVKngaT2vVMlm68kdduvOD92MbiH+LqzWpu2+2zoBUh 7rZXBbeLUdft9uwfL/iVA7OlHkbBxmXcNV+aKvIqG/EYqie+9xwWdn4jWWob0R5k0QNa 77GBGovi2GGNX9hoLvBe4kbZ2GOFItSfnPv1VEC08YdWcaoj5TQ30hhl/HVK2AeFlVxW 7XhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771422928; x=1772027728; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qpUqZ44H6ppPXVfHdsCSm6rNqXBhx7MqHmFJNrZutq4=; b=wlUGsRLvM3DwDaMaZFyOuBXGjkg8/BBQbtE3qmf5PimCQ3885d51/6cyXxSk08l+8c wS9D41bxas3Y+v0IUfWC8Mz7bGd+RTLQ2JxEkbutCfRirqzcNGsmLOBoAn1nwBYcwPnD ZNUWP6fJOx2S4ZUBIB3QkDXjGeg6ZpOBEwWIHsrU88wRh+yJlem6UrcxOIQnWszvrnRu qGk40zDLMhoUxIbjUH340O9jw+t9ZUwPyi3MWCjIfLxrISxdeGz3rZN5Exzt3yHwdSUl nXmEXaFWHZo1ukFPJWgH16OtGNOxDnuReW8SvypMDr6oZLoph/RFzfDTtvTD/tZtQu41 FKyA== X-Forwarded-Encrypted: i=1; AJvYcCXklKNRaoNwAGQ3qb8Bnw8JB0N+XofB4IfHti1Rau+puDtblkG3/evV9YOAPcabhq9zCVrJ06otkh07HuE=@vger.kernel.org X-Gm-Message-State: AOJu0YwH6u8EPYzpMSyky7ETHb1kmJRcbTwWbtnUwGc8jEZhhZTHA559 iOjEoZs8OfAnimw1gnY20rR6/wYG71Ossuz0HLziUEOMaOiXxoR9nPSo X-Gm-Gg: AZuq6aKW4DY6NNS1JuiLUg/04bmtd0FbahwpKPb/35ibkXQAd3srTRw2S66s84Ao3vl 2sDNJEmPgxeblVR+cL6ZAU/Cn9I45zGwUAUwcDKEBjNztJqrLdfP0fKGjDwFWIDq4+HRE0oSQO3 77CCNArANBvcacj7wv0iTn2IAbsjL3RTq7Jau+77ThOxf3gtlr4ctRqgfglpP6+vKXDE46cdWFq UyUcjz+QaqNbGlzI3fESbg3oB24A56+Zg8K9peZyZHOJq6GK+M+5SSNByQqAxpcUg23J9AeTfBm iZlJ9VUAu6dSh11Vt76B31Llmr7TCcamwu2Aahewf2pdR7/lQSrnkqzu/M+UHrvhnyAnbAP1Wi8 B+5kgMD18+rFZRCJgcu7Z/NMFnywBYJc3U9rg+V3FVFSrKBYVtFhJ7JuNhqOkv8FLtv2zwTbfwv oiD7rT41zIBp3ycvI2h8DFmurSmFqTKpxaoPxJEGwFBANBJkF1CSOcNOOjspQ9D8aPLSLGrtB1+ WqvVQ== X-Received: by 2002:a05:600d:6402:10b0:483:887:59b0 with SMTP id 5b1f17b1804b1-48398f3c672mr31886705e9.35.1771422927531; Wed, 18 Feb 2026 05:55:27 -0800 (PST) Received: from localhost.localdomain ([196.119.106.230]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d835f6bsm571019305e9.14.2026.02.18.05.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Feb 2026 05:55:27 -0800 (PST) From: redacherkaoui To: tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, ardb@kernel.org, redacherkaoui Subject: [PATCH] x86/boot: fix boot decompressor malloc() prototype for GCC builtins Signed-off-by: redacherkaoui Date: Wed, 18 Feb 2026 13:54:47 +0000 Message-ID: <20260218135448.107114-1-redacherkaoui67@gmail.com> X-Mailer: git-send-email 2.43.0 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" --- arch/x86/boot/compressed/misc.h | 11 ++++++++++- include/linux/decompress/mm.h | 10 +++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/mis= c.h index 4f86c5903e03..de36a2dbd096 100644 --- a/arch/x86/boot/compressed/misc.h +++ b/arch/x86/boot/compressed/misc.h @@ -61,7 +61,16 @@ extern char _head[], _end[]; extern memptr free_mem_ptr; extern memptr free_mem_end_ptr; extern int spurious_nmi_count; -void *malloc(int size); + +/* + * boot/compressed uses the tiny allocator from include/linux/decompress/m= m.h. + * Name is "malloc" but it is *not* libc malloc(). + * + * Keep this prototype in sync with mm.h. Use unsigned long to match the + * compiler builtin signature on x86_64 (size_t =3D=3D unsigned long). + */ +void *malloc(unsigned long size); + void free(void *where); void __putstr(const char *s); void __puthex(unsigned long value); diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h index ac862422df15..af506c40032e 100644 --- a/include/linux/decompress/mm.h +++ b/include/linux/decompress/mm.h @@ -39,12 +39,16 @@ STATIC_RW_DATA unsigned long malloc_ptr; STATIC_RW_DATA int malloc_count; =20 -MALLOC_VISIBLE void *malloc(int size) +MALLOC_VISIBLE void *malloc(unsigned long size) { void *p; =20 - if (size < 0) - return NULL; + /* + * This is a tiny pre-boot allocator; callers should never pass a + * negative size. Use an unsigned type to match compiler builtin + * expectations (size_t on x86_64 is unsigned long) and avoid + * -Wbuiltin-declaration-mismatch under -Werror. + */ if (!malloc_ptr) malloc_ptr =3D free_mem_ptr; =20 --=20 2.43.0