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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 52EE7C32774 for ; Thu, 25 Aug 2022 15:21:20 +0000 (UTC) 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=dRxKVtl8mhSBgqFtG09J0qZm8FzEroUyhtGAcQVErGs=; b=DPjNztz6WUTnoq M+T0i34Pdwo7Qu6fPsilrUIAXsNqZaWKLmI9BAtyc7jVsUK9tf8ay4FdH+0P4KIwMt3BwH12Owcs/ c87CW0Jib6nnLTOaEnpQsJeZKvyF5tzH/ALtb2SWmt2eEZ8KLP104gk+igSUrfiZ8mdF3uvOPdLGd Qn0ExLUpuhVOXJDuwq9MYJ4HCkH+dDK2XNrSalVriGW3NUTFSMddum5GPPkH1hnDTM7X0KVfVShN7 MoTj/d1CmBe9jJwkBy3adnHgBq1tkfjYpUmEQhw0wKaNgi/9AU6MbyGNVurIDr2ULJuDF0fnZNc+E FxvdybFpxkRe1c/3z38A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oREeb-00FeSn-Mz; Thu, 25 Aug 2022 15:20:21 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oREeW-00FePj-SB; Thu, 25 Aug 2022 15:20:18 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 84D3BB82A12; Thu, 25 Aug 2022 15:20:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E045C433D6; Thu, 25 Aug 2022 15:20:12 +0000 (UTC) Date: Thu, 25 Aug 2022 16:20:08 +0100 From: Catalin Marinas To: Liam Howlett Cc: Mark Brown , Will Deacon , "maple-tree@lists.infradead.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton , "Matthew Wilcox (Oracle)" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v13 57/70] mm/mlock: use vma iterator and maple state instead of vma linked list Message-ID: References: <20220822150128.1562046-1-Liam.Howlett@oracle.com> <20220822150128.1562046-58-Liam.Howlett@oracle.com> <20220825132054.ymenz4cewiemsxw7@revolver> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220825132054.ymenz4cewiemsxw7@revolver> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220825_082017_074378_534C2BF7 X-CRM114-Status: GOOD ( 22.46 ) 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, Aug 25, 2022 at 01:21:01PM +0000, Liam Howlett wrote: > * Mark Brown [220824 20:34]: > > On Mon, Aug 22, 2022 at 03:06:30PM +0000, Liam Howlett wrote: > > > From: "Matthew Wilcox (Oracle)" > > > > > > Handle overflow checking in count_mm_mlocked_page_nr() differently. > > > > Our QA team found that since next-20220823 we're seeing a couple of test > > failures in the check_mmap_options kselftest on arm64 platforms with MTE > > that aren't present in mainline: > > > > # # FAIL: mprotect not ignoring clear PROT_MTE property > > # not ok 21 Check clear PROT_MTE flags with private mapping, sync error mode and mmap memory > > # # FAIL: mprotect not ignoring clear PROT_MTE property > > # not ok 22 Check clear PROT_MTE flags with private mapping and sync error mode and mmap/mprotect memory > > Thanks. > > > I bisected this using qemu[1] which landed on 4ceb4bca479d41a > > ("mm/mprotect: use maple tree navigation instead of vma linked list"), > > though I'm not 100% sure I trust the specific identification of the > > commit I'm pretty confident it's at the very least in this series. I've > > not done any analysis of the failure beyond getting this bisect result. > > > > [1] qemu -smp cpus=4 -cpu max -machine virt,gic-version=3,mte=on > > This helps a lot. I think your bisect is accurate: > > ... > struct mmu_gather tlb; > + MA_STATE(mas, ¤t->mm->mm_mt, start, start); > > start = untagged_addr(start); > ... > > It looks like I search against the tagged address. I should initialize > the state to 0 and mas_set(&mas, start) after untagging the address. > > I'll send out a patch once I have recreated and verified this is the > issue. Thanks. I did a quick test and untagging start seems to fix the issue (I was wondering why mprotect() returned -ENOMEM when failing). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel