From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) (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 3907B361657 for ; Sat, 22 Aug 2026 18:33:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.97.179.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787423597; cv=none; b=KYP8qAQCHdLApNyVnNJVbmz9LUjgJaA6Z5U7EQneQve35XXRPgRseN6WBwiwZLvzfWApKIDOKviTVZNU2NStu99SzwT+z7w8Mbw2bLjN3V99rNBFTMh1M8IIbBvPM1fck/E0sPB11crP411cAxF/g/n1l2pQpocCflLXOc9cJdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787423597; c=relaxed/simple; bh=Bpa6wQ+Om3zM4glj2pBixglyuBEGHYawNzswq+Z1DyE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E4kIOFZ/43/OIbpru7rOtoYrpvYmQ/XsFIHuSiOGuhY5sDmJHRCfLOiEsWm5A4vLDbejX+Q7e5U8GFT3ce9De+nfBUtgOY+sS8Q8YmzbYBWeOk7HLkY6qARhHOrQUjnD/CrGMB069ZVhjF64da5qF48r6Xze84INSkE0udYS4EI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=cP6yEYns; arc=none smtp.client-ip=213.97.179.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="cP6yEYns" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type: MIME-Version:Subject:Date:From:From:Reply-To; bh=n2eXcmcuOEY5+UkfCm5BTRwUz6gPnjMX1HXpAy+v/E8=; b=cP6yEYns8j2dRwJXrWoFYQ5BVR qfq6ToaLjISpVJANbLI3P1DvSluu2WkFJEVIqY4tE2Z7T9SwN1Jdw+eF0y1CxZ7RmG92O2tAcRVkv LjqxzDHDLDiX7wDdGalIqKDBD+LU6DXJEezoQ06jxmkGwWW/1jdUEHTdES/+mh1beEwdMW3c3i8Ds VPHlyVJd8FnmCKFLJaEuusG1OuniSIPpRQmnWuyT9gp9r16spbqif03L9VUxfuKJBW+GaPwopDlHF GXkGqQWsMf8e6DlaWBbu6z1gw/Ypw830A2mbdmFKoQlrvC24qcuV3zeLzYdBYueKWItwzWNzzvZ3n e5tBH3ow==; Received: from 186-249-148-4.shared.desktop.com.br ([186.249.148.4] helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1wxqWY-007bWT-8S; Sat, 22 Aug 2026 20:32:58 +0200 From: Mauricio Faria de Oliveira Date: Sat, 22 Aug 2026 15:33:17 -0300 Subject: [PATCH v9 1/5] x86/boot: Remove "cc" clobber from memcmp() 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: 7bit Message-Id: <20260822-pvh-kasan-inline-v9-1-e70ef3b75b6a@igalia.com> References: <20260822-pvh-kasan-inline-v9-0-e70ef3b75b6a@igalia.com> In-Reply-To: <20260822-pvh-kasan-inline-v9-0-e70ef3b75b6a@igalia.com> To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Juergen Gross , Alexey Dobriyan , Boris Ostrovsky , Jan Beulich , Brian Gerst Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira X-Mailer: b4 0.14.2 According to the GCC documentation, conditions in the flags register (e.g., "=@ccnz") are output operands [1] and the compiler is aware [2]. Also, clobbers (e.g., "cc") may not overlap with an output operand [2]. Thus, remove the "cc" clobber as it is redudant, and overlaps with, the "=@ccnz" output operand. """ 6.11.2.4 Flag Output Operands On some targets, a special form of output operand exists by which conditions in the flags register may be outputs of the asm. [...] 6.11.2.6 Clobbers and Scratch Registers While the compiler is aware of changes to entries listed in the output operands, [...] Clobber descriptions may not in any way overlap with an input or output operand. [...] """ Reported-by: "H. Peter Anvin" Link: https://lore.kernel.org/all/5e19b195-0ca2-4510-81cb-497b40e4aaf5@zytor.com/ Fixes: a8c171c107c0 ("x86/boot: Add volatile, clobbers and zero-length test in memcmp()") Signed-off-by: Mauricio Faria de Oliveira Link: https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Flag-Output-Operands [1] Link: https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Clobbers-and-Scratch-Registers-1 [2] --- arch/x86/boot/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c index 1632d40e1f545ae0665597069b568ea6b6c263e5..03278b4393887cb71cb063818d3378c4f52b06f8 100644 --- a/arch/x86/boot/string.c +++ b/arch/x86/boot/string.c @@ -40,7 +40,7 @@ int memcmp(const void *s1, const void *s2, size_t len) asm volatile("test %3, %3\n\t" "repe cmpsb" : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len) - : : "cc", "memory"); + : : "memory"); return diff; } -- 2.47.3