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=-9.7 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,URIBL_BLOCKED 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 185EAC47096 for ; Fri, 4 Jun 2021 03:07:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D4D3D613C9 for ; Fri, 4 Jun 2021 03:07:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4D3D613C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: Message-Id:Subject:Cc: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=yooTzJhxHj1gx+wHN+DB8uQU+RgoesntAxtULOmHNK8=; b=G0ycRKCC+Z/miU cMdlCbeszpZPL73UWjPFsyO8l4E6FT1TPWqQPBVtnZ516HImtmvYJgTTe8fr8Whl8wMWGea2NhNzY hCUnB7gbvhJlGxkc9RHHocofTTcVtXszXfrZX5UFd1IBAOfw7U2Ea0J65sLSxBxUUEqB6X+OqjlAE /pBOfw9nJ0REPh6U8UgIII+qwaMovHRXF/BPJBzcen57MjSP+5zUAy+QotWA2YRWVLvb6sIsWGxyH W6+C8sBQV+ItpkA1q6xqsYGj5J03SmVHFzRYNRf3PiaKDNX/DPQZGRDGqY5EQlIWfZAHkirMYETjs z5ij88/bPolgP9oERkpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lp079-00BJNv-VE; Fri, 04 Jun 2021 03:03:16 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lp073-00BJNF-Tt for linux-arm-kernel@lists.infradead.org; Fri, 04 Jun 2021 03:03:13 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1640161407; Fri, 4 Jun 2021 03:03:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1622775789; bh=FSL0mJu2p1n3VEX8k5+eJ5bhgTXJNBw7kXX50N9tM9w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=blwTk5Lnd19UDXQeWY5cNBK5wB91NprTVCa5swAhRig0Qni5yqGQWWY6wd/EmzSlS 1WbT+89Pe/86snwflhpj/qbaBzjLWHDZulyjt6LBtD6Ucob7Ftwd15ZHHJgliQcVnA A7S2adVK7LVuBrhdCvmIYMA8tJVJ1prx6dAPJNx8= Date: Thu, 3 Jun 2021 20:03:08 -0700 From: Andrew Morton To: Peter Collingbourne Cc: Andrey Konovalov , Alexander Potapenko , Catalin Marinas , Vincenzo Frascino , Jann Horn , Evgenii Stepanov , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v6 0/4] arm64: improve efficiency of setting tags for user pages Message-Id: <20210603200308.2a08d25db0dc92430a545b4c@linux-foundation.org> In-Reply-To: <20210602235230.3928842-1-pcc@google.com> References: <20210602235230.3928842-1-pcc@google.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_200310_028209_CFDFBF23 X-CRM114-Status: GOOD ( 16.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Wed, 2 Jun 2021 16:52:26 -0700 Peter Collingbourne wrote: > Currently we can end up touching PROT_MTE user pages twice on fault > and once on unmap. On fault, with KASAN disabled we first clear data > and then set tags to 0, and with KASAN enabled we simultaneously > clear data and set tags to the KASAN random tag, and then set tags > again to 0. On unmap, we poison the page by setting tags, but this > is less likely to find a bug than poisoning kernel pages. > > This patch series fixes these inefficiencies by only touching the pages > once on fault using the DC GZVA instruction to clear both data and > tags, and avoiding poisoning user pages on free. > > ... > > arch/alpha/include/asm/page.h | 6 +-- > arch/arm64/include/asm/mte.h | 4 ++ > arch/arm64/include/asm/page.h | 10 +++-- > arch/arm64/lib/mte.S | 20 ++++++++++ > arch/arm64/mm/fault.c | 26 +++++++++++++ > arch/arm64/mm/proc.S | 10 +++-- > arch/ia64/include/asm/page.h | 6 +-- > arch/m68k/include/asm/page_no.h | 6 +-- > arch/s390/include/asm/page.h | 6 +-- > arch/x86/include/asm/page.h | 6 +-- > include/linux/gfp.h | 18 +++++++-- > include/linux/highmem.h | 43 ++++++++------------- > include/linux/kasan.h | 64 +++++++++++++++++++------------- > include/linux/page-flags.h | 9 +++++ > include/trace/events/mmflags.h | 9 ++++- > mm/kasan/common.c | 4 +- > mm/kasan/hw_tags.c | 32 ++++++++++++++++ > mm/mempool.c | 6 ++- > mm/page_alloc.c | 66 +++++++++++++++++++-------------- > 19 files changed, 242 insertions(+), 109 deletions(-) This is more MMish than ARMish, but I expect it will get more exposure in an ARM tree than in linux-next alone. I'll grab them for now, but in the hope that they will appear in -next via an ARM tree so I get to drop them again. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel