From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDF8AC433DB for ; Fri, 22 Jan 2021 12:01:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73CCA2376F for ; Fri, 22 Jan 2021 12:01:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727676AbhAVMB1 (ORCPT ); Fri, 22 Jan 2021 07:01:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:37654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727366AbhAVMAx (ORCPT ); Fri, 22 Jan 2021 07:00:53 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7EC0422C9F; Fri, 22 Jan 2021 12:00:10 +0000 (UTC) Date: Fri, 22 Jan 2021 12:00:08 +0000 From: Catalin Marinas To: Andrey Konovalov Cc: Vincenzo Frascino , Linux ARM , LKML , kasan-dev , Will Deacon , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Branislav Rankov Subject: Re: [PATCH v5 6/6] kasan: Forbid kunit tests when async mode is enabled Message-ID: <20210122120007.GB8567@gaia> References: <20210121163943.9889-1-vincenzo.frascino@arm.com> <20210121163943.9889-7-vincenzo.frascino@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 06:40:35PM +0100, Andrey Konovalov wrote: > On Thu, Jan 21, 2021 at 5:40 PM Vincenzo Frascino > wrote: > > > > Architectures supported by KASAN_HW_TAGS can provide a sync or async > > mode of execution. KASAN KUNIT tests can be executed only when sync > > mode is enabled. > > > > Forbid the execution of the KASAN KUNIT tests when async mode is > > enabled. > > > > Cc: Dmitry Vyukov > > Cc: Andrey Ryabinin > > Cc: Alexander Potapenko > > Cc: Andrey Konovalov > > Signed-off-by: Vincenzo Frascino > > --- > > lib/test_kasan.c | 5 +++++ > > mm/kasan/kasan.h | 2 ++ > > 2 files changed, 7 insertions(+) > > > > diff --git a/lib/test_kasan.c b/lib/test_kasan.c > > index 7285dcf9fcc1..1306f707b4fe 100644 > > --- a/lib/test_kasan.c > > +++ b/lib/test_kasan.c > > @@ -52,6 +52,11 @@ static int kasan_test_init(struct kunit *test) > > return -1; > > } > > > > + if (!hw_is_mode_sync()) { > > + kunit_err(test, "can't run KASAN tests in async mode"); > > + return -1; > > + } > > I'd rather implement this check at the KASAN level, than in arm64 > code. Just the way kasan_stack_collection_enabled() is implemented. > > Feel free to drop this change and the previous patch, I'll implement > this myself later. I agree, it makes sense. -- Catalin