Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1337439ybl; Thu, 22 Aug 2019 12:54:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5by20/zNvb0Ybn0hY8LOicsWyXau6RHuUk2pLp1S9ZgffGDjLUVX/5ohpqfseLQI1NvAD X-Received: by 2002:aa7:8b51:: with SMTP id i17mr984061pfd.33.1566503659864; Thu, 22 Aug 2019 12:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566503659; cv=none; d=google.com; s=arc-20160816; b=zB+bPc5PafEmYQMumsuZobx0kJ6lezKNeY9c5RzeyYBmzETtZGNDmA8X+i69vUIIKc 6uWBpdo3YBuEcTGs65z3+/+QBIxawH+0kkTTVh8xHoIbek8IvMwq7dPOT9x/91aY4S1M 6n+k+Cd9MVwhJp4rTJGHcMrmaO+Y4wGOHyg+jk9CUJeVoHpzajib96npLCuvBzqhTm5G onB1Y81HcVUH9GjmZiM++hvXiEEAjcsdYtnwg50KnIR86tEU/XZlm1aDs4rYUiawwfAq NmQm8+e9+iD2SxCmXBKrJ17aTmav+Bcq6KyNiO2w3l8AtU3/B/mLNHgsEhYcfXTdUmku MImQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=fS1Yrz1eZUQoOwHZmMRDC2gY4H3oYCL5K3j+iaMjoVU=; b=gmxkw5oRmvaVMvWaYwQ0UJlDZIVryC6IvmaIeJCPP7Z3y27ebz4lMPkaxc6wChNjt3 Qp+eH9temWFRX5I6ZcBV/xKsqsOt1wqI+C9icxWH+7d6OUzVoPb5FNDbOXvUcTl9WrNZ fS9Bzf3h9c4lhZJayupUk+FNna0I5F8dP1oCSfFPcRmlfNN04x4EyGLcRnTZvj9/WMXp 7RrGa7cfaNvnCQj0lyAL9Lk7D0DCWr6ygLL3rKzORcJukwxt/87/vG8vrccIWT8Qx+6+ nPhPIpE4lCvcwkKj69P0MmRvqxXLPfqNhN64pgjELIyI156iaW+wJwSxk3/nacpzR05U M0Xg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s31si367912plb.362.2019.08.22.12.54.03; Thu, 22 Aug 2019 12:54:19 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389665AbfHVP7W (ORCPT + 99 others); Thu, 22 Aug 2019 11:59:22 -0400 Received: from relay.sw.ru ([185.231.240.75]:58148 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389588AbfHVP7V (ORCPT ); Thu, 22 Aug 2019 11:59:21 -0400 Received: from [172.16.25.5] by relay.sw.ru with esmtp (Exim 4.92) (envelope-from ) id 1i0pUE-0000T6-2I; Thu, 22 Aug 2019 18:58:54 +0300 Subject: Re: [PATCH 1/2] riscv: Add memmove string operation. To: Nick Hu , alankao@andestech.com, paul.walmsley@sifive.com, palmer@sifive.com, aou@eecs.berkeley.edu, green.hu@gmail.com, deanbo422@gmail.com, tglx@linutronix.de, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, glider@google.com, dvyukov@google.com, Anup.Patel@wdc.com, gregkh@linuxfoundation.org, alexios.zavras@intel.com, atish.patra@wdc.com, zong@andestech.com, kasan-dev@googlegroups.com References: From: Andrey Ryabinin Message-ID: <09d5108e-f0ba-13d3-be9e-119f49f6bd85@virtuozzo.com> Date: Thu, 22 Aug 2019 18:59:02 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/7/19 10:19 AM, Nick Hu wrote: > There are some features which need this string operation for compilation, > like KASAN. So the purpose of this porting is for the features like KASAN > which cannot be compiled without it. > Compilation error can be fixed by diff bellow (I didn't test it). If you don't need memmove very early (before kasan_early_init()) than arch-specific not-instrumented memmove() isn't necessary to have. --- mm/kasan/common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/kasan/common.c b/mm/kasan/common.c index 6814d6d6a023..897f9520bab3 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -107,6 +107,7 @@ void *memset(void *addr, int c, size_t len) return __memset(addr, c, len); } +#ifdef __HAVE_ARCH_MEMMOVE #undef memmove void *memmove(void *dest, const void *src, size_t len) { @@ -115,6 +116,7 @@ void *memmove(void *dest, const void *src, size_t len) return __memmove(dest, src, len); } +#endif #undef memcpy void *memcpy(void *dest, const void *src, size_t len) -- 2.21.0