linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhenguo Yao <yaozhenguo1@gmail.com>
To: bhelgaas@google.com, alex.williamson@redhat.com
Cc: cohuck@redhat.com, jgg@ziepe.ca, mgurtovoy@nvidia.com,
	yishaih@nvidia.com, kvm@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	yaozhenguo@jd.com, Zhenguo Yao <yaozhenguo1@gmail.com>
Subject: [PATCH v1 0/2] Add ablility of VFIO driver to ignore reset when device don't need it
Date: Thu, 14 Oct 2021 17:57:46 +0800	[thread overview]
Message-ID: <20211014095748.84604-1-yaozhenguo1@gmail.com> (raw)

In some scenarios, vfio device can't do any reset in initialization
process. For example: Nvswitch and GPU A100 working in Shared NVSwitch
Virtualization Model. In such mode, there are two type VMs: service
VM and Guest VM. The GPU devices are initialized in the following steps:

1. Service VM boot up. GPUs and Nvswitchs are passthrough to service VM.
Nvidia driver and manager software will do some settings in service VM.

2. The selected GPUs are unpluged from service VM.

3. Guest VM boots up with the selected GPUs passthrough.

The selected GPUs can't do any reset in step3, or they will be initialized
failed in Guest VM.

This patchset add a PCI sysfs interface:ignore_reset which drivers can
use it to control whether to do PCI reset or not. For example: In Shared
NVSwitch Virtualization Model. Hypervisor can disable PCI reset by setting
ignore_reset to 1 before Gust VM booting up.

Zhenguo Yao (2):
  PCI: Add ignore_reset sysfs interface to control whether do device
    reset in PCI drivers
  vfio-pci: Don't do device reset when ignore_reset is setting

 drivers/pci/pci-sysfs.c          | 25 +++++++++++++++++
 drivers/vfio/pci/vfio_pci_core.c | 48 ++++++++++++++++++++------------
 include/linux/pci.h              |  1 +
 3 files changed, 56 insertions(+), 18 deletions(-)

-- 
2.27.0


             reply	other threads:[~2021-10-14  9:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14  9:57 Zhenguo Yao [this message]
2021-10-14  9:57 ` [PATCH v1 1/2] PCI: Add ignore_reset sysfs interface to control whether to do device reset in PCI drivers Zhenguo Yao
2021-10-14  9:57 ` [PATCH v1 2/2] vfio-pci: Don't do device reset when ignore_reset is setting Zhenguo Yao
2021-10-14 12:48 ` [PATCH v1 0/2] Add ablility of VFIO driver to ignore reset when device don't need it Alex Williamson
2021-10-14 13:37   ` Zhenguo Yao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211014095748.84604-1-yaozhenguo1@gmail.com \
    --to=yaozhenguo1@gmail.com \
    --cc=alex.williamson@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=cohuck@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mgurtovoy@nvidia.com \
    --cc=yaozhenguo@jd.com \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).