Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5379699ybi; Wed, 12 Jun 2019 01:19:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSZpesQY9detNOTIHl12nNVcru1t3CW6Iiw+6yj5ykXFCRfbumRn8m9X7kqpcLZPh1S3Uc X-Received: by 2002:a17:902:a412:: with SMTP id p18mr12431488plq.105.1560327563384; Wed, 12 Jun 2019 01:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560327563; cv=none; d=google.com; s=arc-20160816; b=XTSEjYJgVX+WT6yfUMzt2q/TTk/u+C9Z17zoXqiggcCj+9N7CHkJla7O0HX7+y9/+L 6Kken9QYavoDypO2P7ogRCvO2pJ+cs277cRZV2Kz94BUNMzahs6O32yi5/qugKzh6MYv eFD3PyD4Ehd42xlqAfnrFd5r/dEsRhzTtQ+6wYBM/zgOr/MzFEgBKimKYQCVk1/I2x4x /Ao1bs6S4pAcBfJOcNw23tm7/YvL83K4EdEQGUJIKOhwWAeHukN1YLWSd/+7uAYHyMVw JNf3QfrtVgaPB/HjOMBhiJaZoMff3f52ZNwSZN3Gbyxwyy8aHIBOODGAwd6+Ydg8x9/y zlRA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=E7xDlM/OYx7CPvDhBFPYl3+gcA6UyTRJrb8kCjG3cu0=; b=wqO9LkzM+r6R9ZjJTrjmc8m7GfMnUQ6HJjQhw62tZycslnD9zYWta2ALeHO0xURJB5 /U+0eTNSjv+uqjmDz5lrj6AlROdlMo9OTNV4cKTu+884Ak1iYxTeG28nY84hHocBqQmq lqaE7Cft3H7Yt8Xs2D6CM5mHFMB3zNMRBoZMa4yAqqsSWNPcBjJ6eZ2vPnmRBakxzipa hMuDtrs/qeEPCUu9IRvtNbcxIWfQcBQGTu/+b5hDx5hzv+ux5ulcxzBFJOIUWtg8ms4L VLpXXPDCEkQIBLVvWDkAV12iOIt721D2HV9KToo+sNiXM9pTMgKI1w8uzJgIDnY5xcfo O4NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@vmwopensource.org header.s=mail header.b=m3g04XUO; 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 21si10149317pfa.144.2019.06.12.01.19.07; Wed, 12 Jun 2019 01:19:23 -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=@vmwopensource.org header.s=mail header.b=m3g04XUO; 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 S2407222AbfFLGnV (ORCPT + 99 others); Wed, 12 Jun 2019 02:43:21 -0400 Received: from ste-pvt-msa1.bahnhof.se ([213.80.101.70]:7829 "EHLO ste-pvt-msa1.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406970AbfFLGnR (ORCPT ); Wed, 12 Jun 2019 02:43:17 -0400 Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTP id A81053F4D4; Wed, 12 Jun 2019 08:43:09 +0200 (CEST) Authentication-Results: ste-pvt-msa1.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=vmwopensource.org header.i=@vmwopensource.org header.b=m3g04XUO; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Flag: NO X-Spam-Score: -3.1 X-Spam-Level: X-Spam-Status: No, score=-3.1 tagged_above=-999 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=ham autolearn_force=no Received: from ste-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (ste-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GIepRt2s3xa6; Wed, 12 Jun 2019 08:42:56 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 5499A3F38D; Wed, 12 Jun 2019 08:42:55 +0200 (CEST) Received: from localhost.localdomain.localdomain (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id BA7783619AF; Wed, 12 Jun 2019 08:42:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=vmwopensource.org; s=mail; t=1560321774; bh=WByRYt5aLCsI5/JRo0mK5a2KNL8fi1jYGttv4dC9TWM=; h=From:To:Cc:Subject:Date:From; b=m3g04XUOi3+wmlV5q5yPo/679JErYTahFbyb9/TgMh9mwskbT6O4oJ6p58+JNehNT DCe+GRbQmmugO+pW/5d/5FgblMp3QWO8T4AmXg+D7na6lEtBx29/MmWP2kMlkRZM2O 1Z/0ncxWla/yhVHlhUA7Tf3GHqh0IGZx2PLpxBOQ= From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m=20=28VMware=29?= To: dri-devel@lists.freedesktop.org Cc: linux-graphics-maintainer@vmware.com, pv-drivers@vmware.com, linux-kernel@vger.kernel.org, nadav.amit@gmail.com, Andrew Morton , Matthew Wilcox , Will Deacon , Peter Zijlstra , Rik van Riel , Minchan Kim , Michal Hocko , Huang Ying , Souptick Joarder , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , =?UTF-8?q?Christian=20K=C3=B6nig?= , linux-mm@kvack.org Subject: [PATCH v5 0/9] Emulated coherent graphics memory Date: Wed, 12 Jun 2019 08:42:34 +0200 Message-Id: <20190612064243.55340-1-thellstrom@vmwopensource.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Planning to merge this through the drm/vmwgfx tree soon, so if there are any objections, please speak up. Graphics APIs like OpenGL 4.4 and Vulkan require the graphics driver to provide coherent graphics memory, meaning that the GPU sees any content written to the coherent memory on the next GPU operation that touches that memory, and the CPU sees any content written by the GPU to that memory immediately after any fence object trailing the GPU operation has signaled. Paravirtual drivers that otherwise require explicit synchronization needs to do this by hooking up dirty tracking to pagefault handlers and buffer object validation. This is a first attempt to do that for the vmwgfx driver. The mm patches has been out for RFC. I think I have addressed all the feedback I got, except a possible softdirty breakage. But although the dirty-tracking and softdirty may write-protect PTEs both care about, that shouldn't really cause any operation interference. In particular since we use the hardware dirty PTE bits and softdirty uses other PTE bits. For the TTM changes they are hopefully in line with the long-term strategy of making helpers out of what's left of TTM. The code has been tested and excercised by a tailored version of mesa where we disable all explicit synchronization and assume graphics memory is coherent. The performance loss varies of course; a typical number is around 5%. Changes v1-v2: - Addressed a number of typos and formatting issues. - Added a usage warning for apply_to_pfn_range() and apply_to_page_range() - Re-evaluated the decision to use apply_to_pfn_range() rather than modifying the pagewalk.c. It still looks like generically handling the transparent huge page cases requires the mmap_sem to be held at least in read mode, so sticking with apply_to_pfn_range() for now. - The TTM page-fault helper vma copy argument was scratched in favour of a pageprot_t argument. Changes v3: - Adapted to upstream API changes. Changes v4: - Adapted to upstream mmu_notifier changes. (Jerome?) - Fixed a couple of warnings on 32-bit x86 - Fixed image offset computation on multisample images. Changes v5: - Updated usage warning in patch 3/9 after review comments from Nadav Amit. Cc: Andrew Morton Cc: Matthew Wilcox Cc: Will Deacon Cc: Peter Zijlstra Cc: Rik van Riel Cc: Minchan Kim Cc: Michal Hocko Cc: Huang Ying Cc: Souptick Joarder Cc: "Jérôme Glisse" Cc: "Christian König" Cc: linux-mm@kvack.org