From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=daniil.egranov@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 30F3922135D5A for ; Tue, 6 Mar 2018 17:30:47 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 30E901435; Tue, 6 Mar 2018 17:37:01 -0800 (PST) Received: from usa.arm.com (dbox2.austin.arm.com [10.118.34.22]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E1CAA3F24A; Tue, 6 Mar 2018 17:37:00 -0800 (PST) From: Daniil Egranov To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, Daniil Egranov Date: Tue, 6 Mar 2018 19:36:33 -0600 Message-Id: <20180307013637.16462-1-daniil.egranov@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [PATCH 0/4] Virtio non-discoverable devices X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2018 01:30:47 -0000 This is an attempt to add MMIO Virtio devices into the non-discoverable device registration procedure and allow Virtio PCI drivers to recognize and program such devices correctly. The main issue is that the set of MMIO registers is different from PCI, plus the width of similar registers are not always the same. The code implements the translation of the PCI IO registers to MMIO registers. Another difference between PCI and MMIO Virtio devices found during the testing is that MMIO devices may require more registers to be programmed compared to PCI. The VirtioPciDeviceDxe was patched to detect non-discoverable MMIO devices and allow calling a PCI MemIo protocol function. This set of patches was tested with MMIO Virtio Block and Virtio Net devices. Daniil Egranov (4): MdeModulePkg: Added new Virtio non-discoverable type and GUID NonDiscoverableDeviceRegistrationLib: Added Virtio support NonDiscoverablePciDeviceDxe: Added MMIO Virtio support VirtioPciDeviceDxe: Added non-discoverable Virtio support .../NonDiscoverablePciDeviceDxe.c | 3 +- .../NonDiscoverablePciDeviceDxe.inf | 5 +- .../NonDiscoverablePciDeviceIo.c | 240 ++++++++++++++++++++- MdeModulePkg/Include/Guid/NonDiscoverableDevice.h | 3 + .../Library/NonDiscoverableDeviceRegistrationLib.h | 1 + .../NonDiscoverableDeviceRegistrationLib.c | 3 + .../NonDiscoverableDeviceRegistrationLib.inf | 1 + MdeModulePkg/MdeModulePkg.dec | 1 + OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c | 143 +++++++++++- OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h | 21 +- OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf | 4 +- OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c | 117 +++++++++- 12 files changed, 528 insertions(+), 14 deletions(-) -- 2.11.0