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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 EA261C4332D for ; Fri, 20 Mar 2020 16:50:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A470320739 for ; Fri, 20 Mar 2020 16:50:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="WmQkIo8w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A470320739 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0DB6A6B0032; Fri, 20 Mar 2020 12:50:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 040006B0036; Fri, 20 Mar 2020 12:50:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFD8A6B0037; Fri, 20 Mar 2020 12:50:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0135.hostedemail.com [216.40.44.135]) by kanga.kvack.org (Postfix) with ESMTP id 99C126B0032 for ; Fri, 20 Mar 2020 12:50:28 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2B919181AEF00 for ; Fri, 20 Mar 2020 16:50:28 +0000 (UTC) X-FDA: 76616328936.13.ear62_40f0cb6c9162 X-HE-Tag: ear62_40f0cb6c9162 X-Filterd-Recvd-Size: 4237 Received: from mail-qv1-f67.google.com (mail-qv1-f67.google.com [209.85.219.67]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Mar 2020 16:50:27 +0000 (UTC) Received: by mail-qv1-f67.google.com with SMTP id w5so3296809qvp.11 for ; Fri, 20 Mar 2020 09:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xRjX7T7eft/qC+6bf7FfyU/mPCvn6DuztC5RzuHCyVc=; b=WmQkIo8wgTcT+49UEOC761MjUtOoLumkxcQrNLGTV5XIF/8lT1bx+3pCSL8T9xMdZY cWLs8vQSQKBV1VXMxQM5NR78QAl2OuRSqAVNbbPsuMvJzg/GjnWpmqSoglfFIAkV31+z MP+DUTjrCLJ6J7p5c6jvdGCaDAE5JuorkDPWMCl3cc8f1/br3nbePeINlV2no2Zpv0lA x996mvxPsYAJubp73Du4S2nS/wtnN/9QxMhJQCWR+gg4WbHEtK82IFnTkGk0BMjclTq/ UasFQVqNKpkfmX/un/MPsIzZfDYZXMiTwx9ovm8X8Wk5Xzm8VVcGiy4D9LEPu/vagLD/ G03A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xRjX7T7eft/qC+6bf7FfyU/mPCvn6DuztC5RzuHCyVc=; b=QpQmP8magTjyXwtG0baUd8xi0csnzhd4ghWWuo/nUtzZIJeeZxJ+WOmXpz28qnysPS OJnkjKorcmrzob/nPKvnxuhOmyRJ1GPg9aoX3EYZ+cpDqqMJwR0g4zYb8DRnGuz91+Qf XFnrYThT2q1v1SyFM2jnhnjYkhduvyVUY+Ka15r4kByk6uEmFsbqva0hpC06qOZzyZTv BqeUICJfmghOKxXtfbvIjbuYmugPevUkuyCldQAVAuOso9r6rZeBm6//YPAPLT8tVKQE NE82+ZzrpABnXYc30UoUqRSJet0WgOgteoi49/Sme+RsMREG2JDdNKlNxTd69eO+RLRI L8LQ== X-Gm-Message-State: ANhLgQ0s7dMPY7pkEiUAK8mQjvqL9iKOWGgthPzR2Sbry9h5M8juxlI2 l9RdEF6ptTVMGc7m55WC+yrZOw== X-Google-Smtp-Source: ADFU+vtbRR/MYq87zJZvXdzKsxYqiR4x6njtZJXIu9qf6nhgSPf391EA27m+Q0Bt/DeLj3EN/58FoA== X-Received: by 2002:a05:6214:12c7:: with SMTP id s7mr9363766qvv.218.1584723027380; Fri, 20 Mar 2020 09:50:27 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id e2sm4452824qkg.63.2020.03.20.09.50.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Mar 2020 09:50:24 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jFKql-0005kU-FT; Fri, 20 Mar 2020 13:50:23 -0300 From: Jason Gunthorpe To: Jerome Glisse , Ralph Campbell , Felix.Kuehling@amd.com Cc: linux-mm@kvack.org, John Hubbard , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , Philip Yang , Jason Gunthorpe Subject: [PATCH hmm 6/6] mm/hmm: use device_private_entry_to_pfn() Date: Fri, 20 Mar 2020 13:49:05 -0300 Message-Id: <20200320164905.21722-7-jgg@ziepe.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200320164905.21722-1-jgg@ziepe.ca> References: <20200320164905.21722-1-jgg@ziepe.ca> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 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, u= nsigned long addr, * the PFN even if not present. */ if (hmm_is_device_private_entry(range, entry)) { - *pfn =3D hmm_device_entry_from_pfn(range, - swp_offset(entry)); + *pfn =3D hmm_device_entry_from_pfn( + range, device_private_entry_to_pfn(entry)); *pfn |=3D range->flags[HMM_PFN_VALID]; if (is_write_device_private_entry(entry)) *pfn |=3D range->flags[HMM_PFN_WRITE]; --=20 2.25.1