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 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.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 D78CEC433E0 for ; Fri, 22 Jan 2021 12:01:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72E2823122 for ; Fri, 22 Jan 2021 12:01:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72E2823122 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4OH1Bty24u5CBIhZFIBaWVI10R/hzH5rkyB/c9Iz2Y0=; b=wuFa+k91R3zoCTkz+DYPUelqN 5DuXBWaBH0CHrznpNVld9knvFjoBY8/TAjOdAjEeP2pSiQUr/yQsLBxKRZzA/f2waTIX0nuocDLcL SEC6FVcrXcST19PCXtzuM+TAspS7ZVJIPyiKJs3GAn3CNmxeh7PbWH2PqZUDWtkn+pnAjPGwpsQ8t ePulI+1JIgNRE7h724grjBD7HidI6wt7zHKkud0SZIP8ut6Ngs8f2pPJwPJezR2EfzS2Q2f/NZ876 Az53iUECqql9X3/Y/zQmyuIB5IMCQSPsmMhgp4Z2s7CdZXlpyi6Za3Zaac8DTvJIe34SzoBz0Ssf5 4q61ISA7A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2v6u-0004W4-0x; Fri, 22 Jan 2021 12:00:16 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2v6r-0004VL-FF for linux-arm-kernel@lists.infradead.org; Fri, 22 Jan 2021 12:00:14 +0000 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210122_070013_597242_D7FF3399 X-CRM114-Status: GOOD ( 18.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Branislav Rankov , Marco Elver , Evgenii Stepanov , LKML , kasan-dev , Alexander Potapenko , Linux ARM , Andrey Ryabinin , Vincenzo Frascino , Will Deacon , Dmitry Vyukov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel