Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp698091pxa; Wed, 19 Aug 2020 12:19:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi/PeH6CXz6qt0E31h7X6yASNvqPf5J5YOL0hQfpsQM4qVLDl3i6BAi6Kxgu+DvJ38e1kC X-Received: by 2002:a17:906:82ca:: with SMTP id a10mr26247209ejy.524.1597864753408; Wed, 19 Aug 2020 12:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597864753; cv=none; d=google.com; s=arc-20160816; b=MDMQ8ZCgTWQ5KRhpdM7eTEPwKiSCmGRaWje7AAyhqchzuS2Lv+DQO0Z+s50oHWriSO yGZgsOvGaLxzs6ckV705aLYM36T+qDE3pQGDzewQgMa6qMMS9ZsEGnbyADDol00UAmrT lUwo2suBtp6ElfXXF8+UVfWS+DET4YOXiqnO7L2JXT7gFIQlqLTgSDyCSk30KT/NT094 3lH2lp+/aM9hto8YO/19tTN/r+fLHVemQ3ECKlfHulAL66AIUtOHty6FhA5PUYBvSGRh 6+CqKcZNnZIISRobwUwqMI9Kt+03t6jLqVW62OCJElfpDxQP+zVIVDLesHVzcqLzA0ao DwuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=r84xcQbgubHprmQGHdhEie+FBaGO0N4EWuKx2nze9kk=; b=bwiWFmc93eMDZYFORQiZy2tnjgzYj9Xp2lSMolIGNE8NeyTAG0bGs3VG+gbXDzRugU H0yhi2HZx9GFHRjb/+wLmIZaEP8yJCJKfAPPMHaOvwn7yfawPv82Zza3W53ygkdZB90V T4q2IeP1JLmzxs2TTE/KmoTiGsxzu1VCHhmaChkEyOayXjkVwiw7bstuxf+8OoeqVyJq 2R8xxy8jG2BBZgStNcMthMC4tTyTwn9HWbiFwHyB/IcctxN+S/Lrg7iH73KnoHw6EJ1R faMaOl+nlnidsLBzjepOvWK5wgZO7+XvVCgVJ2vBkK36jpDKUgEELhpSSHIqWVzoI7Nn HN+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gmxsTeXy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i26si15807886edv.600.2020.08.19.12.18.49; Wed, 19 Aug 2020 12:19:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gmxsTeXy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbgHSTRz (ORCPT + 99 others); Wed, 19 Aug 2020 15:17:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727012AbgHSTRT (ORCPT ); Wed, 19 Aug 2020 15:17:19 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25BB8C061343 for ; Wed, 19 Aug 2020 12:17:19 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id f7so14866546plj.16 for ; Wed, 19 Aug 2020 12:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=r84xcQbgubHprmQGHdhEie+FBaGO0N4EWuKx2nze9kk=; b=gmxsTeXyOkvZXDCuGg2KHf5O47wmcxetM6gPsB3gToKAyGX+XYovB86AzMOWnjdw9Z adCND0Oa3n+jwU+LXuL4qWJvHjRWDjBENCVb+P9n9RLRZTt0ZpbW44GSXgBVluwwlOPE 2sqbGcM+5uDuDxEXwCvTEFXVthhlNnbcix119RUIlOKXpYqVeDZdYUlhiJVsLy4VQD8F VydTQqW9K2iN9TjyU9AA603yAo3BsyhmgrP8URp5f6tVo2oPSLflYRIHHFhtUw7lVBBC iko4NA+N48dFyc4Z7VaXxlF7HX1xOmQmr3wzCCJLnLiHhd1mbsF+SUh8Inpe20wqVWEA NIDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=r84xcQbgubHprmQGHdhEie+FBaGO0N4EWuKx2nze9kk=; b=tc0dRhOpnZz0ENOwPwSjhUSUAvqUzSO5LH0xjSsG6j+ExdiysTYHv9JyzxToNmIDt3 pKDe4XE/uXlyxuLk1m5g6OS3nlInjqYM9G2BR+oTW/oEyKljwCORdl0ssizhfBa8At96 Ip+CpRZhWCSZmlb1LihCOVjgzTB0R01e2Q1y0FqF+vpZgEVuFrl+9zX/bFARL2kl/knx 3WnaTGzvvqwDyIDOjvGlxWq+AI8U3p+1miCs9XtaWih1AJK1714Hh8rcnqvktJU+ScvB /7gGg8iO9CcgPCd/UGDI4whL5NHF1Um7o7Jk5/apEOvAwPYoP7OP45GD0+mUs6yHS6Yh Mv4w== X-Gm-Message-State: AOAM532RaVoBGtCDXjU6iDrgWZLmi+mDEKsI06tv7dSMhgmjJoEXNt12 wzSmISiHo/YmBhAeZfJTvQOHM7lAYj0acwFesJI= X-Received: by 2002:a17:902:c151:: with SMTP id 17mr19141781plj.228.1597864638521; Wed, 19 Aug 2020 12:17:18 -0700 (PDT) Date: Wed, 19 Aug 2020 12:16:52 -0700 In-Reply-To: <20200819191654.1130563-1-ndesaulniers@google.com> Message-Id: <20200819191654.1130563-4-ndesaulniers@google.com> Mime-Version: 1.0 References: <20200819191654.1130563-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d-goog Subject: [PATCH v2 3/5] Revert "lib/string.c: implement a basic bcmp" From: Nick Desaulniers To: Masahiro Yamada , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov Cc: Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Tony Luck , Dmitry Vyukov , Michael Ellerman , Joe Perches , Joel Fernandes , Daniel Axtens , Arvind Sankar , Andy Shevchenko , Alexandru Ardelean , Yury Norov , x86@kernel.org, "H . Peter Anvin" , Ard Biesheuvel , "Paul E . McKenney" , Daniel Kiper , Bruce Ashfield , Marco Elver , Vamshi K Sthambamkadi , Andi Kleen , Linus Torvalds , "=?UTF-8?q?D=C3=A1vid=20Bolvansk=C3=BD?=" , Eli Friedman , Nick Desaulniers , Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Kees Cook Signed-off-by: Nick Desaulniers --- 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