1. 18 12月, 2017 1 次提交
  2. 15 10月, 2017 1 次提交
  3. 17 5月, 2017 1 次提交
    • E
      qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable · e90f2a8c
      Eduardo Habkost 提交于
      cannot_instantiate_with_device_add_yet was introduced by commit
      efec3dd6 to replace no_user. It was
      supposed to be a temporary measure.
      
      When it was introduced, we had 54
      cannot_instantiate_with_device_add_yet=true lines in the code.
      Today (3 years later) this number has not shrunk: we now have
      57 cannot_instantiate_with_device_add_yet=true lines. I think it
      is safe to say it is not a temporary measure, and we won't see
      the flag go away soon.
      
      Instead of a long field name that misleads people to believe it
      is temporary, replace it a shorter and less misleading field:
      user_creatable.
      
      Except for code comments, changes were generated using the
      following Coccinelle patch:
      
        @@
        expression DC;
        @@
        (
        -DC->cannot_instantiate_with_device_add_yet = false;
        +DC->user_creatable = true;
        |
        -DC->cannot_instantiate_with_device_add_yet = true;
        +DC->user_creatable = false;
        )
      
        @@
        typedef ObjectClass;
        expression dc;
        identifier class, data;
        @@
         static void device_class_init(ObjectClass *class, void *data)
         {
         ...
         dc->hotpluggable = true;
        +dc->user_creatable = true;
         ...
         }
      
        @@
        @@
         struct DeviceClass {
         ...
        -bool cannot_instantiate_with_device_add_yet;
        +bool user_creatable;
         ...
        }
      
        @@
        expression DC;
        @@
        (
        -!DC->cannot_instantiate_with_device_add_yet
        +DC->user_creatable
        |
        -DC->cannot_instantiate_with_device_add_yet
        +!DC->user_creatable
        )
      
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Thomas Huth <thuth@redhat.com>
      Acked-by: NAlistair Francis <alistair.francis@xilinx.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NMarcel Apfelbaum <marcel@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-2-ehabkost@redhat.com>
      [ehabkost: kept "TODO remove once we're there" comment]
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      e90f2a8c
  4. 28 10月, 2016 1 次提交
  5. 29 7月, 2016 2 次提交
  6. 04 7月, 2016 1 次提交
  7. 08 4月, 2016 1 次提交
  8. 11 3月, 2016 1 次提交
  9. 07 2月, 2016 1 次提交
  10. 29 1月, 2016 1 次提交
    • P
      pci: Clean up includes · 97d5408f
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1453832250-766-23-git-send-email-peter.maydell@linaro.org
      97d5408f
  11. 22 12月, 2015 1 次提交
  12. 24 6月, 2015 3 次提交
    • L
      hw/pci-bridge: format special OFW unit address for PXB host · 48ea3ded
      Laszlo Ersek 提交于
      We have agreed that OpenFirmware device paths in the "bootorder" fw_cfg
      file should follow the pattern
      
        /pci@i0cf8,%x/...
      
      for devices that live behind an extra root bus. The extra root bus in
      question is the %x'th among the extra root buses. (In other words, %x
      gives the position of the affected extra root bus relative to the other
      extra root buses, in bus_nr order.) %x starts at 1, and is formatted in
      hex.
      
      The portion of the unit address that comes before the comma is dynamically
      taken from the main host bridge, similarly to sysbus_get_fw_dev_path().
      
      Cc: Kevin O'Connor <kevin@koconnor.net>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      48ea3ded
    • L
      hw/pci-bridge: disable SHPC in PXB · d10dda2d
      Laszlo Ersek 提交于
      OVMF downloads the ACPI linker/loader script from QEMU when the edk2 PCI
      Bus driver globally signals the firmware that PCI enumeration and resource
      allocation have completed. At this point QEMU regenerates the ACPI payload
      in an fw_cfg read callback, and this is when the PXB's _CRS gets
      populated.
      
      Unfortunately, when this happens, the PCI_COMMAND_MEMORY bit is clear in
      the root bus's command register, *unlike* under SeaBIOS. The consequences
      unfold as follows:
      
      - When build_crs() fetches dev->io_regions[i].addr, it is all-bits-one,
        because pci_update_mappings() --> pci_bar_address() calculated it as
        PCI_BAR_UNMAPPED, due to the PCI_COMMAND_MEMORY bit being clear.
      
      - Consequently, the SHPC MMIO BAR (bar 0) of the bridge is not added to
        the _CRS, *despite* having been programmed in PCI config space.
      
      - Similarly, the SHPC MMIO BAR of the PXB is not removed from the main
        root bus's DWordMemory descriptor.
      
      - Guest OSes (Linux and Windows alike) notice the pre-programmed SHPC BAR
        within the PXB's config space, and notice that it conflicts with the
        main root bus's memory resource descriptors. Linux reports
      
        pci 0000:04:00.0: BAR 0: can't assign mem (size 0x100)
        pci 0000:04:00.0: BAR 0: trying firmware assignment [mem
                                 0x88200000-0x882000ff 64bit]
        pci 0000:04:00.0: BAR 0: [mem 0x88200000-0x882000ff 64bit] conflicts
                                 with PCI Bus 0000:00 [mem
                                 0x88200000-0xfebfffff]
      
        While Windows Server 2012 R2 reports
      
          https://technet.microsoft.com/en-us/library/cc732199%28v=ws.10%29.aspx
      
          This device cannot find enough free resources that it can use. If you
          want to use this device, you will need to disable one of the other
          devices on this system. (Code 12)
      
      This issue was apparently encountered earlier, see the "hack" in:
      
        https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg02983.html
      
      and the current hole-punching logic in build_crs() and build_ssdt() is
      probably supposed to remedy exactly that problem -- however, for OVMF they
      don't work, because at the end of the PCI enumeration and resource
      allocation, which cues the ACPI linker/loader client, the command register
      is clear.
      
      The "shpc" property of "pci-bridge", introduced in the previous patches,
      allows us to disable the standard hotplug controller cleanly, eliminating
      the SHPC bar and the conflict.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      d10dda2d
    • L
      hw/pci-bridge: add macro for "chassis_nr" property · 3cf0ecb3
      Laszlo Ersek 提交于
      This should help catch property name typos at compile time.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      3cf0ecb3
  13. 04 6月, 2015 3 次提交