From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzSkX-0004Id-CK for qemu-devel@nongnu.org; Mon, 01 Jun 2015 12:39:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzSkU-0000J1-4n for qemu-devel@nongnu.org; Mon, 01 Jun 2015 12:39:41 -0400 Received: from mga14.intel.com ([192.55.52.115]:1912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzSkT-0000Ir-RA for qemu-devel@nongnu.org; Mon, 01 Jun 2015 12:39:38 -0400 Date: Mon, 1 Jun 2015 09:37:56 -0700 From: "Sean O. Stalley" Message-ID: <20150601163756.GA2777@sean.stalley.intel.com> References: <1431370604-3965-1-git-send-email-sean.stalley@intel.com> <20150511212524-mutt-send-email-mst@redhat.com> <20150511200805.GA2861@sean.stalley.intel.com> <20150512113239-mutt-send-email-mst@redhat.com> <20150512212307.GA2966@sean.stalley.intel.com> <20150513080350-mutt-send-email-mst@redhat.com> <20150513172942.GA2700@sean.stalley.intel.com> <20150531181349.GM5268@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150531181349.GM5268@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/1] Add support for PCI Enhanced Allocation "BARs" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org On Sun, May 31, 2015 at 08:13:49PM +0200, Michael S. Tsirkin wrote: > On Wed, May 13, 2015 at 10:29:42AM -0700, Sean O. Stalley wrote: > > On Wed, May 13, 2015 at 08:09:46AM +0200, Michael S. Tsirkin wrote: > > > On Tue, May 12, 2015 at 02:23:07PM -0700, Sean O. Stalley wrote: > > > > On Tue, May 12, 2015 at 11:33:49AM +0200, Michael S. Tsirkin wrote: > > > > > On Mon, May 11, 2015 at 01:08:05PM -0700, Sean O. Stalley wrote: > > > > > > On Mon, May 11, 2015 at 09:26:08PM +0200, Michael S. Tsirkin wrote: > > > > > > > On Mon, May 11, 2015 at 11:56:44AM -0700, Sean O. Stalley wrote: > > > > > > > > PCI Enhanced Allocation is a new method of allocating MMIO & IO > > > > > > > > resources for PCI devices & bridges. It can be used instead > > > > > > > > of the traditional PCI method of using BARs. > > > > > > > > > > > > > > > > EA entries are hardware-initialized to a fixed address. > > > > > > > > Unlike BARs, regions described by EA are cannot be moved. > > > > > > > > Because of this, only devices which are perminately connected to > > > > > > > > the PCI bus can use EA. A removeable PCI card must not use EA. > > > > > > > > > > > > > > > > This patchset enables any existing QEMU PCI model to use EA in leiu of > > > > > > > > BARs. It adds EA options to the PCI device paramaters. > > > > > > > > > > > > > > > > The Enhanced Allocation ECN is publicly available here: > > > > > > > > https://www.pcisig.com/specifications/conventional/ECN_Enhanced_Allocation_23_Oct_2014_Final.pdf > > > > > > > > > > > > > > > > Signed-off-by: Sean O. Stalley > > > > > > > > > > > > > > > > > > > > > I will review this, thanks. Will you also be sending a seabios patch to > > > > > > > support these registers? When you do, please Cc me. > > > > > > > > > > > > Thanks Michael, > > > > > > > > > > > > I wasn't planning on sending a seabios patch. > > > > > > > > > > Won't this mean that bios might allocate PCI BARs conflicting with > > > > > EA entries, causing guest to crash? > > > > > > > > The short answer is yes, having EA hardware without an EA-aware bios could cause the guest to crash. > > > > > > > > To make matters worse, EA may cause old OSes may crash as well. > > > > If the OS supports hot-swap, and tries to remap the BARs, it could have the same problem. > > > > > > Should _CRS in ACPI be updated to exclude the EA regions? > > > If we do this, this problem will go away, won't it? > > > > > > > I think that would work, assuming the OS uses the _CRS. > > (https://lwn.net/Articles/373551/) > > > > I wasn't quite sure how EA should affect ACPI. > > This is why I pushed out the QEMU hardware changes before the EDKII changes. > > > So I'm waiting for v2 of this? > I wasn't planning on changing the hardware models in this patch (at least not until they are reviewed). Based on our discussion about ACPI, I was going to make changes to the firmware patches. I don't think I need to change anything in this patchset to fix ACPI. > > > > > > > > This patch allows the user to add EA devices to an existing machine, > > > > which is something that would never happen with real EA hardware. > > > > > > > > EA devices will only be present on new platforms. > > > > Because of this, I thought it made more sense to add EA support to EDKII than to seabios. > > > > Will adding EA support to seabios be necessary as well? > > > > > > If the problem with old OSes is fixable, then I think it's a good idea. > > > > > > > > > I do have some EDKII/OVMF patches I hope to send out soon. I will Cc you on those. > > > > > > > > > > > > -Sean > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- > > > > > > > > hw/pci/Makefile.objs | 2 +- > > > > > > > > hw/pci/pci.c | 96 ++++++++++++++++------ > > > > > > > > hw/pci/pci_ea.c | 203 ++++++++++++++++++++++++++++++++++++++++++++++ > > > > > > > > include/hw/pci/pci.h | 7 ++ > > > > > > > > include/hw/pci/pci_ea.h | 39 +++++++++ > > > > > > > > include/hw/pci/pci_regs.h | 4 + > > > > > > > > include/qemu/typedefs.h | 1 + > > > > > > > > 7 files changed, 328 insertions(+), 24 deletions(-) > > > > > > > > create mode 100644 hw/pci/pci_ea.c > > > > > > > > create mode 100644 include/hw/pci/pci_ea.h