From: Mateusz Guzik <mjguzik@gmail.com>
To: tglx@linutronix.de, bp@alien8.de, andy@kernel.org,
akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
Mateusz Guzik <mjguzik@gmail.com>
Subject: [PATCH 1/2] x86/callthunks: s/bcmp/memcmp/
Date: Sat, 23 Nov 2024 10:47:28 +0100 [thread overview]
Message-ID: <20241123094729.1099378-2-mjguzik@gmail.com> (raw)
In-Reply-To: <20241123094729.1099378-1-mjguzik@gmail.com>
bcmp() is implemented as a call to memcmp() and callthunks is the only
consumer.
Use memcmp() directly so that bcmp() can get retired.
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
---
arch/x86/kernel/callthunks.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/callthunks.c b/arch/x86/kernel/callthunks.c
index 465647456753..dda60b91944f 100644
--- a/arch/x86/kernel/callthunks.c
+++ b/arch/x86/kernel/callthunks.c
@@ -188,11 +188,11 @@ static void *patch_dest(void *dest, bool direct)
apply_relocation(insn_buff, pad, tsize, skl_call_thunk_template, tsize);
/* Already patched? */
- if (!bcmp(pad, insn_buff, tsize))
+ if (!memcmp(pad, insn_buff, tsize))
return pad;
/* Ensure there are nops */
- if (bcmp(pad, nops, tsize)) {
+ if (memcmp(pad, nops, tsize)) {
pr_warn_once("Invalid padding area for %pS\n", dest);
return NULL;
}
@@ -309,7 +309,7 @@ static bool is_callthunk(void *addr)
memcpy(insn_buff, skl_call_thunk_template, tmpl_size);
apply_relocation(insn_buff, pad, tmpl_size, skl_call_thunk_template, tmpl_size);
- return !bcmp(pad, insn_buff, tmpl_size);
+ return !memcmp(pad, insn_buff, tmpl_size);
}
int x86_call_depth_emit_accounting(u8 **pprog, void *func, void *ip)
--
2.43.0
next prev parent reply other threads:[~2024-11-23 9:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-23 9:47 [PATCH 0/2] retire bcmp, a redundant wrapper around memcmp Mateusz Guzik
2024-11-23 9:47 ` Mateusz Guzik [this message]
2024-11-23 9:47 ` [PATCH 2/2] string: retire bcmp() Mateusz Guzik
2024-11-23 15:13 ` David Laight
2024-11-23 18:31 ` Andy Shevchenko
2024-11-23 19:09 ` Nathan Chancellor
2024-11-23 19:15 ` Mateusz Guzik
2024-11-25 9:02 ` kernel test robot
2024-11-25 11:42 ` kernel test robot
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=20241123094729.1099378-2-mjguzik@gmail.com \
--to=mjguzik@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andy@kernel.org \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--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