mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Mauricio Faria de Oliveira" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Mauricio Faria de Oliveira <mfo@igalia.com>,
	"Borislav Petkov (AMD)" <bp@alien8.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/boot] x86/boot: Remove redundant "cc" clobber in memcmp() and document it
Date: Wed, 23 Sep 2026 05:52:34 -0000	[thread overview]
Message-ID: <179014275415.2819794.14495523541088141017.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260921-pvh-kasan-inline-v10-1-08da47943d8e@igalia.com>

The following commit has been merged into the x86/boot branch of tip:

Commit-ID:     94509668fccfa098e0a3d57e7093a9afd88aea9f
Gitweb:        https://git.kernel.org/tip/94509668fccfa098e0a3d57e7093a9afd88aea9f
Author:        Mauricio Faria de Oliveira <mfo@igalia.com>
AuthorDate:    Mon, 21 Sep 2026 22:36:32 -03:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 22 Sep 2026 18:22:38 -07:00

x86/boot: Remove redundant "cc" clobber in memcmp() and document it

The "cc" clobber remains recognized for source compatibility, but it has
no meaning anymore; it is automatically generated without condition-code
constraints:

  https://lore.kernel.org/all/57b0d188-b256-bde4-43e6-99dae4f59d60@suse.de

Comment out the redundant "cc" clobber for documentation purposes.

  [ bp: Massage commit message. ]

Fixes: a8c171c107c0 ("x86/boot: Add volatile, clobbers and zero-length test in memcmp()")
Reported-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260921-pvh-kasan-inline-v10-1-08da47943d8e@igalia.com
---
 arch/x86/boot/string.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 1632d40..e10260e 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -36,11 +36,15 @@ int memcmp(const void *s1, const void *s2, size_t len)
 	/*
 	 * Make sure ZF is properly set in the len==0 case because in it,
 	 * RCX==0 and the REPE; CMPSB won't get executed.
+	 *
+	 * The "cc" clobber has no meaning anymore, just source compatibility.
+	 * On x86 the flag status bits are automatically added to the clobber
+	 * set when there are no =@ccXY constraints. Keep it as documentation.
 	 */
 	asm volatile("test %3, %3\n\t"
 		     "repe cmpsb"
 		     : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
-		     : : "cc", "memory");
+		     : : /* "cc", */ "memory");
 	return diff;
 }
 

  reply	other threads:[~2026-09-23  5:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  1:36 [PATCH v10 0/4] x86/pvh: fix unbootable VMs again (PVH + KASAN) Mauricio Faria de Oliveira
2026-09-22  1:36 ` [PATCH v10 1/4] x86/boot: comment out and document redundant "cc" clobber in memcmp() Mauricio Faria de Oliveira
2026-09-23  5:52   ` tip-bot2 for Mauricio Faria de Oliveira [this message]
2026-09-22  1:36 ` [PATCH v10 2/4] x86/asm, x86/boot: expose inline memcmp() Mauricio Faria de Oliveira
2026-09-23  5:52   ` [tip: x86/boot] x86/asm, x86/boot: Carve out inline memcmp() into a separate header tip-bot2 for Mauricio Faria de Oliveira
2026-09-22  1:36 ` [PATCH v10 3/4] x86/asm: group inline string functions Mauricio Faria de Oliveira
2026-09-23  5:52   ` [tip: x86/boot] x86/asm: Group " tip-bot2 for Mauricio Faria de Oliveira
2026-09-22  1:36 ` [PATCH v10 4/4] x86/cpuid: fix unbootable VMs by really inlining memcmp() in cpuid_base_hypervisor() and xen_prepare_pvh() Mauricio Faria de Oliveira
2026-09-23  5:52   ` [tip: x86/boot] x86/pvh: Really inline memcmp() and memset() to fix unbootable VMs tip-bot2 for Mauricio Faria de Oliveira
2026-09-22  3:58 ` [PATCH v10 0/4] x86/pvh: fix unbootable VMs again (PVH + KASAN) Borislav Petkov
2026-09-22 22:13   ` Mauricio Faria de Oliveira
2026-09-23  1:12     ` Borislav Petkov
2026-09-23 12:41       ` Mauricio Faria de Oliveira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179014275415.2819794.14495523541088141017.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mfo@igalia.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®