From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: [PATCH 0/2] Store and load PCI device saved state across function resets Date: Fri, 15 Apr 2011 13:54:26 -0600 Message-ID: <20110415194220.2838.10750.stgit@s20.home> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: alex.williamson@redhat.com, jan.kiszka@siemens.com, avi@redhat.com, jbarnes@virtuousgeek.org To: linux-pci@vger.kernel.org, kvm@vger.kernel.org Return-path: Sender: linux-pci-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Bug https://bugs.launchpad.net/qemu/+bug/754591 is caused because the KVM module attempts to do a pci_save_state() before assigning the device to a VM, expecting that the saved state will remain valid until we release the device. This is in conflict with our need to reset devices using PCI sysfs during a VM reset to quiesce the device. Any calls to pci_reset_function() will overwrite the device saved stated prior to reset, and reload and invalidate the state after. KVM then ends up trying to restore the state, but it's already invalid, so the device ends up with reset values. This series adds a mechanism to pull the saved state off into an opaue buffer, which can be reloaded into the device at a later point. Thanks, Alex --- Alex Williamson (2): KVM: Use pci_store/load_saved_state() around VM device usage PCI: Add interfaces to store and load the device saved state drivers/pci/pci.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++ include/linux/kvm_host.h | 1 include/linux/pci.h | 3 + virt/kvm/assigned-dev.c | 8 ++-- 4 files changed, 103 insertions(+), 3 deletions(-)