Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3908664pxb; Tue, 2 Nov 2021 00:09:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQw/AzFW2hMYCgPwLKJ8ZqHz+qqO5+AdlmQHekBcXTxfPwRsoOY/76Xu9JXEroqboQlCQe X-Received: by 2002:a05:6e02:1649:: with SMTP id v9mr4213706ilu.113.1635836964839; Tue, 02 Nov 2021 00:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635836964; cv=none; d=google.com; s=arc-20160816; b=vH4jjTLiDTVQZAxTSng/liDgtLixmzS+snVn+7kU/9xH4u9KNCoMYLpYOhZ+ML3w9H 4ONz3O5l5/h5kA1UZdjiv8WOJ48vEomgLjx+xAb/GklSocgYCEDl0WWyxggVLLoddIDm ZPGtT+SrZPn5UZLWnaaAIdUyPWl9nXDMmttuE3PjbSc3G92EY+cHqF1f8hJuriqS+l10 a1GU5I3oNaWtOv0CnX8i+0sgYA+KL7LQLkOEuvFajwRo4h0/SMODpf9vrfZ2iJ8kZZw9 5Ip7XqUkwP5TT+7OUL4L7Tvkm9uFjkmjid9sJUIVnDmP2DYTV3v+j9hICPyTERvH7uMQ 5TcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gUNNWgM5X7RWxMoFc61amlH8N+Gkf3WGRjvtBdCIuIA=; b=MqypJazMoHK8g67CEh3HmcWuFF/ZhoGE6zBf6D7OxfVgD5Z6h+Oaz7xGt+1rJXYRCK hY/SXrBqmwLL6b+cK+W7dCci6eJrp/JG5uckKFB0S5BzX0lZVVgSRxRc8HHMgCqwyH8h CdUx3P+SOdLXXmyh2B8C7fLu2pc6Fh2kudHtwtf6XGqir1lNrsftOXRTDCXRqPbnCeYe /lg0JecxTJOovl6NC99VLA6aP2YjSCw5BraQc/8mEYC7RRYieyXncPXHklrMmiZ9f0zA 7YHOiiSkR/hd6zlrbj52JCm0WeYVdnCrbyhYlfctVFIPIchRRxwb9ALpYjy5d7zlf+ZD mF3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=hf8TS4yQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si27127996ilu.124.2021.11.02.00.09.13; Tue, 02 Nov 2021 00:09:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=hf8TS4yQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231176AbhKBHKa (ORCPT + 99 others); Tue, 2 Nov 2021 03:10:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231443AbhKBHKS (ORCPT ); Tue, 2 Nov 2021 03:10:18 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 422C7C06120E for ; Tue, 2 Nov 2021 00:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=gUNNWgM5X7RWxMoFc61amlH8N+Gkf3WGRjvtBdCIuIA=; b=hf8TS4yQBCblYrLd+FF9b0QCD+ nIxLgeixsZfZ4h/XXi3wU/Y6//sWsKAnuuxzX3p2rSN1hUQcug/Ahz7rAqla9XjuY6HXtLmyRBFdO ieR8mYIeoW6MLnGsIdvAv+F+ztuXQoKMbd6tmgjX3RcgO1uWIj3R5ytDLCTVuHVOQzSNR/tHvoskN ZZxHxtZSTiGZS6YjAAM2/SV5Sm4g7uYMcGSfAnjCavGazjLCMuvirljeZVjw08E/HLRf84mmKcfSm qa5TuJ8WUPXWdj9dGj/D2rfqiOjuLItU6c+qKairDrY4QfQT0UhVNV7EX6sjkkADT8luyweuDZqcV E2eTdnyg==; Received: from 213-225-15-89.nat.highway.a1.net ([213.225.15.89] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhntW-000iFQ-3O; Tue, 02 Nov 2021 07:07:42 +0000 From: Christoph Hellwig To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Zhenyu Wang , Zhi Wang Cc: Jason Gunthorpe , intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/29] drm/i915/gvt: devirtualize ->detach_vgpu Date: Tue, 2 Nov 2021 08:05:48 +0100 Message-Id: <20211102070601.155501-17-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211102070601.155501-1-hch@lst.de> References: <20211102070601.155501-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just call the function directly. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.h | 1 + drivers/gpu/drm/i915/gvt/hypercall.h | 1 - drivers/gpu/drm/i915/gvt/kvmgt.c | 3 +-- drivers/gpu/drm/i915/gvt/mpt.h | 16 ---------------- drivers/gpu/drm/i915/gvt/vgpu.c | 2 +- 5 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h index 1963eac9d0cf8..b0bd52921b55e 100644 --- a/drivers/gpu/drm/i915/gvt/gvt.h +++ b/drivers/gpu/drm/i915/gvt/gvt.h @@ -580,6 +580,7 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu); int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload); void enter_failsafe_mode(struct intel_vgpu *vgpu, int reason); +void intel_vgpu_detach_regions(struct intel_vgpu *vgpu); enum { GVT_FAILSAFE_UNSUPPORTED_GUEST, diff --git a/drivers/gpu/drm/i915/gvt/hypercall.h b/drivers/gpu/drm/i915/gvt/hypercall.h index 091249a924a85..08c622c4079bb 100644 --- a/drivers/gpu/drm/i915/gvt/hypercall.h +++ b/drivers/gpu/drm/i915/gvt/hypercall.h @@ -45,7 +45,6 @@ struct intel_vgpu; struct intel_gvt_mpt { int (*host_init)(struct device *dev, void *gvt); void (*host_exit)(struct device *dev, void *gvt); - void (*detach_vgpu)(struct intel_vgpu *vgpu); int (*inject_msi)(struct intel_vgpu *vgpu, u32 addr, u16 data); int (*enable_page_track)(struct intel_vgpu *vgpu, u64 gfn); int (*disable_page_track)(struct intel_vgpu *vgpu, u64 gfn); diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 1481a48cb1f00..13d4551b566f9 100644 --- a/drivers/gpu/drm/i915/gvt/kvmgt.c +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c @@ -1840,7 +1840,7 @@ static bool kvmgt_guest_exit(struct intel_vgpu *info) return true; } -static void kvmgt_detach_vgpu(struct intel_vgpu *vgpu) +void intel_vgpu_detach_regions(struct intel_vgpu *vgpu) { int i; @@ -2004,7 +2004,6 @@ static bool kvmgt_is_valid_gfn(struct intel_vgpu *vgpu, unsigned long gfn) static const struct intel_gvt_mpt kvmgt_mpt = { .host_init = kvmgt_host_init, .host_exit = kvmgt_host_exit, - .detach_vgpu = kvmgt_detach_vgpu, .inject_msi = kvmgt_inject_msi, .enable_page_track = kvmgt_page_track_add, .disable_page_track = kvmgt_page_track_remove, diff --git a/drivers/gpu/drm/i915/gvt/mpt.h b/drivers/gpu/drm/i915/gvt/mpt.h index 9738aa3377b4b..78efcf1e69469 100644 --- a/drivers/gpu/drm/i915/gvt/mpt.h +++ b/drivers/gpu/drm/i915/gvt/mpt.h @@ -71,22 +71,6 @@ static inline void intel_gvt_hypervisor_host_exit(struct device *dev, void *gvt) intel_gvt_host.mpt->host_exit(dev, gvt); } -/** - * intel_gvt_hypervisor_detach_vgpu - call hypervisor to release vGPU - * related stuffs inside hypervisor. - * - * Returns: - * Zero on success, negative error code if failed. - */ -static inline void intel_gvt_hypervisor_detach_vgpu(struct intel_vgpu *vgpu) -{ - /* optional to provide */ - if (!intel_gvt_host.mpt->detach_vgpu) - return; - - intel_gvt_host.mpt->detach_vgpu(vgpu); -} - #define MSI_CAP_CONTROL(offset) (offset + 2) #define MSI_CAP_ADDRESS(offset) (offset + 4) #define MSI_CAP_DATA(offset) (offset + 8) diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c index 2fadd6fea5acf..7a7f768083d20 100644 --- a/drivers/gpu/drm/i915/gvt/vgpu.c +++ b/drivers/gpu/drm/i915/gvt/vgpu.c @@ -293,7 +293,7 @@ void intel_gvt_destroy_vgpu(struct intel_vgpu *vgpu) intel_vgpu_clean_opregion(vgpu); intel_vgpu_reset_ggtt(vgpu, true); intel_vgpu_clean_gtt(vgpu); - intel_gvt_hypervisor_detach_vgpu(vgpu); + intel_vgpu_detach_regions(vgpu); intel_vgpu_free_resource(vgpu); intel_vgpu_clean_mmio(vgpu); intel_vgpu_dmabuf_cleanup(vgpu); -- 2.30.2