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=-3.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no 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 DE6F2C18E5B for ; Mon, 16 Mar 2020 19:32:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A0C1B20674 for ; Mon, 16 Mar 2020 19:32:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="gEHRVS7/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0C1B20674 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 9C88C6B0007; Mon, 16 Mar 2020 15:32:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 952C86B0008; Mon, 16 Mar 2020 15:32:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86B806B000A; Mon, 16 Mar 2020 15:32:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id 6CDF56B0007 for ; Mon, 16 Mar 2020 15:32:35 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1B5C82C7C for ; Mon, 16 Mar 2020 19:32:30 +0000 (UTC) X-FDA: 76602222060.25.nose93_15cc76e43172c X-HE-Tag: nose93_15cc76e43172c X-Filterd-Recvd-Size: 2852 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Mar 2020 19:32:29 +0000 (UTC) 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:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=mCPVZu9Y0wI9P/gu6FWuMiisXEan/deVgoJ1QqH1xfI=; b=gEHRVS7/1IB1I1Bcqu60/ysHwQ hu8vocPqQs6HMaM/YrXs8t5bDUIpRWD04Vy9VaLMHmpkBkSdPfZQK4wQmFMkpRoS1eaRJoWJbbO3t BP4lQpXVqQzaU4hOe6DccRInDc1AQpGM0WNzaRtUq0nV5kY4TanXjO2iDWBBBcrOz9keFeyhhw8U8 CQ8ZJKhtZ886ACZaAa9kpoBgNZJTkLTXRoqTcYWK+GlPFTcaRE/qfqZmlCdLw046fkbPE8FePEG9s Vc11Su5XoJs+Jzt4PfNYDOv/lJu67ed5nNHyl2MuELPRjNpEYY95rFP0Gt6TXiO+Z+dbEd+YNMh8F ARvDfViA==; Received: from [2001:4bb8:188:30cd:8026:d98c:a056:3e33] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jDvTG-0003b4-7H; Mon, 16 Mar 2020 19:32:18 +0000 From: Christoph Hellwig To: Jason Gunthorpe , Dan Williams , Bharata B Rao , =?UTF-8?q?Christian=20K=C3=B6nig?= , Ben Skeggs Cc: Jerome Glisse , kvm-ppc@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-mm@kvack.org Subject: ensure device private pages have an owner v2 Date: Mon, 16 Mar 2020 20:32:12 +0100 Message-Id: <20200316193216.920734-1-hch@lst.de> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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: When acting on device private mappings a driver needs to know if the device (or other entity in case of kvmppc) actually owns this private mapping. This series adds an owner field and converts the migrate_vma code over to check it. I looked into doing the same for hmm_range_fault, but as far as I can tell that code has never been wired up to actually work for device private memory, so instead of trying to fix some unused code the second patch just remove the code. We can add it back once we have a working and fully tested code, and then should pass the expected owner in the hmm_range structure. Changes since v1: - split out the pgmap->owner addition into a separate patch - check pgmap->owner is set for device private mappings - rename the dev_private_owner field in struct migrate_vma to src_owner - refuse to migrate private pages if src_owner is not set - keep the non-fault device private handling in hmm_range_fault