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=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 17666C4743D for ; Fri, 4 Jun 2021 18:33:58 +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 C4737613E4 for ; Fri, 4 Jun 2021 18:33:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4737613E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.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:In-Reply-To:MIME-Version:References: 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=x/FhEQhUAF7ISeGrAckGe8xEQ39r2/ZEJ8yIisXBAvA=; b=femqcORp+bYTP2 u8T770gdkuztwDdF32HN/QYZZx6OZfvk52L5WHeJYEYVs3J9tPA7+mRxNf5wiVpdpGstKaQUxYkLE 6nO6sYA9lHsmodxLnAHm2g/0De+uAA9n+SFhXEvq0vLS95X9rgApFHFSW6/1hln2iIa6rS3iVRSJD JpqXSxAv8lLS8QOnUGiG72eU4rGxqKBFJqzg0QSjM+Duj+m3ZWxCK0i5AOa6wPt28psYH/PWvFCz5 bE3AMtML4ONkpSY6MIfDpjgiImtyV17GPY604/FPzw1L+wRLMDsriQVpEULc+Stqoeieyba0FEdZR vBNQCRYRxjTdfStMRPVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpEc3-00EsLm-48; Fri, 04 Jun 2021 18:32:07 +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 1lpEbz-00EsLN-Jz for linux-arm-kernel@lists.infradead.org; Fri, 04 Jun 2021 18:32:04 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A2718613FA; Fri, 4 Jun 2021 18:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622831523; bh=toYWmlxb06/mNU78HOxdzQ44QGww5d7S2W69KZOeFNc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kubFuZWbGbVl0b4+QjRHZF0UW4RlhrWLkU/y/kmgZBPLWIPl6uofF9YvL82WaZ+VK 1QzFyOkJRmjk9PbIAzG+oDK/zbBQephHvoycluvrL75nrj4JM6mnMKvD9Oj3RtWYlr tUWz9tI7d9tf4zFyggluHvYKbkSdM3VZ0OyVcEZBiXbKMhL8LFgKTUX8u/inw2+wAZ WjyC7z47ttFcAXQZIw3Dfa+2/fSXxcDStyqrIqTHOn+Ash/EbYal4w+ncGrdJhnsC4 jnMXjh6P9ujxejnNtfyqGLO1dYZ8Y4WFr9z+H4kjgQZkLII++bzscs2hQ53ooiWfUk xnxK/pFYu1UZQ== Date: Fri, 4 Jun 2021 19:31:58 +0100 From: Will Deacon To: Andrew Morton Cc: Peter Collingbourne , 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: <20210604183157.GA3843@willie-the-truck> References: <20210602235230.3928842-1-pcc@google.com> <20210603200308.2a08d25db0dc92430a545b4c@linux-foundation.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210603200308.2a08d25db0dc92430a545b4c@linux-foundation.org> 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-20210604_113203_693351_704079D2 X-CRM114-Status: GOOD ( 22.06 ) 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 Thu, Jun 03, 2021 at 08:03:08PM -0700, Andrew Morton wrote: > 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. Sure thing, I'll queue this in a sec... Peter -- please cc me on patches touching arch/arm64 in future, that way I won't miss anything (or at least, you can yell at me if I do!). Cheers, Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel