From patchwork Thu Sep 21 16:20:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13394006 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64F45E71093 for ; Thu, 21 Sep 2023 16:20:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E0FFD6B01B1; Thu, 21 Sep 2023 12:20:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DBECE6B0207; Thu, 21 Sep 2023 12:20:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C87906B0208; Thu, 21 Sep 2023 12:20:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id BA6F76B01B1 for ; Thu, 21 Sep 2023 12:20:31 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 858511608F3 for ; Thu, 21 Sep 2023 16:20:31 +0000 (UTC) X-FDA: 81261117462.17.CA55117 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf21.hostedemail.com (Postfix) with ESMTP id E22171C001A for ; Thu, 21 Sep 2023 16:20:29 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695313230; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rwFdA7NTCOSN56OoLgooEuv9WkGbezxG1625Lwk7ze8=; b=AlwvZ1a15hndQA2BToGtAmB6/ZxDxmhftan2KP5wXbkRfFuMBVE6Lu06n7W781sWXK0oSz QpTBkBoMfJaY6VxTLgeEi/DfooZdouXQh2Kf4HDEJM2AmujexEBNPueKIRGKTMgEnW5orr 7FT4+MJesqNGNSnc+Is4xJ3LHOCMmpQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695313230; a=rsa-sha256; cv=none; b=GbOMxzodPolyk1kTYeTFV1RsCW4d/2NwEXtR5fjzzn96gnTRQ7svaFj8xCwnqIcnSQsFMF yRY2yqYSeQiZooeARHEcoVohS9Z19xYZWUJ4KwyaVDwJ50BBRLuFLUhLojxJdiznNFcUxN TL6sbi3cWZxAAC1nRacB1zui338Ozwk= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com 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 ECB2D1713; Thu, 21 Sep 2023 09:21:05 -0700 (PDT) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 811AA3F59C; Thu, 21 Sep 2023 09:20:24 -0700 (PDT) From: Ryan Roberts To: Catalin Marinas , Will Deacon , "James E.J. Bottomley" , Helge Deller , Nicholas Piggin , Christophe Leroy , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Gerald Schaefer , "David S. Miller" , Arnd Bergmann , Mike Kravetz , Muchun Song , SeongJae Park , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Anshuman Khandual , Peter Xu , Axel Rasmussen , Qi Zheng Cc: Ryan Roberts , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org Subject: [PATCH v1 1/8] parisc: hugetlb: Convert set_huge_pte_at() to take vma Date: Thu, 21 Sep 2023 17:20:00 +0100 Message-Id: <20230921162007.1630149-2-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230921162007.1630149-1-ryan.roberts@arm.com> References: <20230921162007.1630149-1-ryan.roberts@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: E22171C001A X-Rspam-User: X-Stat-Signature: bwxenjs973ps8zg1pf9d5u3wwn39n6hu X-Rspamd-Server: rspam03 X-HE-Tag: 1695313229-881144 X-HE-Meta: U2FsdGVkX19uPj1PIZARTWXTqDfACG+2vlwWCTMAFlrdSqkGzFQiTr/ZLIo45EK075lVaRguiE/gm1Z4XHsSd58eq+VMXQuqo/mbBsXGb+jzVF42NjJFFsj6nLtsEb80TlqZSJsTtoFU8lJ0RsyrRuJcBrWGuFhS89zpzLahC6agTTNQWvEMeuZrYwjHCy5d5unze7xIgYJEter9pknNZ2+WUZ+lOAF/ETAova5o5/fB4Zrq1VXLAqChge+4H4c2dUtDqN+V0imPS5ze+x9Ww5ZlAIfaXV+IzKV+m0CgvM9dMG0AtR2x3z/kvj9ept5TagtMO0or53xUvHschZ0K3rsI8YSLx06vLN4U5+TLOeCIunu1kL6N1b0GEAZ5qFcV//5rPoiKce6eJr/8DOgAOoUL9h2XJUw8QR+5WgrMYVC4uFD+9J63Ua+ohCb2XjMZ+YeY38BknYdda2RDI8SsPHWPyFqawFTv2HxOH2lFqyWC5lT90BQRGIwHbyHEkdMOUEckBApNQS1tQ+5TrHDFYWWHFaWz9G6AkfnTYky4Y/NUrnfqXVupzqYK66AwhVFuCiO2cicn/dtSSnAIIgYdpouYG1fxYJmyFDd5JLFLZwiGSDsqCUIKhrQ0HLqSQMRyJpgYsJzFlQUqyw8/BkOkYh/eMHqvPqohyxe97is/dS6aQkAzQKy6TTrXNe54dYDcDFCMIKp0YtbOZML6FjYxtQXY1jsMQcyy3urk//ke5oK7MI0+nEdhnYu81wACZbSRW30VrfSxLIgLcrcCd9gheujxMuGy9hfil12qRXQ7npTQ1l/V27EuXzNs9Ow/ISsXdVTuOf1z9f/GgvTBhH0NNx3iDCUl+YcNOJUAFQP9fqh4zLaFvHv20qP92Mnwq6Cjja8V885tlRZhFytna5T0PIBafFn5EqZmp/1GyEWGCEL9SrtGO8eurctZIqKpFLq2t+qDHlSqTogCEEWReoY 9Iu22dL1 QxRCsnhU/gf5Cey9/0735HrWoU1VShvkImVIoMd3cKWUxDu2FLzP+fzBpkfFnTmvjZeXQJXxbJNDQWa7kyZb8MNRdHlTEMW6wr4Z9uVGHZciX/cB49k6wCXKbBBjBLVnJeWAyO2YHZVCLHbxBvrqkm/h68ukxpASJ8bWAo1En5fmX29Zv/4JyVUKKPhHFcBGBZBhkxCtNTEDqE3U= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: In order to fix a bug, arm64 needs access to the vma inside it's implementation of set_huge_pte_at(). Provide for this by converting the mm parameter to be a vma. Any implementations that require the mm can access it via vma->vm_mm. This commit makes the required parisc modifications. Separate commits update the other arches and core code, before the actual bug is fixed in arm64. No behavioral changes intended. Signed-off-by: Ryan Roberts --- arch/parisc/include/asm/hugetlb.h | 2 +- arch/parisc/mm/hugetlbpage.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h index f7f078c2872c..29ba631862c5 100644 --- a/arch/parisc/include/asm/hugetlb.h +++ b/arch/parisc/include/asm/hugetlb.h @@ -5,7 +5,7 @@ #include #define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT -void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, +void set_huge_pte_at(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep, pte_t pte); #define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR diff --git a/arch/parisc/mm/hugetlbpage.c b/arch/parisc/mm/hugetlbpage.c index a8a1a7c1e16e..fc5e1ad8e5e8 100644 --- a/arch/parisc/mm/hugetlbpage.c +++ b/arch/parisc/mm/hugetlbpage.c @@ -139,10 +139,10 @@ static void __set_huge_pte_at(struct mm_struct *mm, unsigned long addr, purge_tlb_entries_huge(mm, addr_start); } -void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, +void set_huge_pte_at(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep, pte_t entry) { - __set_huge_pte_at(mm, addr, ptep, entry); + __set_huge_pte_at(vma->vm_mm, addr, ptep, entry); }