From patchwork Mon Apr 29 03:10:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaolin Zhang X-Patchwork-Id: 10921093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51965912 for ; Mon, 29 Apr 2019 03:11:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40EFD28739 for ; Mon, 29 Apr 2019 03:11:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34F722873D; Mon, 29 Apr 2019 03:11:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C6AF628739 for ; Mon, 29 Apr 2019 03:11:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61DF9890E4; Mon, 29 Apr 2019 03:11:13 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 768B4890E4; Mon, 29 Apr 2019 03:11:11 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2019 20:11:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,408,1549958400"; d="scan'208";a="146648143" Received: from xzhan34-mobl3.bj.intel.com ([10.238.154.121]) by fmsmga007.fm.intel.com with ESMTP; 28 Apr 2019 20:11:09 -0700 From: Xiaolin Zhang To: intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Date: Mon, 29 Apr 2019 11:10:50 +0800 Message-Id: <1556507458-24684-1-git-send-email-xiaolin.zhang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [Intel-gfx] [PATCH v5 0/8] i915 vgpu PV to improve vgpu performance X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhenyu.z.wang@intel.com, hang.yuan@intel.com, zhiyuan.lv@intel.com MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP To improve vgpu performance, it could implement some PV optimization such as to reduce the mmio access trap numbers or eliminate certain piece of HW emulation within guest driver to reduce vm exit/vm enter cost. the solutions in this patch set are implemented two PV optimizations based on the shared memory region between guest and GVTg for data communication. The shared memory region is allocated by guest driver and this region's memory guest physical address will be passed to GVTg through PVINFO register and later GVTg can access this region directly without trap cost to achieve data exchange purpose between guest and GVTg. in this patch set, 2 kind of PV optimization implemented controlled by pv_caps PVINO register with different pv bit. 1. workload PV submission (context submission): reduce 4 traps to 1 trap and eliminated execlists HW behaviour emulation. 2. ppgtt PV update: eliminate the cost of ppgtt write protection. based on the experiment, for small workloads, specifally, glxgears with vblank_mode off, the average performance gain on single vgpu is 30~50%. for large workload such as media and 3D, the average performance gain is about 4%. based on the PV mechanism, it could achive more vgpu feature optimization such as globle GTT update, display plane and water mark update. v0: RFC patch set v1: addressed RFC review comments v2: addressed v1 review comments, added pv callbacks for pv operations v3: 1. addressed v2 review comments, removed pv callbacks code duplication in v2 and unified pv calls under g2v notification register. different g2v pv notifications defined. 2. dropped pv master irq feature due to hard conflict with recnet i915 change and take time to rework. v4: 1. addressed v3 review comments. 2. extended workload PV submission by skip execlists HW behaviour emulation and context switch interrupt injection. v5: 1. addressed v4 review comments from Chris for pv submission. 2. per-engine communication between PV guest and host. Xiaolin Zhang (8): drm/i915: introduced vgpu pv capability drm/i915: vgpu shared memory setup for pv optimization drm/i915: vgpu ppgtt update pv optimization drm/i915: vgpu context submission pv optimization drm/i915/gvt: GVTg handle pv_caps PVINFO register drm/i915/gvt: GVTg handle shared_page setup drm/i915/gvt: GVTg support ppgtt pv optimization drm/i915/gvt: GVTg support context submission pv optimization drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 8 +- drivers/gpu/drm/i915/gvt/execlist.c | 6 + drivers/gpu/drm/i915/gvt/gtt.c | 317 +++++++++++++++++++++++++++++ drivers/gpu/drm/i915/gvt/gtt.h | 9 + drivers/gpu/drm/i915/gvt/gvt.h | 10 +- drivers/gpu/drm/i915/gvt/handlers.c | 43 +++- drivers/gpu/drm/i915/gvt/vgpu.c | 31 +++ drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/i915_gem.c | 3 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 9 +- drivers/gpu/drm/i915/i915_gem_gtt.h | 8 + drivers/gpu/drm/i915/i915_pvinfo.h | 12 +- drivers/gpu/drm/i915/i915_vgpu.c | 175 +++++++++++++++- drivers/gpu/drm/i915/i915_vgpu.h | 48 +++++ drivers/gpu/drm/i915/intel_pv_submission.c | 177 ++++++++++++++++ 16 files changed, 852 insertions(+), 12 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_pv_submission.c