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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, 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 A1370C4332E for ; Sat, 21 Mar 2020 08:43:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6B19720753 for ; Sat, 21 Mar 2020 08:43:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B19720753 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0A9616B0008; Sat, 21 Mar 2020 04:43:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05A1E6B000A; Sat, 21 Mar 2020 04:43:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB1436B000C; Sat, 21 Mar 2020 04:43:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id D0F5C6B0008 for ; Sat, 21 Mar 2020 04:43:49 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5FB07180AD815 for ; Sat, 21 Mar 2020 08:43:49 +0000 (UTC) X-FDA: 76618731378.18.car27_2154e6416eb1a X-HE-Tag: car27_2154e6416eb1a X-Filterd-Recvd-Size: 2095 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Sat, 21 Mar 2020 08:43:48 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 4566468AFE; Sat, 21 Mar 2020 09:43:47 +0100 (CET) Date: Sat, 21 Mar 2020 09:43:47 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Jerome Glisse , Ralph Campbell , Felix.Kuehling@amd.com, linux-mm@kvack.org, John Hubbard , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , Philip Yang , Jason Gunthorpe Subject: Re: [PATCH hmm 6/6] mm/hmm: use device_private_entry_to_pfn() Message-ID: <20200321084347.GF28695@lst.de> References: <20200320164905.21722-1-jgg@ziepe.ca> <20200320164905.21722-7-jgg@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200320164905.21722-7-jgg@ziepe.ca> User-Agent: Mutt/1.5.17 (2007-11-01) 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: On Fri, Mar 20, 2020 at 01:49:05PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > swp_offset() should not be called directly, the wrappers are supposed to > abstract away the encoding of the device_private specific information in > the swap entry. > > Signed-off-by: Jason Gunthorpe > --- > mm/hmm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/hmm.c b/mm/hmm.c > index a09b4908e9c81a..fd9ee2b5fd9989 100644 > --- a/mm/hmm.c > +++ b/mm/hmm.c > @@ -259,8 +259,8 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, > * the PFN even if not present. > */ > if (hmm_is_device_private_entry(range, entry)) { > - *pfn = hmm_device_entry_from_pfn(range, > - swp_offset(entry)); > + *pfn = hmm_device_entry_from_pfn( > + range, device_private_entry_to_pfn(entry)); The range parameter can stay on the first line..