From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::244; helo=mail-io0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B20CE2228350C for ; Tue, 6 Mar 2018 23:57:11 -0800 (PST) Received: by mail-io0-x244.google.com with SMTP id g21so2047222ioj.5 for ; Wed, 07 Mar 2018 00:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=468Bg+NdAD+FQXAbtfzj/GwyYJlexSoIN1OdfcSwyDw=; b=U/yg7Y7ikSuQxKtOM1Ta7HS9P6F2ws9pNGZjAFwAwOBNoHgfMfM3Ex/vuqEWND+ELT mbUm3Fnh850mNY5Grxazt78ITD3QAAPMyafBHWznkgZphLGjrWeUFwAGKKj00FVacqBg 5rIELCR0iKgTgW2/LJgj0iNMjsQR9vWhgEEjo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=468Bg+NdAD+FQXAbtfzj/GwyYJlexSoIN1OdfcSwyDw=; b=iPoT75xSBOn6lhIZugwRvcLCFvUrVjZeMkZVdafOTRccWIjOXMTVN4RI8buyel2rsG 7PSJFvf4uUPq8aA3oImyWoTN+H8fGGwDqu30KCTGwCvqC53tHXCtVfLf7Udx9y4Y8p9V 8RU6Naje27Rn7RRcMkBwtotJiXanyppgbFzCL4eTyANKxr+6o0Z8rYZ9rlLC0TPOX62q u/U4FWFzd6zAM/uh0YMtvZIR28yzt/IJOoFfCmEtM+N+dkutIsv+/nOT8FrtAgUMiQes 4lbq7cEot6a2/59EcmRNIJUpVc0w9SdiaVKD0diOcqOVOUv9S5gDE983hRnzma6vLWOA d2sg== X-Gm-Message-State: AElRT7Hml4wdzj7G4rtIyiyjv6/equEX+yQs+z73e0nfb3lDQv/Cd7Ek 2+hXGHTZT7PBlUbqGabX8qNTmq39M977M3doHfd3Yg== X-Google-Smtp-Source: AG47ELut4WU3kiPrLXAf4/tF8ikzWq9VyGi/VNDORETN+MNc7m8rrArzD28+kewAYCtROQM4gM3kqrVrJF+EG4FTCmk= X-Received: by 10.107.151.74 with SMTP id z71mr23568791iod.277.1520409805269; Wed, 07 Mar 2018 00:03:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.138.209 with HTTP; Wed, 7 Mar 2018 00:03:24 -0800 (PST) In-Reply-To: <20180307013637.16462-1-daniil.egranov@arm.com> References: <20180307013637.16462-1-daniil.egranov@arm.com> From: Ard Biesheuvel Date: Wed, 7 Mar 2018 08:03:24 +0000 Message-ID: To: Daniil Egranov , Laszlo Ersek Cc: "edk2-devel@lists.01.org" , Leif Lindholm Subject: Re: [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 07:57:12 -0000 Content-Type: text/plain; charset="UTF-8" (+ Laszlo) Hello Daniil, On 7 March 2018 at 01:36, Daniil Egranov wrote: > 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. Why? The purpose of the non-discoverable device layer is to make non-PCI controllers that can be driven by PCI class drivers appear as PCI devices. We have started using the base non-discoverable device protocol for other devices as well, but the PCI wrapper is really only intended for PCI class drivers. For VirtIO MMIO, we already have a driver model driver, and given that you need to patch up differences between MMIO and PCI based virtio in your code, I am reluctant to incorporate modifications in to the PCI driver to support MMIO devices. Is this related to virtio 1.0 support? Also, could you please ensure next time that you cc all the relevant people? (Please check the Maintainers file) > 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 >