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 (foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 085B622283519 for ; Sun, 11 Mar 2018 23:13:26 -0700 (PDT) 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 BECB41596; Sun, 11 Mar 2018 23:19:46 -0700 (PDT) Received: from [10.118.34.22] (dbox2.austin.arm.com [10.118.34.22]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8268A3F25C; Sun, 11 Mar 2018 23:19:46 -0700 (PDT) To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , Laszlo Ersek , Leif Lindholm References: <20180307013637.16462-1-daniil.egranov@arm.com> From: Daniil Egranov Message-ID: Date: Mon, 12 Mar 2018 01:19:45 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: 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: Mon, 12 Mar 2018 06:13:27 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Hello Ard, On 03/08/2018 02:29 AM, Ard Biesheuvel wrote: > Hello Daniil, > > Could you please use a text based email client? Gmail does not > consider the indentation as threading, so the context below is > unintelligible > I forced Thunderbird to plain text. I assumed it should follow a previous email composition style. At least i did not have problem with it so far. I hope it's formated correctly now. > On 8 March 2018 at 08:21, Daniil Egranov wrote: >> Hello Ard, >> >> Thanks for reply. Please see my comments below. >> >> On 03/07/2018 02:03 AM, Ard Biesheuvel wrote: >> >> (+ 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. >> >> >> I am looking for a proper way to handle multiple MMIO Virtio devices on a >> single platform. As both PCI and MMIO types of Virtio device programmed in >> about the same way, non-discoverable devices approach was looking valid. >> >> I understand you point. Correct me if I am wrong but all non-discoverable >> devices are MMIO devices so if there is PCI version of the device exists, >> PCI wrapper can be used. The Virtio PCI class devices are using >> VirtioPciDeviceDxe driver. Is this driver not fitting to the category of PCI >> class drivers? >> > > That is not the point. The Intel guys have decided that the AHCI, XHCI > and other drivers (whose specs do no mandate PCI) are implemented as > PCI drivers only, which means that they are essentially combining two > layers of the driver stack (the PCI part and the _HCI part) > > Splitting all of those drivers into PCI drivers that produce _HCI > protocols and _HCI drivers that produce the USB host, SATA host, etc > protocols is not going to be accepted by upstream EDK2, so instead, we > decided to turn the PCI 'emulation' that was duplicated across many > platforms into a proper abstraction. > > In the virtio case, we don't have that problem. We have MMIO and PCI > support using drivers that use the proper abstractions, and so > presenting MMIO devices as PCI devices is really a step backwards. > I see, thanks for details. > What are you trying to achieve that the current code won't let you? > I have a situation when a platform has multiple Virtio MMIO devices. The initial way to handle them was installing a device path protocol and calling VirtioMmioDeviceLib for each device as part of the platform DXE driver. The non-discoverable way was hiding all these operations and was looking like more clean approach. In case of multiple Virtio MMIO devices, what will be a proper way to handle them? Thanks, Daniil