Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9513370ybi; Wed, 24 Jul 2019 05:28:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPBh66grRVdAfvXH8BjllwHm0j4EUu/kXFd8j2JzF3qYCR+aygyj1B+o/tFaQhurat89XA X-Received: by 2002:a17:902:e210:: with SMTP id ce16mr86616130plb.335.1563971337807; Wed, 24 Jul 2019 05:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563971337; cv=none; d=google.com; s=arc-20160816; b=YFS7/CAs43zl4cU8ofQt/UNjkuGj9+Oc1tBjfxMElHpzp6L3ClTVrB4cEQLQcYwbVZ UV4gqTHvpXGCYVBNLgAt9DxLk3uDKeLirc+JfnPP0e/Z8fCf6Yz0XG7QwUqaoABR3ZQo bBCJGqb/97uQXe8xOLz7Tag9n4Xpg/2vs8LwEkogCNx3yJulI1TPMIO1R4F0q2mU+nyd H820JA94ptSM4k1MD/Z7aRNWURR7/ldY5cQruCZYQSO755cYcyU0M+zNWyIhjcd26qWz q/ar5xltjvgmNzZLHd9DHGV0kaaospwcYNK7EtgLajSPbgTK/7wAc84dJEnQ+hMdMs2w 20kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=SWW5P9UOMC0llG3gXoo0VyJvbtyPMO3LDL134HIujGk=; b=SsFpgyu0zsqYqXWiPnGoAH9xnVi9bkR210rh2rJBt0NvF9uXHSKDwStYNeh/mozz05 AMhcf0b7iZnAYtVADHHHvJ7SyX8wb4aiLqFC5rJ9Hzdx0YL2BXTAiLIu63Fe4PjJvujx VJN4+WhqjjU6qnk3Zt9nobkNoKCujz6x2o613GCDilnO/Nxo6KI+vClH6qhCrznau9Jl 7C19zQvM9SCOOdnNEZtcd77VeCJM+TLDnrF924g7G9W9WcsQqVtc8sF5ACRh6nItJYh5 2SLCNmeZ/36lmfMDR2ZiqbUJ6SR27uadA8Iq7uWs2Yqxi7938+iRAC2MXspFanRnI3vL M3XA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si12147813pjs.58.2019.07.24.05.28.43; Wed, 24 Jul 2019 05:28:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbfGXKdO (ORCPT + 99 others); Wed, 24 Jul 2019 06:33:14 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:43563 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbfGXKdO (ORCPT ); Wed, 24 Jul 2019 06:33:14 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hqEa0-0004EB-AS; Wed, 24 Jul 2019 12:33:04 +0200 Date: Wed, 24 Jul 2019 12:33:03 +0200 (CEST) From: Thomas Gleixner To: Nick Desaulniers cc: mingo@redhat.com, bp@alien8.de, peterz@infradead.org, clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org, yamada.masahiro@socionext.com, stable@vger.kernel.org, Vaibhav Rustagi , Manoj Gupta , Alistair Delva , "H. Peter Anvin" , x86@kernel.org, Enrico Weigelt , Allison Randal , Uros Bizjak , Chao Fan , Greg Kroah-Hartman , Alexios Zavras Subject: Re: [PATCH v3 1/2] x86/purgatory: do not use __builtin_memcpy and __builtin_memset In-Reply-To: <20190723212418.36379-1-ndesaulniers@google.com> Message-ID: References: <20190723212418.36379-1-ndesaulniers@google.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 Jul 2019, Nick Desaulniers wrote: > Instead, reuse an implementation from arch/x86/boot/compressed/string.c > if we define warn as a symbol. Also, Clang may lower memcmp's that > compare against 0 to bcmp's, so add a small definition, too. See also: > commit 5f074f3e192f ("lib/string.c: implement a basic bcmp") > > Cc: stable@vger.kernel.org > Fixes: 8fc5b4d4121c ("purgatory: core purgatory functionality") > Link: https://bugs.chromium.org/p/chromium/issues/detail?id=984056 > Reported-by: Vaibhav Rustagi > Debugged-by: Vaibhav Rustagi > Debugged-by: Manoj Gupta > Suggested-by: Alistair Delva > Signed-off-by: Vaibhav Rustagi > Signed-off-by: Nick Desaulniers That SOB chain is weird. Is Vaibhav the author? > +/* > + * Clang may lower `memcmp == 0` to `bcmp == 0`. > + */ > +int bcmp(const void *s1, const void *s2, size_t len) { > + return memcmp(s1, s2, len); > +} foo() { } please. Thanks, tglx