linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Nick Hu <nickhu@andestech.com>
Cc: "aou@eecs.berkeley.edu" <aou@eecs.berkeley.edu>,
	"Alan Quey-Liang Kao(高魁良)" <alankao@andestech.com>,
	"atish.patra@wdc.com" <atish.patra@wdc.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"palmer@sifive.com" <palmer@sifive.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kasan-dev@googlegroups.com" <kasan-dev@googlegroups.com>,
	"離職Zong Zong-Xian Li(李宗憲)" <zong@andestech.com>,
	"alexios.zavras@intel.com" <alexios.zavras@intel.com>,
	"Anup.Patel@wdc.com" <Anup.Patel@wdc.com>,
	"glider@google.com" <glider@google.com>,
	"green.hu@gmail.com" <green.hu@gmail.com>,
	"paul.walmsley@sifive.com" <paul.walmsley@sifive.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"deanbo422@gmail.com" <deanbo422@gmail.com>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	"dvyukov@google.com" <dvyukov@google.com>
Subject: Re: [PATCH 1/2] riscv: Add memmove string operation.
Date: Tue, 27 Aug 2019 12:33:11 +0300	[thread overview]
Message-ID: <92dd5f5f-c8a2-53c3-4d61-44acc4366844@virtuozzo.com> (raw)
In-Reply-To: <20190827090738.GA22972@andestech.com>



On 8/27/19 12:07 PM, Nick Hu wrote:
> Hi Andrey
> 
> On Thu, Aug 22, 2019 at 11:59:02PM +0800, Andrey Ryabinin wrote:
>> 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
>>
>>
>>
> I have confirmed that the string operations are not used before kasan_early_init().
> But I can't make sure whether other ARCHs would need it before kasan_early_init().
> Do you have any idea to check that? Should I cc all other ARCH maintainers?
 

This doesn't affect other ARCHes in any way. If other arches have their own not-instrumented
memmove implementation (and they do), they will continue to be able to use it early.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2019-08-27  9:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07  7:19 [PATCH 0/2] KASAN support for RISC-V Nick Hu
2019-08-07  7:19 ` [PATCH 1/2] riscv: Add memmove string operation Nick Hu
2019-08-12 15:04   ` Christoph Hellwig
2019-08-13 23:50     ` Palmer Dabbelt
2019-08-14  2:22       ` Paul Walmsley
2019-08-14  3:27         ` Nick Hu
2019-08-14 17:03           ` Paul Walmsley
2019-08-15  3:12             ` Nick Hu
2019-08-15 18:27               ` Paul Walmsley
2019-08-19  6:29                 ` Nick Hu
2019-08-14 18:33         ` Palmer Dabbelt
2019-08-22 15:59   ` Andrey Ryabinin
2019-08-27  9:07     ` Nick Hu
2019-08-27  9:33       ` Andrey Ryabinin [this message]
2019-08-28  3:06         ` Nick Hu
2019-08-07  7:19 ` [PATCH 2/2] riscv: Add KASAN support Nick Hu
2019-08-12 15:10   ` Christoph Hellwig
2019-08-14  7:44     ` Nick Hu
2019-08-22 17:08       ` Andrey Ryabinin
2019-09-03 15:08       ` Daniel Axtens
2019-09-04  2:24         ` Nick Hu

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=92dd5f5f-c8a2-53c3-4d61-44acc4366844@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=Anup.Patel@wdc.com \
    --cc=alankao@andestech.com \
    --cc=alexios.zavras@intel.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=atish.patra@wdc.com \
    --cc=deanbo422@gmail.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=green.hu@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=nickhu@andestech.com \
    --cc=palmer@sifive.com \
    --cc=paul.walmsley@sifive.com \
    --cc=tglx@linutronix.de \
    --cc=zong@andestech.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).