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 45725C4345F for ; Thu, 2 May 2024 18:00:39 +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=4CWwFL4BI8QP04eq5DBoHOQYy2VFqQA3HjoC1j91MJA=; b=bBvD0aKgtiLeCT fHx7MO8MptoEm1Fac+PqypU1aupzWovhuoCI//DVyztNWeA1YNnZ5YmE7nLprpM/26KYGsx40F6+5 65d+2//EOvSBTI+B0psSYUtRxzyjx9ZMNGnAIw6Ty98RYlDD6XuHgThwIxT0+oBs4wYMyBiw1mlRW Y7ZXK43oVjsQ2b3ERACprmJeF/2X1i0iGYTK6qiFrKcymQ2h9ZFJ+1/vsXPaw4hDu8mdiyAp/z23L UOza4OXQBUKdEgjj/K3VMWcXn5yXhMoHWPQC3J4U+nWDWVnazDDI7N5THam5a7bPgszzDdzvxvsbH LWfSRJcUGj5eS9RXzvNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2ajG-0000000DWsr-1yBI; Thu, 02 May 2024 18:00:22 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2ajB-0000000DWpm-2AYO for linux-arm-kernel@lists.infradead.org; Thu, 02 May 2024 18:00:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3670561BD1; Thu, 2 May 2024 18:00:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1C20C113CC; Thu, 2 May 2024 18:00:10 +0000 (UTC) Date: Thu, 2 May 2024 19:00:08 +0100 From: Catalin Marinas To: Will Deacon , Mark Rutland , Anshuman Khandual , Andrew Morton , Zi Yan , "Aneesh Kumar K.V" , Ryan Roberts Cc: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] arm64/mm: pmd_mkinvalid() must handle swap pmds Message-ID: References: <20240430133138.732088-1-ryan.roberts@arm.com> <171449974870.639201.3165060270571039049.b4-ty@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <171449974870.639201.3165060270571039049.b4-ty@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240502_110017_646150_ED6C6370 X-CRM114-Status: GOOD ( 16.71 ) 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 Tue, Apr 30, 2024 at 06:57:52PM +0100, Catalin Marinas wrote: > On Tue, 30 Apr 2024 14:31:38 +0100, Ryan Roberts wrote: > > __split_huge_pmd_locked() can be called for a present THP, devmap or > > (non-present) migration entry. It calls pmdp_invalidate() > > unconditionally on the pmdp and only determines if it is present or not > > based on the returned old pmd. > > > > But arm64's pmd_mkinvalid(), called by pmdp_invalidate(), > > unconditionally sets the PMD_PRESENT_INVALID flag, which causes future > > pmd_present() calls to return true - even for a swap pmd. Therefore any > > lockless pgtable walker could see the migration entry pmd in this state > > and start interpretting the fields (e.g. pmd_pfn()) as if it were > > present, leading to BadThings (TM). GUP-fast appears to be one such > > lockless pgtable walker. > > > > [...] > > Applied to arm64 (for-next/fixes), thanks! It should land in 6.9-rc7. I > removed the debug/test code, please send it as a separate patch for > 6.10. > > [1/1] arm64/mm: pmd_mkinvalid() must handle swap pmds > https://git.kernel.org/arm64/c/e783331c7720 Since Andrew merged the generic mm fix, I dropped this patch from the arm64 for-next/fixes branch. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel