1. 16 3月, 2015 1 次提交
    • M
      s390x: Replace unchecked qdev_init() by qdev_init_nofail() · ae4a2bd7
      Markus Armbruster 提交于
      s390_flic_init() is a helper to create and realize either
      "s390-flic-kvm" or "s390-flic-qemu".  When qdev_init() fails, it
      complains to stderr and succeeds.
      
      Except it can't actually fail, because the "s390-flic-qemu" is a dummy
      without a realize method, and "s390-flic-kvm"'s realize can't fail,
      even when the kernel device is really unavailable.  Odd.
      
      Replace qdev_init() by qdev_init_nofail() to make "can't fail" locally
      obvious, and get rid of the unreachable error reporting.
      
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Alexander Graf <agraf@suse.de>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Acked-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Message-Id: <1423128889-18260-4-git-send-email-armbru@redhat.com>
      Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      ae4a2bd7
  2. 09 3月, 2015 5 次提交
  3. 18 2月, 2015 1 次提交
    • M
      hmp: Name HMP info handler functions hmp_info_SUBCOMMAND() · 1ce6be24
      Markus Armbruster 提交于
      Some are called do_info_SUBCOMMAND() (old ones, usually), some
      hmp_info_SUBCOMMAND(), some SUBCOMMAND_info(), sometimes SUBCOMMAND
      pointlessly differs in spelling.
      
      Normalize to hmp_info_SUBCOMMAND(), where SUBCOMMAND is exactly the
      subcommand name with '-' replaced by '_'.
      
      Exceptions:
      
      * sun4m_irq_info(), sun4m_pic_info() renamed to sun4m_hmp_info_irq(),
        sun4m_hmp_info_pic().
      
      * lm32_irq_info(), lm32_pic_info() renamed to lm32_hmp_info_irq(),
        lm32_hmp_info_pic().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      1ce6be24
  4. 26 1月, 2015 2 次提交
  5. 15 12月, 2014 2 次提交
    • P
      kvm/apic: fix 2.2->2.1 migration · 575a6f40
      Paolo Bonzini 提交于
      The wait_for_sipi field is set back to 1 after an INIT, so it was not
      effective to reset it in kvm_apic_realize.  Introduce a reset callback
      and reset wait_for_sipi there.
      Reported-by: NIgor Mammedov <imammedo@redhat.com>
      Cc: qemu-stable@nongnu.org
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      575a6f40
    • E
      KVM_CAP_IRQFD and KVM_CAP_IRQFD_RESAMPLE checks · f41389ae
      Eric Auger 提交于
      Compute kvm_irqfds_allowed by checking the KVM_CAP_IRQFD extension.
      Remove direct settings in architecture specific files.
      
      Add a new kvm_resamplefds_allowed variable, initialized by
      checking the KVM_CAP_IRQFD_RESAMPLE extension. Add a corresponding
      kvm_resamplefds_enabled() function.
      
      A special notice for s390 where KVM_CAP_IRQFD was not immediatly
      advirtised when irqfd capability was introduced in the kernel.
      KVM_CAP_IRQ_ROUTING was advertised instead.
      
      This was fixed in "KVM: s390: announce irqfd capability",
      ebc3226202d5956a5963185222982d435378b899 whereas irqfd support
      was brought in 84223598778ba08041f4297fda485df83414d57e,
      "KVM: s390: irq routing for adapter interrupts".  Both commits
      first appear in 3.15 so there should not be any kernel
      version impacted by this QEMU modification.
      Signed-off-by: NEric Auger <eric.auger@linaro.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f41389ae
  6. 11 12月, 2014 1 次提交
  7. 24 11月, 2014 3 次提交
    • P
      apic: fix incorrect handling of ExtINT interrupts wrt processor priority · 5224c88d
      Paolo Bonzini 提交于
      This fixes another failure with ExtINT, demonstrated by QNX.  The failure
      mode is as follows:
      - IPI sent to cpu 0 (bit set in APIC irr)
      - IPI accepted by cpu 0 (bit cleared in irr, set in isr)
      - IPI sent to cpu 0 (bit set in both irr and isr)
      - PIC interrupt sent to cpu 0
      
      The PIC interrupt causes CPU_INTERRUPT_HARD to be set, but
      apic_irq_pending observes that the highest pending APIC interrupt priority
      (the IPI) is the same as the processor priority (since the IPI is still
      being handled), so apic_get_interrupt returns a spurious interrupt rather
      than the pending PIC interrupt. The result is an endless sequence of
      spurious interrupts, since nothing will clear CPU_INTERRUPT_HARD.
      
      Instead, ExtINT interrupts should have ignored the processor priority.
      Calling apic_check_pic early in apic_get_interrupt ensures that
      apic_deliver_pic_intr is called instead of delivering the spurious
      interrupt.  apic_deliver_pic_intr then clears CPU_INTERRUPT_HARD if needed.
      Reported-by: NRichard Bilson <rbilson@qnx.com>
      Tested-by: NRichard Bilson <rbilson@qnx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5224c88d
    • P
      apic: fix loss of IPI due to masked ExtINT · 8092cb71
      Paolo Bonzini 提交于
      This patch fixes an obscure failure of the QNX kernel on QEMU x86 SMP.
      In QNX, all hardware interrupts come via the PIC, and are delivered by
      the cpu 0 LAPIC in ExtINT mode, while IPIs are delivered by the LAPIC
      in fixed mode.
      
      This bug happens as follows:
      - cpu 0 masks a particular PIC interrupt
      - IPI sent to cpu 0 (CPU_INTERRUPT_HARD is set)
      - before the IPI is accepted, the masked interrupt line is asserted by the
      device
      
      Since the interrupt is masked, apic_deliver_pic_intr will clear
      CPU_INTERRUPT_HARD. The IPI will still be set in the APIC irr, but since
      CPU_INTERRUPT_HARD is not set the cpu will not notice. Depending on the
      scenario this can cause a system hang, i.e. if cpu 0 is expected to unmask
      the interrupt.
      
      In order to fix this, do a full check of the APIC before an EXTINT
      is acknowledged.  This can result in clearing CPU_INTERRUPT_HARD, but
      can also result in delivering the lost IPI.
      Reported-by: NRichard Bilson <rbilson@qnx.com>
      Tested-by: NRichard Bilson <rbilson@qnx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8092cb71
    • P
      apic: avoid getting out of halted state on masked PIC interrupts · 60e68042
      Paolo Bonzini 提交于
      After the next patch, if a masked PIC interrupts causes CPU_INTERRUPT_POLL
      to be set, the CPU will spuriously get out of halted state.  While this
      is technically valid, we should avoid that.
      
      Make CPU_INTERRUPT_POLL run apic_update_irq in the right thread and then
      look at CPU_INTERRUPT_HARD.  If CPU_INTERRUPT_HARD does not get set,
      do not report the CPU as having work.
      
      Also move the handling of software-disabled APIC from apic_update_irq
      to apic_irq_pending, and always trigger CPU_INTERRUPT_POLL.  This will
      be important once we will add a case that resets CPU_INTERRUPT_HARD
      from apic_update_irq.  We want to run it even if we go through
      CPU_INTERRUPT_POLL, and even if the local APIC is software disabled.
      Reported-by: NRichard Bilson <rbilson@qnx.com>
      Tested-by: NRichard Bilson <rbilson@qnx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      60e68042
  8. 13 11月, 2014 1 次提交
  9. 05 11月, 2014 1 次提交
  10. 24 10月, 2014 1 次提交
  11. 30 9月, 2014 1 次提交
  12. 03 9月, 2014 1 次提交
    • G
      Fix debug print warning · c5539cb4
      Gonglei 提交于
      Steps:
      
      1.enable qemu debug print, using simply scprit as below:
       grep "//#define DEBUG" * -rl | xargs sed -i "s/\/\/#define DEBUG/#define DEBUG/g"
      2. make -j
      3. get some warning:
      hw/i2c/pm_smbus.c: In function 'smb_ioport_writeb':
      hw/i2c/pm_smbus.c:142: warning: format '%04x' expects type 'unsigned int', but argument 2 has type 'hwaddr'
      hw/i2c/pm_smbus.c:142: warning: format '%02x' expects type 'unsigned int', but argument 3 has type 'uint64_t'
      hw/i2c/pm_smbus.c: In function 'smb_ioport_readb':
      hw/i2c/pm_smbus.c:209: warning: format '%04x' expects type 'unsigned int', but argument 2 has type 'hwaddr'
      hw/intc/i8259.c: In function 'pic_ioport_read':
      hw/intc/i8259.c:373: warning: format '%02x' expects type 'unsigned int', but argument 2 has type 'hwaddr'
      hw/input/pckbd.c: In function 'kbd_write_command':
      hw/input/pckbd.c:232: warning: format '%02x' expects type 'unsigned int', but argument 2 has type 'uint64_t'
      hw/input/pckbd.c: In function 'kbd_write_data':
      hw/input/pckbd.c:333: warning: format '%02x' expects type 'unsigned int', but argument 2 has type 'uint64_t'
      hw/isa/apm.c: In function 'apm_ioport_writeb':
      hw/isa/apm.c:44: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'hwaddr'
      hw/isa/apm.c:44: warning: format '%02x' expects type 'unsigned int', but argument 3 has type 'uint64_t'
      hw/isa/apm.c: In function 'apm_ioport_readb':
      hw/isa/apm.c:67: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'hwaddr'
      hw/timer/mc146818rtc.c: In function 'cmos_ioport_write':
      hw/timer/mc146818rtc.c:394: warning: format '%02x' expects type 'unsigned int', but argument 3 has type 'uint64_t'
      hw/i386/pc.c: In function 'port92_write':
      hw/i386/pc.c:479: warning: format '%02x' expects type 'unsigned int', but argument 2 has type 'uint64_t'
      
      Fix them.
      
      Cc: qemu-trivial@nongnu.org
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      c5539cb4
  13. 29 8月, 2014 5 次提交
  14. 15 8月, 2014 3 次提交
  15. 27 6月, 2014 6 次提交
    • A
      xics: Implement xics_ics_free() · 51bba713
      Alexey Kardashevskiy 提交于
      This implements interrupt release function so IRQs can be returned back
      to the pool for reuse in cases such as PCI hot plug.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      51bba713
    • A
      spapr: Move interrupt allocator to xics · bee763db
      Alexey Kardashevskiy 提交于
      The current allocator returns IRQ numbers from a pool and does not
      support IRQs reuse in any form as it did not keep track of what it
      previously returned, it only keeps the last returned IRQ. Some use
      cases such as PCI hot(un)plug may require IRQ release and reallocation.
      
      This moves an allocator from SPAPR to XICS.
      
      This switches IRQ users to use new API.
      
      This uses LSI/MSI flags to know if interrupt is allocated.
      
      The interrupt release function will be posted as a separate patch.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      bee763db
    • A
      xics: Disable flags reset on xics reset · a7e519a8
      Alexey Kardashevskiy 提交于
      Since islsi[] array has been merged into the ICSState struct,
      we must not reset flags as they tell if the interrupt is in use.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a7e519a8
    • A
      xics: Add xics_find_source() · 641c3493
      Alexey Kardashevskiy 提交于
      PAPR allows having multiple interrupt sources such as PHB.
      
      This adds a source lookup function and makes use of it.
      
      Since at the moment QEMU only supports a single source,
      no change in behaviour is expected.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      641c3493
    • A
      xics: Add flags for interrupts · 4af88944
      Alexey Kardashevskiy 提交于
      The existing interrupt allocation scheme in SPAPR assumes that
      interrupts are allocated at the start time, continously and the config
      will not change. However, there are cases when this is not going to work
      such as:
      
      1. migration - we will have to have an ability to choose interrupt
      numbers for devices in the command line and this will create gaps in
      interrupt space.
      
      2. PCI hotplug - interrupts from unplugged device need to be returned
      back to interrupt pool, otherwise we will quickly run out of interrupts.
      
      This replaces a separate lslsi[] array with a byte in the ICSIRQState
      struct and defines "LSI" and "MSI" flags. Neither of these flags set
      signals that the descriptor is not allocated and not in use.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      4af88944
    • A
      spapr: Fix RTAS token numbers · 3a3b8502
      Alexey Kardashevskiy 提交于
      At the moment spapr_rtas_register() allocates a new token number for every
      new RTAS callback so numbers are not fixed and depend on the number of
      supported RTAS handlers and the exact order of spapr_rtas_register() calls.
      These tokens are copied into the device tree and remain the same during
      the guest lifetime.
      
      When we start another guest to receive a migration, it calls
      spapr_rtas_register() as well. If the number of RTAS handlers or their
      order is different in QEMU on source and destination sides, the "/rtas"
      node in the device tree will differ. Since migration overwrites the device
      tree (as it overwrites the entire RAM), the actual RTAS config on
      the destination side gets broken.
      
      This defines global contant values for every RTAS token which QEMU
      is using today.
      
      This changes spapr_rtas_register() to accept a token number instead of
      allocating one. This changes all users of spapr_rtas_register().
      
      This changes XICS-KVM not to cache tokens registered with KVM as they
      constant now.
      
      This makes TOKEN_BASE global as RTAS_XXX use TOKEN_BASE as
      a base. TOKEN_MAX is moved and renamed too and its value is changed
      to the last token + 1. Boundary checks for token values are adjusted.
      
      This reserves token numbers for "os-term" handlers and PCI hotplug
      which we are working on.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3a3b8502
  16. 20 6月, 2014 1 次提交
  17. 16 6月, 2014 5 次提交