<div><br><div class="gmail_quote"><div dir="auto">пт, 18 авг. 2017 г. в 2:33, Aleksandr Bezzubikov <<a href="mailto:zuban32s@gmail.com">zuban32s@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Now PCI bridges get a bus range number on a system init,<br>
basing on currently plugged devices. That's why when one wants to hotplug another bridge,<br>
it needs his child bus, which the parent is unable to provide (speaking about virtual device).<br>
The suggested workaround is to have vendor-specific capability in Red Hat PCI bridges<br>
that contains number of additional bus to reserve (as well as IO/MEM/PREF space limit hints)<br>
on BIOS PCI init.<br>
So this capability is intended only for pure QEMU->SeaBIOS usage.<br>
<br>
Considering all aforesaid, this series is directly connected with<br>
QEMU series "Generic PCIE-PCI Bridge".<br>
<br>
Although the new PCI capability is supposed to contain various limits along with<br>
bus number to reserve, now only its full layout is proposed. And<br>
only bus_reserve field is used in QEMU and BIOS. Limits usage<br>
is still a subject for implementation as now<br>
the main goal of this series to provide necessary support from the<br>
firmware side to PCIE-PCI bridge hotplug.<br>
<br>
Changes v6->v7:<br>
0. Resend - fix a bug with incorrect subordinate bus default value.<br>
1. Do not use alignment in case of IO reservation cap usage.<br>
2. Log additional buses reservation events.<br>
<br>
Changes v5->v6:<br>
1. Remove unnecessary indents and line breaks (addresses Marcel's comments)<br>
2. Count IO/MEM/PREF region size as a maximum of necessary size and one provide in<br>
        RESOURCE_RESERVE capability (addresses Marcel's comment).<br>
3. Make the cap debug message more detailed (addresses Marcel's comment).<br>
4. Change pref_32 and pref_64 cap fields comment.<br>
<br>
Changes v4->v5:<br>
1. Rename capability-related #defines<br>
2. Move capability IO/MEM/PREF fields values usage to the regions creation stage (addresses Marcel's comment)<br>
3. The capability layout change: separate pref_mem into pref_mem_32 and pref_mem_64 fields (QEMU side has the same changes) (addresses Laszlo's comment)<br>
4. Extract the capability lookup and check to the separate function (addresses Marcel's comment)<br>
        - despite of Marcel's comment do not extract field check for -1 since it increases code length<br>
          and doesn't look nice because of different field types<br>
5. Fix the capability's comment (addresses Marcel's comment)<br>
6. Fix the 3rd patch message<br>
<br>
Changes v3->v4:<br>
1. Use all QEMU PCI capability fields - addresses Michael's comment<br>
2. Changes of the capability layout (QEMU side has the same changes):<br>
        - change reservation fields types: bus_res - uint32_t, others - uint64_t<br>
        - interpret -1 value as 'ignore'<br>
<br>
Changes v2->v3:<br>
1. Merge commit 2 (Red Hat vendor ID) into commit 4 - addresses Marcel's comment,<br>
        and add Generic PCIE Root Port device ID - addresses Michael's comment.<br>
2. Changes of the capability layout  (QEMU side has the same changes):<br>
        - add 'type' field to distinguish multiple<br>
                RedHat-specific capabilities - addresses Michael's comment<br>
        - do not mimiс PCI Config space register layout, but use mutually exclusive differently<br>
                sized fields for IO and prefetchable memory limits - addresses Laszlo's comment<br>
        - use defines instead of structure and offsetof - addresses Michael's comment<br>
3. Interpret 'bus_reserve' field as a minimum necessary<br>
         range to reserve - addresses Gerd's comment<br>
4. pci_find_capability moved to pci.c - addresses Kevin's comment<br>
5. Move capability layout header to src/fw/dev-pci.h - addresses Kevin's comment<br>
6. Add the capability documentation - addresses Michael's comment<br>
7. Add capability length and bus_reserve field sanity checks - addresses Michael's comment<br>
<br>
Changes v1->v2:<br>
1. New #define for Red Hat vendor added (addresses Konrad's comment).<br>
2. Refactored pci_find_capability function (addresses Marcel's comment).<br>
3. Capability reworked:<br>
        - data type added;<br>
        - reserve space in a structure for IO, memory and<br>
          prefetchable memory limits.<br>
<br>
<br>
Aleksandr Bezzubikov (3):<br>
  pci: refactor pci_find_capapibilty to get bdf as the first argument<br>
    instead of the whole pci_device<br>
  pci: add QEMU-specific PCI capability structure<br>
  pci: enable RedHat PCI bridges to reserve additional resources on PCI<br>
    init<br>
<br>
 src/fw/dev-pci.h    |  53 ++++++++++++++++++++++++++<br>
 src/fw/pciinit.c    | 108 +++++++++++++++++++++++++++++++++++++++++++++++++---<br>
 src/hw/pci.c        |  25 ++++++++++++<br>
 src/hw/pci.h        |   1 +<br>
 src/hw/pci_ids.h    |   3 ++<br>
 src/hw/pcidevice.c  |  24 ------------<br>
 src/hw/pcidevice.h  |   1 -<br>
 src/hw/virtio-pci.c |   6 +--<br>
 8 files changed, 188 insertions(+), 33 deletions(-)<br>
 create mode 100644 src/fw/dev-pci.h<br>
<br>
--<br>
2.7.4<br>
</blockquote><div dir="auto"><br></div><div dir="auto">And what about this series? The matching QEMU series has been applied, that's why there should be no problems with picking this series up for SeaBIOS</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
</blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature">Aleksandr Bezzubikov</div>