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=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,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 7567AC433DF for ; Thu, 27 Aug 2020 12:10:52 +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 3979A206EB for ; Thu, 27 Aug 2020 12:10:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Vk5Lj/HD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3979A206EB Authentication-Results: mail.kernel.org; dmarc=none (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:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7fH8Nut0D/r2CtGgb/VespJUqXt5ixaaDNY3rU1jsxw=; b=Vk5Lj/HDNrZEnvJRDo9EGt98N e5Rh0a2R43AmY40ok7DF6STLcPHmUCpBbf2cSk7S2bfccE2oSsfPjLR3oAJKpVNk0AnHRrPuuB/7/ kPNFCH2wE/p3OGV0gAzycaNKlknA+U7qP4+hEnbS/unpsNsctaB6LYxKRurv7z29Kl7hakaaFMpwi hbYUhcQXGidtbr3x3GJzCHfaMEz+9C1fwEhmYwAjNcHzwdQ1a/tyX51VRtXTSG/6TY/VoHMZa/w0k gB8f4vCJvHjRRkZ8QG8XqWsDkyeBkjsSGqbdGUX86Vvya77ckxlHDwKXFloWHLkiIU1+HwK5v1JS/ 5zo7Fr8gw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBGih-0002qn-Jl; Thu, 27 Aug 2020 12:09:31 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBGif-0002py-26 for linux-arm-kernel@lists.infradead.org; Thu, 27 Aug 2020 12:09:29 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B53F131B; Thu, 27 Aug 2020 05:09:27 -0700 (PDT) Received: from [192.168.1.190] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A751E3F68F; Thu, 27 Aug 2020 05:09:24 -0700 (PDT) Subject: Re: [PATCH 32/35] kasan, arm64: print report from tag fault handler To: Catalin Marinas , Andrey Konovalov References: <4691d6019ef00c11007787f5190841b47ba576c4.1597425745.git.andreyknvl@google.com> <20200827104816.GI29264@gaia> From: Vincenzo Frascino Message-ID: <37de7524-b042-831f-6e43-30adf85c83a8@arm.com> Date: Thu, 27 Aug 2020 13:11:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200827104816.GI29264@gaia> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_080929_259304_C0BCC586 X-CRM114-Status: GOOD ( 17.46 ) 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: linux-arm-kernel@lists.infradead.org, Marco Elver , Elena Petrova , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , Andrew Morton , Evgenii Stepanov 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 8/27/20 11:48 AM, Catalin Marinas wrote: > On Fri, Aug 14, 2020 at 07:27:14PM +0200, Andrey Konovalov wrote: >> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c >> index c62c8ba85c0e..cf00b3942564 100644 >> --- a/arch/arm64/mm/fault.c >> +++ b/arch/arm64/mm/fault.c >> @@ -14,6 +14,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -314,11 +315,19 @@ static void report_tag_fault(unsigned long addr, unsigned int esr, >> { >> bool is_write = ((esr & ESR_ELx_WNR) >> ESR_ELx_WNR_SHIFT) != 0; >> >> +#ifdef CONFIG_KASAN_HW_TAGS >> + /* >> + * SAS bits aren't set for all faults reported in EL1, so we can't >> + * find out access size. >> + */ >> + kasan_report(addr, 0, is_write, regs->pc); >> +#else >> pr_alert("Memory Tagging Extension Fault in %pS\n", (void *)regs->pc); >> pr_alert(" %s at address %lx\n", is_write ? "Write" : "Read", addr); >> pr_alert(" Pointer tag: [%02x], memory tag: [%02x]\n", >> mte_get_ptr_tag(addr), >> mte_get_mem_tag((void *)addr)); >> +#endif >> } > > More dead code. So what's the point of keeping the pr_alert() introduced > earlier? CONFIG_KASAN_HW_TAGS is always on for in-kernel MTE. If MTE is > disabled, this function isn't called anyway. > I agree we should remove them (togheter with '#ifdef CONFIG_KASAN_HW_TAGS') or integrate them with the kasan code if still meaningful. -- Regards, Vincenzo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel