1. 21 9月, 2019 1 次提交
    • C
      pc: Add an SMB0 ACPI device to q35 · ebe15582
      Corey Minyard 提交于
      This is so I2C devices can be found in the ACPI namespace.  Currently
      that's only IPMI, but devices can be easily added now.
      
      Adding the devices required some PCI information, and the bus itself
      to be added to the PCMachineState structure.
      
      Note that this only works on Q35, the ACPI for PIIX4 is not capable
      of handling an SMBus device.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Signed-off-by: NCorey Minyard <cminyard@mvista.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      ebe15582
  2. 16 9月, 2019 1 次提交
  3. 21 8月, 2019 1 次提交
  4. 20 8月, 2019 1 次提交
  5. 16 8月, 2019 4 次提交
    • M
      Clean up inclusion of sysemu/sysemu.h · d5938f29
      Markus Armbruster 提交于
      In my "build everything" tree, changing sysemu/sysemu.h triggers a
      recompile of some 5400 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).
      
      Almost a third of its inclusions are actually superfluous.  Delete
      them.  Downgrade two more to qapi/qapi-types-run-state.h, and move one
      from char/serial.h to char/serial.c.
      
      hw/semihosting/config.c, monitor/monitor.c, qdev-monitor.c, and
      stubs/semihost.c define variables declared in sysemu/sysemu.h without
      including it.  The compiler is cool with that, but include it anyway.
      
      This doesn't reduce actual use much, as it's still included into
      widely included headers.  The next commit will tackle that.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20190812052359.30071-27-armbru@redhat.com>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      d5938f29
    • M
      Include hw/qdev-properties.h less · a27bd6c7
      Markus Armbruster 提交于
      In my "build everything" tree, changing hw/qdev-properties.h triggers
      a recompile of some 2700 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).
      
      Many places including hw/qdev-properties.h (directly or via hw/qdev.h)
      actually need only hw/qdev-core.h.  Include hw/qdev-core.h there
      instead.
      
      hw/qdev.h is actually pointless: all it does is include hw/qdev-core.h
      and hw/qdev-properties.h, which in turn includes hw/qdev-core.h.
      Replace the remaining uses of hw/qdev.h by hw/qdev-properties.h.
      
      While there, delete a few superfluous inclusions of hw/qdev-core.h.
      
      Touching hw/qdev-properties.h now recompiles some 1200 objects.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Daniel P. Berrangé" <berrange@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20190812052359.30071-22-armbru@redhat.com>
      a27bd6c7
    • M
      Include hw/hw.h exactly where needed · 650d103d
      Markus Armbruster 提交于
      In my "build everything" tree, changing hw/hw.h triggers a recompile
      of some 2600 out of 6600 objects (not counting tests and objects that
      don't depend on qemu/osdep.h).
      
      The previous commits have left only the declaration of hw_error() in
      hw/hw.h.  This permits dropping most of its inclusions.  Touching it
      now recompiles less than 200 objects.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20190812052359.30071-19-armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      650d103d
    • M
      include: Make headers more self-contained · ec150c7e
      Markus Armbruster 提交于
      Back in 2016, we discussed[1] rules for headers, and these were
      generally liked:
      
      1. Have a carefully curated header that's included everywhere first.  We
         got that already thanks to Peter: osdep.h.
      
      2. Headers should normally include everything they need beyond osdep.h.
         If exceptions are needed for some reason, they must be documented in
         the header.  If all that's needed from a header is typedefs, put
         those into qemu/typedefs.h instead of including the header.
      
      3. Cyclic inclusion is forbidden.
      
      This patch gets include/ closer to obeying 2.
      
      It's actually extracted from my "[RFC] Baby steps towards saner
      headers" series[2], which demonstrates a possible path towards
      checking 2 automatically.  It passes the RFC test there.
      
      [1] Message-ID: <87h9g8j57d.fsf@blackfin.pond.sub.org>
          https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
      [2] Message-Id: <20190711122827.18970-1-armbru@redhat.com>
          https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.htmlSigned-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20190812052359.30071-2-armbru@redhat.com>
      Tested-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      ec150c7e
  6. 06 7月, 2019 6 次提交
  7. 05 7月, 2019 1 次提交
  8. 21 6月, 2019 1 次提交
    • G
      hw: Nuke hw_compat_4_0_1 and pc_compat_4_0_1 · 8e8cbed0
      Greg Kurz 提交于
      Commit c87759ce fixed a regression affecting pc-q35 machines by
      introducing a new pc-q35-4.0.1 machine version to be used instead
      of pc-q35-4.0. The only purpose was to revert the default behaviour
      of not using split irqchip, but the change also introduced the usual
      hw_compat and pc_compat bits, and wired them for pc-q35 only.
      
      This raises questions when it comes to add new compat properties for
      4.0* machine versions of any architecture. Where to add them ? In
      4.0, 4.0.1 or both ? Error prone. Another possibility would be to teach
      all other architectures about 4.0.1. This solution isn't satisfying,
      especially since this is a pc-q35 specific issue.
      
      It turns out that the split irqchip default is handled in the machine
      option function and doesn't involve compat lists at all.
      
      Drop all the 4.0.1 compat lists and use the 4.0 ones instead in the 4.0.1
      machine option function.
      
      Move the compat props that were added to the 4.0.1 since c87759ce to
      4.0.
      
      Even if only hw_compat_4_0_1 had an impact on other architectures,
      drop pc_compat_4_0_1 as well for consistency.
      
      Fixes: c87759ce "q35: Revert to kernel irqchip"
      Suggested-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Message-Id: <156051774276.244890.8660277280145466396.stgit@bahia.lan>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8e8cbed0
  9. 12 6月, 2019 2 次提交
    • M
      Include qemu-common.h exactly where needed · a8d25326
      Markus Armbruster 提交于
      No header includes qemu-common.h after this commit, as prescribed by
      qemu-common.h's file comment.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190523143508.25387-5-armbru@redhat.com>
      [Rebased with conflicts resolved automatically, except for
      include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c
      block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c
      target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h
      target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h
      target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h
      target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and
      net/tap-bsd.c fixed up]
      a8d25326
    • M
      Include qemu/module.h where needed, drop it from qemu-common.h · 0b8fa32f
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190523143508.25387-4-armbru@redhat.com>
      [Rebased with conflicts resolved automatically, except for
      hw/usb/dev-hub.c hw/misc/exynos4210_rng.c hw/misc/bcm2835_rng.c
      hw/misc/aspeed_scu.c hw/display/virtio-vga.c hw/arm/stm32f205_soc.c;
      ui/cocoa.m fixed up]
      0b8fa32f
  10. 03 6月, 2019 1 次提交
    • A
      q35: Revert to kernel irqchip · c87759ce
      Alex Williamson 提交于
      Commit b2fc91db ("q35: set split kernel irqchip as default") changed
      the default for the pc-q35-4.0 machine type to use split irqchip, which
      turned out to have disasterous effects on vfio-pci INTx support.  KVM
      resampling irqfds are registered for handling these interrupts, but
      these are non-functional in split irqchip mode.  We can't simply test
      for split irqchip in QEMU as userspace handling of this interrupt is a
      significant performance regression versus KVM handling (GeForce GPUs
      assigned to Windows VMs are non-functional without forcing MSI mode or
      re-enabling kernel irqchip).
      
      The resolution is to revert the change in default irqchip mode in the
      pc-q35-4.1 machine and create a pc-q35-4.0.1 machine for the 4.0-stable
      branch.  The qemu-q35-4.0 machine type should not be used in vfio-pci
      configurations for devices requiring legacy INTx support without
      explicitly modifying the VM configuration to use kernel irqchip.
      
      Link: https://bugs.launchpad.net/qemu/+bug/1826422
      Fixes: b2fc91db ("q35: set split kernel irqchip as default")
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <155786484688.13873.6037015630912983760.stgit@gimli.home>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c87759ce
  11. 17 5月, 2019 2 次提交
    • V
      ioapic: allow buggy guests mishandling level-triggered interrupts to make progress · 958a01da
      Vitaly Kuznetsov 提交于
      It was found that Hyper-V 2016 on KVM in some configurations (q35 machine +
      piix4-usb-uhci) hangs on boot. Root-cause was that one of Hyper-V
      level-triggered interrupt handler performs EOI before fixing the cause of
      the interrupt. This results in IOAPIC keep re-raising the level-triggered
      interrupt after EOI because irq-line remains asserted.
      
      Gory details: https://www.spinics.net/lists/kvm/msg184484.html
      (the whole thread).
      
      Turns out we were dealing with similar issues before; in-kernel IOAPIC
      implementation has commit 184564efae4d ("kvm: ioapic: conditionally delay
      irq delivery duringeoi broadcast") which describes a very similar issue.
      
      Steal the idea from the above mentioned commit for IOAPIC implementation in
      QEMU. SUCCESSIVE_IRQ_MAX_COUNT, delay and the comment are borrowed as well.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20190402080215.10747-1-vkuznets@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      958a01da
    • P
      hw/i386/acpi: Add object_resolve_type_unambiguous to improve modularity · 81c48dd7
      Philippe Mathieu-Daudé 提交于
      When building with CONFIG_Q35=n, we get:
      
          LINK    x86_64-softmmu/qemu-system-x86_64
        /usr/bin/ld: hw/i386/acpi-build.o: in function `acpi_get_misc_info':
        /source/qemu/hw/i386/acpi-build.c:243: undefined reference to `ich9_lpc_find'
        collect2: error: ld returned 1 exit status
        make[1]: *** [Makefile:204: qemu-system-x86_64] Error 1
      
      This is due to a dependency in acpi-build.c on the ICH9_LPC
      (via ich9_lpc_find) and PIIX4_PM (via piix4_pm_find) devices.
      
      To allow better modularity (compile acpi-build.c with only
      Q35/ICH9 or ISAPC/PIIX4), refactor the similar helper as
      object_resolve_type_unambiguous(). This way we relax the
      linker dependencies and can build the x86 targets with a
      selection of machines (instead of all of them).
      Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190427144025.22880-3-philmd@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      81c48dd7
  12. 13 5月, 2019 1 次提交
  13. 26 4月, 2019 1 次提交
  14. 02 4月, 2019 1 次提交
  15. 20 3月, 2019 1 次提交
    • P
      intel-iommu: optimize nodmar memory regions · 4b519ef1
      Peter Xu 提交于
      Previously we have per-device system memory aliases when DMAR is
      disabled by the system.  It will slow the system down if there are
      lots of devices especially when DMAR is disabled, because each of the
      aliased system address space will contain O(N) slots, and rendering
      such N address spaces will be O(N^2) complexity.
      
      This patch introduces a shared nodmar memory region and for each
      device we only create an alias to the shared memory region.  With the
      aliasing, QEMU memory core API will be able to detect when devices are
      sharing the same address space (which is the nodmar address space)
      when rendering the FlatViews and the total number of FlatViews can be
      dramatically reduced when there are a lot of devices.
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20190313094323.18263-1-peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4b519ef1
  16. 13 3月, 2019 3 次提交
  17. 12 3月, 2019 2 次提交
    • M
      pc: Support firmware configuration with -blockdev · ebc29e1b
      Markus Armbruster 提交于
      The PC machines put firmware in ROM by default.  To get it put into
      flash memory (required by OVMF), you have to use -drive
      if=pflash,unit=0,... and optionally -drive if=pflash,unit=1,...
      
      Why two -drive?  This permits setting up one part of the flash memory
      read-only, and the other part read/write.  It also makes upgrading
      firmware on the host easier.  Below the hood, it creates two separate
      flash devices, because we were too lazy to improve our flash device
      models to support sector protection.
      
      The problem at hand is to do the same with -blockdev somehow, as one
      more step towards deprecating -drive.
      
      Mapping -drive if=none,... to -blockdev is a solved problem.  With
      if=T other than if=none, -drive additionally configures a block device
      frontend.  For non-onboard devices, that part maps to -device.  Also a
      solved problem.  For onboard devices such as PC flash memory, we have
      an unsolved problem.
      
      This is actually an instance of a wider problem: our general device
      configuration interface doesn't cover onboard devices.  Instead, we have
      a zoo of ad hoc interfaces that are much more limited.  One of them is
      -drive, which we'd rather deprecate, but can't until we have suitable
      replacements for all its uses.
      
      Sadly, I can't attack the wider problem today.  So back to the narrow
      problem.
      
      My first idea was to reduce it to its solved buddy by using pluggable
      instead of onboard devices for the flash memory.  Workable, but it
      requires some extra smarts in firmware descriptors and libvirt.  Paolo
      had an idea that is simpler for libvirt: keep the devices onboard, and
      add machine properties for their block backends.
      
      The implementation is less than straightforward, I'm afraid.
      
      First, block backend properties are *qdev* properties.  Machines can't
      have those, as they're not devices.  I could duplicate these qdev
      properties as QOM properties, but I hate that.
      
      More seriously, the properties do not belong to the machine, they
      belong to the onboard flash devices.  Adding them to the machine would
      then require bad magic to somehow transfer them to the flash devices.
      Fortunately, QOM provides the means to handle exactly this case: add
      alias properties to the machine that forward to the onboard devices'
      properties.
      
      Properties need to be created in .instance_init() methods.  For PC
      machines, that's pc_machine_initfn().  To make alias properties work,
      we need to create the onboard flash devices there, too.  Requires
      several bug fixes, in the previous commits.  We also have to realize
      the devices.  More on that below.
      
      If the user sets pflash0, firmware resides in flash memory.
      pc_system_firmware_init() maps and realizes the flash devices.
      
      Else, firmware resides in ROM.  The onboard flash devices aren't used
      then.  pc_system_firmware_init() destroys them unrealized, along with
      the alias properties.
      
      The existing code to pick up drives defined with -drive if=pflash is
      replaced by code to desugar into the machine properties.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Message-Id: <87ftrtux81.fsf@dusky.pond.sub.org>
      ebc29e1b
    • P
      pc_sysfw: Pass PCMachineState to pc_system_firmware_init() · 5e640a9e
      Philippe Mathieu-Daudé 提交于
      pc_system_firmware_init() parameter @isapc_ram_fw is PCMachineState
      member pci_enabled negated.  The next commit will need more of
      PCMachineState.  To prepare for that, pass a PCMachineState *, and
      drop the now redundant parameter @isapc_ram_fw.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Message-Id: <20190308131445.17502-11-armbru@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      5e640a9e
  18. 11 3月, 2019 2 次提交
  19. 06 3月, 2019 1 次提交
  20. 05 2月, 2019 1 次提交
  21. 22 1月, 2019 1 次提交
  22. 10 1月, 2019 1 次提交
  23. 09 1月, 2019 1 次提交
  24. 07 1月, 2019 3 次提交