Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4273738ybi; Mon, 29 Jul 2019 22:59:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIGE7knvnW34wfzF7cmAEHOz5ZSV3TJs2zoI25QhZVJIVjITTdnhncmjvYO3FKtz22driy X-Received: by 2002:a63:e70f:: with SMTP id b15mr107904223pgi.152.1564466381753; Mon, 29 Jul 2019 22:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564466381; cv=none; d=google.com; s=arc-20160816; b=v11jK6JlZTfW31kzWQNAsMb/3Gzcd5Q4ajPbGhKR6nJ6dV5d4bVse34xtG0I+vmBVK Fw/HmetUtH0VxLCASDwElKJHPYK0tndfNpxdCadYIWgHS7BD4PdHbdP9h9e2ay0ZuY8n eLzB6x4RvhspAQfLkiaKuqBXlzCq+vBGsOsxMb6FWYMUGZ+bfemXaS0Ao2e+Gk4+8gEW PRBvbppUF0q5namA5Q6rJqEd768lSBk4uvcf6imJk7SMxvPh0dbxhvRwEwFEtPcINI8/ 2wB/EU1ZqXPbCxhe6X9U3GHw5QqUwsRK6GSiQTqBt8+VIaKP5GjpjEz5x3bv/jF6eaXH Xudg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=k3bbbqY8SIpE+YtEyLKkL7nQbVMolk+8sJNIxeAyNQs=; b=Zud7FjPGk+8sQlvlBV3A2u2KNLhLDhEfZ8Z+S5sNFnZAcLkWqC3CeFedYw9Z6uJYKf Jwic5eoWAMfsMNVfHFhIKrRsMZkkzuDUrhBpCyr4pPDSySkFyiiucDPEmhu2ry9SQ4ut isN7Uk2veijYI0KS4dOeF0lcMM+Gt11J1g3TLjAFl9kyOfXJj8JKasFZKWlMX1xnlcP3 jcMuA9pSV7HS8ry+IYZp5dMpCoKhH8xmKnIaV+BMNC3u9DUecCA3n4j2psTfLTHwxHbQ +80F23yJRZppn2sPhEvfjmi51wKjauRhTWMqqd4uAtoglvNc4Zjj1xVok+iwtZ66OgS3 WMow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=nJyMAedu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h15si25707216plr.23.2019.07.29.22.59.27; Mon, 29 Jul 2019 22:59:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=nJyMAedu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729665AbfG3Fws (ORCPT + 99 others); Tue, 30 Jul 2019 01:52:48 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46576 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726286AbfG3Fwp (ORCPT ); Tue, 30 Jul 2019 01:52:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=k3bbbqY8SIpE+YtEyLKkL7nQbVMolk+8sJNIxeAyNQs=; b=nJyMAeduK8LG66+Pj2WeaytZbG xzLQEs/Ur68eXNkEnLP/PeVHu4eh0yVic/AKDubVQKjRAHi/bYpCnoosOa8bcr6iZk0Sk54KJaba8 9Uag79Xi/RoTto8fireq+1CALH/p/Mcwk5OXvuzuJsKdnQ8vZOR45bbIePA6BhSRgG8FxDuAz2xhk vKKvbCrM8UTrX50m92Y67YUdnwUyRM7yXTAHKJiht9FyXmpFAQOfDj50ghBWQ5wsSM0n8+vG8Evft Xfu9Iubcx164Z/0z9UN74qOt2mRGQsaQSRns7sQryNc8pM94Gb2EmcBrP92lmi1qOClFXzOyicOkL eu6L7UWg==; Received: from [195.167.85.94] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hsL3x-0001L0-0Z; Tue, 30 Jul 2019 05:52:41 +0000 From: Christoph Hellwig To: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Jason Gunthorpe , Ben Skeggs , Felix Kuehling Cc: Ralph Campbell , linux-mm@kvack.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/13] mm: don't abuse pte_index() in hmm_vma_handle_pmd Date: Tue, 30 Jul 2019 08:51:59 +0300 Message-Id: <20190730055203.28467-10-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190730055203.28467-1-hch@lst.de> References: <20190730055203.28467-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pte_index is an internal arch helper in various architectures, without consistent semantics. Open code that calculation of a PMD index based on the virtual address instead. Signed-off-by: Christoph Hellwig --- mm/hmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hmm.c b/mm/hmm.c index 88b77a4a6a1e..e63ab7f11334 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -486,7 +486,7 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk, if (pmd_protnone(pmd) || fault || write_fault) return hmm_vma_walk_hole_(addr, end, fault, write_fault, walk); - pfn = pmd_pfn(pmd) + pte_index(addr); + pfn = pmd_pfn(pmd) + ((addr & ~PMD_MASK) >> PAGE_SHIFT); for (i = 0; addr < end; addr += PAGE_SIZE, i++, pfn++) { if (pmd_devmap(pmd)) { pgmap = get_dev_pagemap(pfn, pgmap); -- 2.20.1