From: Nathan Chancellor <natechancellor@gmail.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: "Masahiro Yamada" <masahiroy@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"Borislav Petkov" <bp@alien8.de>,
"Michal Marek" <michal.lkml@markovi.net>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
"Kees Cook" <keescook@chromium.org>,
"Tony Luck" <tony.luck@intel.com>,
"Dmitry Vyukov" <dvyukov@google.com>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Joe Perches" <joe@perches.com>,
"Joel Fernandes" <joel@joelfernandes.org>,
"Daniel Axtens" <dja@axtens.net>,
"Arvind Sankar" <nivedita@alum.mit.edu>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Alexandru Ardelean" <alexandru.ardelean@analog.com>,
"Yury Norov" <yury.norov@gmail.com>,
x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
"Ard Biesheuvel" <ardb@kernel.org>,
"Paul E . McKenney" <paulmck@kernel.org>,
"Daniel Kiper" <daniel.kiper@oracle.com>,
"Bruce Ashfield" <bruce.ashfield@gmail.com>,
"Marco Elver" <elver@google.com>,
"Vamshi K Sthambamkadi" <vamshi.k.sthambamkadi@gmail.com>,
"Andi Kleen" <ak@suse.de>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Dávid Bolvanský" <david.bolvansky@gmail.com>,
"Eli Friedman" <efriedma@quicinc.com>
Subject: Re: [PATCH v2 3/5] Revert "lib/string.c: implement a basic bcmp"
Date: Wed, 19 Aug 2020 20:34:19 -0700 [thread overview]
Message-ID: <20200820033419.GC2167124@ubuntu-n2-xlarge-x86> (raw)
In-Reply-To: <20200819191654.1130563-4-ndesaulniers@google.com>
On Wed, Aug 19, 2020 at 12:16:52PM -0700, Nick Desaulniers wrote:
> This reverts commit 5f074f3e192f10c9fade898b9b3b8812e3d83342.
>
> An earlier commit in the series prevents the compiler from emitting
> calls to bcmp as part of "libcall optimization," and there are no
> explicit callers, so we can now safely remove this interface.
>
> Suggested-by: Nathan Chancellor <natechancellor@gmail.com>
> Reviewed-by: Kees Cook <keescook@chromium.org>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
> include/linux/string.h | 3 ---
> lib/string.c | 20 --------------------
> 2 files changed, 23 deletions(-)
>
> diff --git a/include/linux/string.h b/include/linux/string.h
> index b1f3894a0a3e..f3bdb74bc230 100644
> --- a/include/linux/string.h
> +++ b/include/linux/string.h
> @@ -155,9 +155,6 @@ extern void * memscan(void *,int,__kernel_size_t);
> #ifndef __HAVE_ARCH_MEMCMP
> extern int memcmp(const void *,const void *,__kernel_size_t);
> #endif
> -#ifndef __HAVE_ARCH_BCMP
> -extern int bcmp(const void *,const void *,__kernel_size_t);
> -#endif
> #ifndef __HAVE_ARCH_MEMCHR
> extern void * memchr(const void *,int,__kernel_size_t);
> #endif
> diff --git a/lib/string.c b/lib/string.c
> index 6012c385fb31..69328b8353e1 100644
> --- a/lib/string.c
> +++ b/lib/string.c
> @@ -922,26 +922,6 @@ __visible int memcmp(const void *cs, const void *ct, size_t count)
> EXPORT_SYMBOL(memcmp);
> #endif
>
> -#ifndef __HAVE_ARCH_BCMP
> -/**
> - * bcmp - returns 0 if and only if the buffers have identical contents.
> - * @a: pointer to first buffer.
> - * @b: pointer to second buffer.
> - * @len: size of buffers.
> - *
> - * The sign or magnitude of a non-zero return value has no particular
> - * meaning, and architectures may implement their own more efficient bcmp(). So
> - * while this particular implementation is a simple (tail) call to memcmp, do
> - * not rely on anything but whether the return value is zero or non-zero.
> - */
> -#undef bcmp
> -int bcmp(const void *a, const void *b, size_t len)
> -{
> - return memcmp(a, b, len);
> -}
> -EXPORT_SYMBOL(bcmp);
> -#endif
> -
> #ifndef __HAVE_ARCH_MEMSCAN
> /**
> * memscan - Find a character in an area of memory.
> --
> 2.28.0.297.g1956fa8f8d-goog
>
next prev parent reply other threads:[~2020-08-20 3:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 19:16 [PATCH v2 0/5] -ffreestanding/-fno-builtin-* patches Nick Desaulniers
2020-08-19 19:16 ` [PATCH v2 1/5] Makefile: add -fno-builtin-stpcpy Nick Desaulniers
2020-08-20 3:33 ` Nathan Chancellor
2020-08-19 19:16 ` [PATCH v2 2/5] Makefile: add -fno-builtin-bcmp Nick Desaulniers
2020-08-20 3:33 ` Nathan Chancellor
2020-08-19 19:16 ` [PATCH v2 3/5] Revert "lib/string.c: implement a basic bcmp" Nick Desaulniers
2020-08-20 3:34 ` Nathan Chancellor [this message]
2020-08-19 19:16 ` [PATCH v2 4/5] x86/boot: use -fno-builtin-bcmp Nick Desaulniers
2020-08-19 19:29 ` Arvind Sankar
2020-08-19 20:11 ` Nick Desaulniers
2020-08-19 19:16 ` [PATCH v2 5/5] x86: don't build CONFIG_X86_32 as -ffreestanding Nick Desaulniers
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=20200820033419.GC2167124@ubuntu-n2-xlarge-x86 \
--to=natechancellor@gmail.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alexandru.ardelean@analog.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=bruce.ashfield@gmail.com \
--cc=daniel.kiper@oracle.com \
--cc=david.bolvansky@gmail.com \
--cc=dja@axtens.net \
--cc=dvyukov@google.com \
--cc=efriedma@quicinc.com \
--cc=elver@google.com \
--cc=hpa@zytor.com \
--cc=joe@perches.com \
--cc=joel@joelfernandes.org \
--cc=keescook@chromium.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=ndesaulniers@google.com \
--cc=nivedita@alum.mit.edu \
--cc=paulmck@kernel.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.org \
--cc=vamshi.k.sthambamkadi@gmail.com \
--cc=x86@kernel.org \
--cc=yury.norov@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).