1. 05 2月, 2018 1 次提交
  2. 25 1月, 2018 4 次提交
    • L
      hw/intc/arm_gic: Fix the NS view of C_BPR when C_CTRL.CBPR is 1 · 421a3c22
      Luc MICHEL 提交于
      When C_CTRL.CBPR is 1, the Non-Secure view of C_BPR is altered:
        - A Non-Secure read of C_BPR should return the BPR value plus 1,
        saturated to 7,
        - A Non-Secure write should be ignored.
      Signed-off-by: NLuc MICHEL <luc.michel@git.antfield.fr>
      Message-id: 20180119145756.7629-6-luc.michel@greensocs.com
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      [PMM: fixed comment typo]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      421a3c22
    • L
      hw/intc/arm_gic: Fix group priority computation for group 1 IRQs · fc05a6f2
      Luc MICHEL 提交于
      When determining the group priority of a group 1 IRQ, if C_CTRL.CBPR is
      0, the non-secure BPR value is used. However, this value must be
      incremented by one so that it matches the secure world number of
      implemented priority bits (NS world has one less priority bit compared
      to the Secure world).
      Signed-off-by: NLuc MICHEL <luc.michel@git.antfield.fr>
      Message-id: 20180119145756.7629-5-luc.michel@greensocs.com
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      [PMM: add assert, as the gicv3 code has]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      fc05a6f2
    • L
      hw/intc/arm_gic: Fix C_RPR value on idle priority · 71aa735b
      Luc MICHEL 提交于
      When there is no active interrupts in the GIC, a read to the C_RPR
      register should return the value of the "Idle priority", which is either
      the maximum value an IRQ priority field can be set to, or 0xff.
      
      Since the QEMU GIC model implements all the 8 priority bits, the Idle
      priority is 0xff.
      
      Internally, when there is no active interrupt, the running priority
      value is 0x100. The gic_get_running_priority function returns an uint8_t
      and thus, truncate this value to 0x00 when returning it. This is wrong since
      a value of 0x00 correspond to the maximum possible priority.
      
      This commit fixes the returned value when the internal value is 0x100.
      
      Note that it is correct for the Non-Secure view to return 0xff even
      though from the NS world point of view, only 7 priority bits are
      implemented. The specification states that the Idle priority can be 0xff
      even when not all the 8 priority bits are implemented. This has been
      verified against a real GICv2 hardware on a Xilinx ZynqMP based board.
      
      Regarding the ARM11MPCore version of the GIC, the specification is not
      clear on that point, so this commit does not alter its behavior.
      Signed-off-by: NLuc MICHEL <luc.michel@git.antfield.fr>
      Message-id: 20180119145756.7629-4-luc.michel@greensocs.com
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      71aa735b
    • L
      hw/intc/arm_gic: Prevent the GIC from signaling an IRQ when it's "active and pending" · 91f4e18d
      Luc MICHEL 提交于
      In the GIC, when an IRQ is acknowledged, its state goes from "pending"
      to:
         - "active" if the corresponding IRQ pin has been de-asserted
         - "active and pending" otherwise.
      The GICv2 manual states that when a IRQ becomes active (or active and
      pending), the GIC should either signal another (higher priority) IRQ to
      the CPU if there is one, or de-assert the CPU IRQ pin.
      
      The current implementation of the GIC in QEMU does not check if the
      IRQ is already active when looking for pending interrupts with
      sufficient priority in gic_update(). This can lead to signaling an
      interrupt that is already active.
      
      This usually happens when splitting priority drop and interrupt
      deactivation. On priority drop, the IRQ stays active until deactivation.
      If it becomes pending again, chances are that it will be incorrectly
      selected as best_irq in gic_update().
      
      This commit fixes this by checking if the IRQ is not already active when
      looking for best_irq in gic_update().
      
      Note that regarding the ARM11MPCore GIC version, the corresponding
      manual is not clear on that point, but it has has no priority
      drop/interrupt deactivation separation, so this case should not happen.
      Signed-off-by: NLuc MICHEL <luc.michel@git.antfield.fr>
      Message-id: 20180119145756.7629-3-luc.michel@greensocs.com
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      91f4e18d
  3. 11 1月, 2018 1 次提交
  4. 11 7月, 2017 1 次提交
    • A
      ARM: KVM: Enable in-kernel timers with user space gic · 5d721b78
      Alexander Graf 提交于
      When running with KVM enabled, you can choose between emulating the
      gic in kernel or user space. If the kernel supports in-kernel virtualization
      of the interrupt controller, it will default to that. If not, if will
      default to user space emulation.
      
      Unfortunately when running in user mode gic emulation, we miss out on
      interrupt events which are only available from kernel space, such as the timer.
      This patch leverages the new kernel/user space pending line synchronization for
      timer events. It does not handle PMU events yet.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Reviewed-by: NAndrew Jones <drjones@redhat.com>
      Message-id: 1498577737-130264-1-git-send-email-agraf@suse.de
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5d721b78
  5. 09 3月, 2017 1 次提交
  6. 28 2月, 2017 1 次提交
  7. 07 11月, 2016 1 次提交
  8. 06 6月, 2016 1 次提交
  9. 19 5月, 2016 1 次提交
  10. 17 5月, 2016 1 次提交
    • H
      hw/intc/arm_gic: add tracepoints · 2531088f
      Hollis Blanchard 提交于
      These are obviously critical to understanding interrupt delivery:
      gic_enable_irq
      gic_disable_irq
      gic_set_irq (inbound irq from device models)
      gic_update_set_irq (outbound irq to CPU)
      gic_acknowledge_irq
      
      The only one that I think might raise eyebrows is gic_update_bestirq, but I've
      (sadly) debugged problems that ended up being caused by unexpected priorities.
      Knowing that the GIC has an irq ready, but doesn't deliver to the CPU due to
      priority, has also proven important.
      Signed-off-by: NHollis Blanchard <hollis_blanchard@mentor.com>
      Message-id: 1461252281-22399-1-git-send-email-hollis_blanchard@mentor.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      2531088f
  11. 23 3月, 2016 1 次提交
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  12. 04 3月, 2016 1 次提交
  13. 29 1月, 2016 1 次提交
    • P
      arm: Clean up includes · 8ef94f0b
      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-13-git-send-email-peter.maydell@linaro.org
      8ef94f0b
  14. 21 1月, 2016 1 次提交
  15. 19 11月, 2015 1 次提交
  16. 10 11月, 2015 1 次提交
  17. 11 9月, 2015 1 次提交
  18. 09 9月, 2015 4 次提交
    • P
      hw/intc/arm_gic: Actually set the active bits for active interrupts · d5523a13
      Peter Maydell 提交于
      Although we were correctly handling interrupts becoming active
      and then inactive, we weren't actually exposing this to the guest
      by setting the 'active' flag for the interrupt, so reads
      of GICD_ICACTIVERn and GICD_ISACTIVERn would generally incorrectly
      return zeroes. Correct this oversight.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1438089748-5528-6-git-send-email-peter.maydell@linaro.org
      d5523a13
    • P
      hw/intc/arm_gic: Drop running_irq and last_active arrays · 72889c8a
      Peter Maydell 提交于
      The running_irq and last_active arrays represent state which
      doesn't exist in a real hardware GIC. The only thing we use
      them for is updating the running priority when an interrupt
      is completed, but in fact we can use the active-priority
      registers to do this. The running priority is always the
      priority corresponding to the lowest set bit in the active
      priority registers, because only one interrupt at any
      particular priority can be active at once.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1438089748-5528-5-git-send-email-peter.maydell@linaro.org
      72889c8a
    • P
      hw/intc/arm_gic: Fix handling of GICC_APR<n>, GICC_NSAPR<n> registers · 51fd06e0
      Peter Maydell 提交于
      A GICv2 has both GICC_APR<n> and GICC_NSAPR<n> registers, with
      the latter holding the active priority bits for Group 1 interrupts
      (usually Nonsecure interrupts), and the Nonsecure view of the
      GICC_APR<n> is the second half of the GICC_NSAPR<n> registers.
      Turn our half-hearted implementation of APR<n> into a proper
      implementation of both APR<n> and NSAPR<n>:
      
       * Add the underlying state for NSAPR<n>
       * Make sure APR<n> aren't visible for pre-GICv2
       * Implement reading of NSAPR<n>
       * Make non-secure reads of APR<n> behave correctly
       * Implement writing to APR<n> and NSAPR<n>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1438089748-5528-4-git-send-email-peter.maydell@linaro.org
      51fd06e0
    • P
      hw/intc/arm_gic: Running priority is group priority, not full priority · df92cfa6
      Peter Maydell 提交于
      Priority values for the GIC are divided into a "group priority"
      and a "subpriority" (with the division being determined by the
      binary point register). The running priority is only determined
      by the group priority of the active interrupts, not the
      subpriority. In particular, this means that there can't be more
      than one active interrupt at any particular group priority.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1438089748-5528-3-git-send-email-peter.maydell@linaro.org
      df92cfa6
  19. 13 8月, 2015 1 次提交
  20. 16 6月, 2015 1 次提交
  21. 12 5月, 2015 13 次提交
  22. 19 3月, 2015 1 次提交
    • S
      Fix remaining warnings from Sparse (void return) · e7ae771f
      Stefan Weil 提交于
      Sparse report:
      
      hw/display/vga.c:2000:5: warning: returning void-valued expression
      hw/intc/arm_gic.c:707:9: warning: returning void-valued expression
      hw/intc/etraxfs_pic.c:138:9: warning: returning void-valued expression
      hw/nvram/fw_cfg.c:475:5: warning: returning void-valued expression
      hw/timer/a9gtimer.c:124:5: warning: returning void-valued expression
      hw/tpm/tpm_tis.c:794:5: warning: returning void-valued expression
      hw/usb/hcd-musb.c:558:9: warning: returning void-valued expression
      hw/usb/hcd-musb.c:776:13: warning: returning void-valued expression
      hw/usb/hcd-musb.c:867:5: warning: returning void-valued expression
      hw/usb/hcd-musb.c:932:5: warning: returning void-valued expression
      include/qom/cpu.h:584:5: warning: returning void-valued expression
      monitor.c:4686:13: warning: returning void-valued expression
      monitor.c:4690:13: warning: returning void-valued expression
      
      Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Andreas Färber <afaerber@suse.de>
      Cc: Luiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      e7ae771f