Skip to content

Commits

Permalink
mwait2
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Commits on Aug 15, 2018

  1. acpi: add support for CST update notification

    Reuse cpu hotplug inotification interface to notify guest about CST change.
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Igor Mammedov committed Aug 15, 2018
    Copy the full SHA
    824ff1a View commit details
    Browse the repository at this point in the history
  2. pc: acpi: add _CST support

    Reuse CPU hotplug IO registers for passing a CST entry
    containing package for shalowest C1 using mwait and
    read it out in guest with new CCST AML method.
    
    The CState support is optional and could be turned on
    with '-global PIIX4_PM.cstate-count=X' CLI option.
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    ---
    V2:
      - support for multiple CStates (Michael)
    
    for demo purposes it's wired only to piix4
    TODO: q35 wiring
    
    'tested' with rhel7 and XPsp3 - WS2016
     (i.e. it boots and all windows versions happy about AML qemu produces)
    Igor Mammedov committed Aug 15, 2018
    Copy the full SHA
    a3f10c3 View commit details
    Browse the repository at this point in the history
  3. acpi: add aml_create_byte_field()

    will be used by for packing _CST package in follow up patch
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Igor Mammedov committed Aug 15, 2018
    Copy the full SHA
    19b7938 View commit details
    Browse the repository at this point in the history
  4. acpi: aml: add aml_register()

    Based on a patch by Igor Mammedov.
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    mstsirkin authored and Igor Mammedov committed Aug 15, 2018
    Copy the full SHA
    41f0a73 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'master' of git://git.qemu-project.org/qemu

    Igor Mammedov committed Aug 15, 2018
    Copy the full SHA
    e8c3197 View commit details
    Browse the repository at this point in the history
  6. Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-2…

    …0180814' into staging
    
    target-arm queue:
     * Implement more of ARMv6-M support
     * Support direct execution from non-RAM regions;
       use this to implmeent execution from small (<1K) MPU regions
     * GICv2: implement the virtualization extensions
     * support a virtualization-capable GICv2 in the virt and
       xlnx-zynqmp boards
     * arm: Fix return code of arm_load_elf() so we can detect
       failure to load the file correctly
     * Implement HCR_EL2.TGE ("trap general exceptions") bit
     * Implement tailchaining for M profile cores
     * Fix bugs in SVE compare, saturating add/sub, WHILE, MOVZ
    
    # gpg: Signature made Tue 14 Aug 2018 17:23:38 BST
    # gpg:                using RSA key 3C2525ED14360CDE
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>"
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>"
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20180814: (45 commits)
      target/arm: Fix typo in helper_sve_movz_d
      target/arm: Reorganize SVE WHILE
      target/arm: Fix typo in do_sat_addsub_64
      target/arm: Fix sign of sve_cmpeq_ppzw/sve_cmpne_ppzw
      target/arm: Implement tailchaining for M profile cores
      target/arm: Restore M-profile CONTROL.SPSEL before any tailchaining
      target/arm: Initialize exc_secure correctly in do_v7m_exception_exit()
      target/arm: Improve exception-taken logging
      target/arm: Treat SCTLR_EL1.M as if it were zero when HCR_EL2.TGE is set
      target/arm: Provide accessor functions for HCR_EL2.{IMO, FMO, AMO}
      target/arm: Honour HCR_EL2.TGE when raising synchronous exceptions
      target/arm: Honour HCR_EL2.TGE and MDCR_EL2.TDE in debug register access checks
      target/arm: Mask virtual interrupts if HCR_EL2.TGE is set
      arm: Fix return code of arm_load_elf
      arm/virt: Add support for GICv2 virtualization extensions
      xlnx-zynqmp: Improve GIC wiring and MMIO mapping
      intc/arm_gic: Improve traces
      intc/arm_gic: Implement maintenance interrupt generation
      intc/arm_gic: Implement gic_update_virt() function
      intc/arm_gic: Implement the virtual interface registers
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Aug 15, 2018
    Copy the full SHA
    48a539d View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2018

  1. target/arm: Fix typo in helper_sve_movz_d

    Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Tested-by: Alex Bennée <alex.bennee@linaro.org>
    Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Message-id: 20180801123111.3595-5-richard.henderson@linaro.org
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    rth7680 authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    054e7ad View commit details
    Browse the repository at this point in the history
  2. target/arm: Reorganize SVE WHILE

    The pseudocode for this operation is an increment + compare loop,
    so comparing <= the maximum integer produces an all-true predicate.
    
    Rather than bound in both the inline code and the helper, pass the
    helper the number of predicate bits to set instead of the number
    of predicate elements to set.
    
    Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Tested-by: Alex Bennée <alex.bennee@linaro.org>
    Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Message-id: 20180801123111.3595-4-richard.henderson@linaro.org
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    rth7680 authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    bbd0968 View commit details
    Browse the repository at this point in the history
  3. target/arm: Fix typo in do_sat_addsub_64

    Used the wrong temporary in the computation of subtractive overflow.
    
    Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Tested-by: Alex Bennée <alex.bennee@linaro.org>
    Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Message-id: 20180801123111.3595-3-richard.henderson@linaro.org
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    rth7680 authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    7a31e0c View commit details
    Browse the repository at this point in the history
  4. target/arm: Fix sign of sve_cmpeq_ppzw/sve_cmpne_ppzw

    The normal vector element is sign-extended before
    comparing with the wide vector element.
    
    Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Tested-by: Alex Bennée <alex.bennee@linaro.org>
    Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
    Message-id: 20180801123111.3595-2-richard.henderson@linaro.org
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    rth7680 authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    df4e001 View commit details
    Browse the repository at this point in the history
  5. target/arm: Implement tailchaining for M profile cores

    Tailchaining is an optimization in handling of exception return
    for M-profile cores: if we are about to pop the exception stack
    for an exception return, but there is a pending exception which
    is higher priority than the priority we are returning to, then
    instead of unstacking and then immediately taking the exception
    and stacking registers again, we can chain to the pending
    exception without unstacking and stacking.
    
    For v6M and v7M it is IMPDEF whether tailchaining happens for pending
    exceptions; for v8M this is architecturally required.  Implement it
    in QEMU for all M-profile cores, since in practice v6M and v7M
    hardware implementations generally do have it.
    
    (We were already doing tailchaining for derived exceptions which
    happened during exception return, like the validity checks and
    stack access failures; these have always been required to be
    tailchained for all versions of the architecture.)
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20180720145647.8810-5-peter.maydell@linaro.org
    pm215 committed Aug 14, 2018
    Copy the full SHA
    5f62d3b View commit details
    Browse the repository at this point in the history
  6. target/arm: Restore M-profile CONTROL.SPSEL before any tailchaining

    On exception return for M-profile, we must restore the CONTROL.SPSEL
    bit from the EXCRET value before we do any kind of tailchaining,
    including for the derived exceptions on integrity check failures.
    Otherwise we will give the guest an incorrect EXCRET.SPSEL value on
    exception entry for the tailchained exception.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20180720145647.8810-4-peter.maydell@linaro.org
    pm215 committed Aug 14, 2018
    Copy the full SHA
    89b1fec View commit details
    Browse the repository at this point in the history
  7. target/arm: Initialize exc_secure correctly in do_v7m_exception_exit()

    In do_v7m_exception_exit(), we use the exc_secure variable to track
    whether the exception we're returning from is secure or non-secure.
    Unfortunately the statement initializing this was accidentally
    inside an "if (env->v7m.exception != ARMV7M_EXCP_NMI)" conditional,
    which meant that we were using the wrong value for NMI handlers.
    Move the initialization out to the right place.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20180720145647.8810-3-peter.maydell@linaro.org
    pm215 committed Aug 14, 2018
    Copy the full SHA
    b810960 View commit details
    Browse the repository at this point in the history
  8. target/arm: Improve exception-taken logging

    Improve the exception-taken logging by logging in
    v7m_exception_taken() the exception we're going to take
    and whether it is secure/nonsecure.
    
    This requires us to move logging at many callsites from after the
    call to before it, so that the logging appears in a sensible order.
    
    (This will make tail-chaining produce more useful logs; for the
    current callers of v7m_exception_taken() we know which exception
    we're going to take, so custom log messages at the callsite sufficed;
    for tail-chaining only v7m_exception_taken() knows the exception
    number that we're going to tail-chain to.)
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20180720145647.8810-2-peter.maydell@linaro.org
    pm215 committed Aug 14, 2018
    Copy the full SHA
    a907497 View commit details
    Browse the repository at this point in the history
  9. target/arm: Treat SCTLR_EL1.M as if it were zero when HCR_EL2.TGE is set

    One of the required effects of setting HCR_EL2.TGE is that when
    SCR_EL3.NS is 1 then SCTLR_EL1.M must behave as if it is zero for
    all purposes except direct reads. That is, it effectively disables
    the MMU for the NS EL0/EL1 translation regime.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20180724115950.17316-6-peter.maydell@linaro.org
    pm215 committed Aug 14, 2018
    Copy the full SHA
    3d0e308 View commit details
    Browse the repository at this point in the history
  10. target/arm: Provide accessor functions for HCR_EL2.{IMO, FMO, AMO}

    The IMO, FMO and AMO bits in HCR_EL2 are defined to "behave as
    1 for all purposes other than direct reads" if HCR_EL2.TGE
    is set and HCR_EL2.E2H is 0, and to "behave as 0 for all
    purposes other than direct reads" if HCR_EL2.TGE is set
    and HRC_EL2.E2H is 1.
    
    To avoid having to check E2H and TGE everywhere where we test IMO and
    FMO, provide accessors arm_hcr_el2_imo(), arm_hcr_el2_fmo()and
    arm_hcr_el2_amo().  We don't implement ARMv8.1-VHE yet, so the E2H
    case will never be true, but we include the logic to save effort when
    we eventually do get to that.
    
    (Note that in several of these callsites the change doesn't
    actually make a difference as either the callsite is handling
    TGE specially anyway, or the CPU can't get into that situation
    with TGE set; we change everywhere for consistency.)
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20180724115950.17316-5-peter.maydell@linaro.org
    pm215 committed Aug 14, 2018
    Copy the full SHA
    ac656b1 View commit details
    Browse the repository at this point in the history
  11. target/arm: Honour HCR_EL2.TGE when raising synchronous exceptions

    Whene we raise a synchronous exception, if HCR_EL2.TGE is set then
    exceptions targeting NS EL1 must be redirected to EL2.  Implement
    this in raise_exception() -- all synchronous exceptions go through
    this function.
    
    (Asynchronous exceptions go via arm_cpu_exec_interrupt(), which
    already honours HCR_EL2.TGE when it determines the target EL
    in arm_phys_excp_target_el().)
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20180724115950.17316-4-peter.maydell@linaro.org
    pm215 committed Aug 14, 2018
    Copy the full SHA
    7556edf View commit details
    Browse the repository at this point in the history
  12. target/arm: Honour HCR_EL2.TGE and MDCR_EL2.TDE in debug register acc…

    …ess checks
    
    Some debug registers can be trapped via MDCR_EL2 bits TDRA, TDOSA,
    and TDA, which we implement in the functions access_tdra(),
    access_tdosa() and access_tda(). If MDCR_EL2.TDE or HCR_EL2.TGE
    are 1, the TDRA, TDOSA and TDA bits should behave as if they were 1.
    Implement this by having the access functions check MDCR_EL2.TDE
    and HCR_EL2.TGE.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20180724115950.17316-3-peter.maydell@linaro.org
    pm215 committed Aug 14, 2018
    Copy the full SHA
    30ac633 View commit details
    Browse the repository at this point in the history
  13. target/arm: Mask virtual interrupts if HCR_EL2.TGE is set

    If the "trap general exceptions" bit HCR_EL2.TGE is set, we
    must mask all virtual interrupts (as per DDI0487C.a D1.14.3).
    Implement this in arm_excp_unmasked().
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20180724115950.17316-2-peter.maydell@linaro.org
    pm215 committed Aug 14, 2018
    Copy the full SHA
    2ccf0fe View commit details
    Browse the repository at this point in the history
  14. arm: Fix return code of arm_load_elf

    Use an int64_t as a return type to restore
    the negative check for arm_load_as.
    
    Signed-off-by: Adam Lackorzynski <adam@l4re.org>
    Message-id: 20180730173712.GG4987@os.inf.tu-dresden.de
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Adam Lackorzynski authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    a3f0ecf View commit details
    Browse the repository at this point in the history
  15. arm/virt: Add support for GICv2 virtualization extensions

    Add support for GICv2 virtualization extensions by mapping the necessary
    I/O regions and connecting the maintenance IRQ lines.
    
    Declare those additions in the device tree and in the ACPI tables.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20180727095421.386-21-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    55ef323 View commit details
    Browse the repository at this point in the history
  16. xlnx-zynqmp: Improve GIC wiring and MMIO mapping

    This commit improve the way the GIC is realized and connected in the
    ZynqMP SoC. The security extensions are enabled only if requested in the
    machine state. The same goes for the virtualization extensions.
    
    All the GIC to APU CPU(s) IRQ lines are now connected, including FIQ,
    vIRQ and vFIQ. The missing CPU to GIC timers IRQ connections are also
    added (HYP and SEC timers).
    
    The GIC maintenance IRQs are back-wired to the correct GIC PPIs.
    
    Finally, the MMIO mappings are reworked to take into account the ZynqMP
    specifics. The GIC (v)CPU interface is aliased 16 times:
      * for the first 0x1000 bytes from 0xf9010000 to 0xf901f000
      * for the second 0x1000 bytes from 0xf9020000 to 0xf902f000
    Mappings of the virtual interface and virtual CPU interface are mapped
    only when virtualization extensions are requested. The
    XlnxZynqMPGICRegion struct has been enhanced to be able to catch all
    this information.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Message-id: 20180727095421.386-20-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    75b749a View commit details
    Browse the repository at this point in the history
  17. intc/arm_gic: Improve traces

    Add some traces to the ARM GIC to catch register accesses (distributor,
    (v)cpu interface and virtual interface), and to take into account
    virtualization extensions (print `vcpu` instead of `cpu` when needed).
    
    Also add some virtualization extensions specific traces: LR updating
    and maintenance IRQ generation.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20180727095421.386-19-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    067a2b9 View commit details
    Browse the repository at this point in the history
  18. intc/arm_gic: Implement maintenance interrupt generation

    Implement the maintenance interrupt generation that is part of the GICv2
    virtualization extensions.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20180727095421.386-18-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    50e5792 View commit details
    Browse the repository at this point in the history
  19. intc/arm_gic: Implement gic_update_virt() function

    Add the gic_update_virt() function to update the vCPU interface states
    and raise vIRQ and vFIQ as needed. This commit renames gic_update() to
    gic_update_internal() and generalizes it to handle both cases, with a
    `virt' parameter to track whether we are updating the CPU or vCPU
    interfaces.
    
    The main difference between CPU and vCPU is the way we select the best
    IRQ. This part has been split into the gic_get_best_(v)irq functions.
    For the virt case, the LRs are iterated to find the best candidate.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20180727095421.386-17-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    cbe1282 View commit details
    Browse the repository at this point in the history
  20. intc/arm_gic: Implement the virtual interface registers

    Implement the read and write functions for the virtual interface of the
    virtualization extensions in the GICv2.
    
    One mirror region per CPU is also created, which maps to that specific
    CPU id. This is required by the GIC architecture specification.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20180727095421.386-16-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    527d296 View commit details
    Browse the repository at this point in the history
  21. intc/arm_gic: Wire the vCPU interface

    Add the read/write functions to handle accesses to the vCPU interface.
    Those accesses are forwarded to the real CPU interface, with the CPU id
    being converted to the corresponding vCPU id (vCPU id = CPU id +
    GIC_NCPU).
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Message-id: 20180727095421.386-15-luc.michel@greensocs.com
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    2c679ac View commit details
    Browse the repository at this point in the history
  22. intc/arm_gic: Implement virtualization extensions in gic_cpu_(read|wr…

    …ite)
    
    Implement virtualization extensions in the gic_cpu_read() and
    gic_cpu_write() functions. Those are the last bits missing to fully
    support virtualization extensions in the CPU interface path.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20180727095421.386-14-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    7eb079e View commit details
    Browse the repository at this point in the history
  23. intc/arm_gic: Implement virtualization extensions in gic_(deactivate|…

    …complete_irq)
    
    Implement virtualization extensions in the gic_deactivate_irq() and
    gic_complete_irq() functions.
    
    When the guest writes an invalid vIRQ to V_EOIR or V_DIR, since the
    GICv2 specification is not entirely clear here, we adopt the behaviour
    observed on real hardware:
      * When V_CTRL.EOIMode is false (EOI split is disabled):
        - In case of an invalid vIRQ write to V_EOIR:
          -> If some bits are set in H_APR, an invalid vIRQ write to V_EOIR
             triggers a priority drop, and increments V_HCR.EOICount.
          -> If V_APR is already cleared, nothing happen
    
        - An invalid vIRQ write to V_DIR is ignored.
    
      * When V_CTRL.EOIMode is true:
        - In case of an invalid vIRQ write to V_EOIR:
          -> If some bits are set in H_APR, an invalid vIRQ write to V_EOIR
             triggers a priority drop.
          -> If V_APR is already cleared, nothing happen
    
        - An invalid vIRQ write to V_DIR increments V_HCR.EOICount.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Message-id: 20180727095421.386-13-luc.michel@greensocs.com
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    02f2e22 View commit details
    Browse the repository at this point in the history
  24. intc/arm_gic: Implement virtualization extensions in gic_acknowledge_irq

    Implement virtualization extensions in the gic_acknowledge_irq()
    function. This function changes the state of the highest priority IRQ
    from pending to active.
    
    When the current CPU is a vCPU, modifying the state of an IRQ modifies
    the corresponding LR entry. However if we clear the pending flag before
    setting the active one, we lose track of the LR entry as it becomes
    invalid. The next call to gic_get_lr_entry() will fail.
    
    To overcome this issue, we call gic_activate_irq() before
    gic_clear_pending(). This does not change the general behaviour of
    gic_acknowledge_irq.
    
    We also move the SGI case in gic_clear_pending_sgi() to enhance
    code readability as the virtualization extensions support adds a if-else
    level.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20180727095421.386-12-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    439badd View commit details
    Browse the repository at this point in the history
  25. intc/arm_gic: Implement virtualization extensions in gic_(activate_ir…

    …q|drop_prio)
    
    Implement virtualization extensions in gic_activate_irq() and
    gic_drop_prio() and in gic_get_prio_from_apr_bits() called by
    gic_drop_prio().
    
    When the current CPU is a vCPU:
      - Use GIC_VIRT_MIN_BPR and GIC_VIRT_NR_APRS instead of their non-virt
      counterparts,
      - the vCPU APR is stored in the virtual interface, in h_apr.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20180727095421.386-11-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    a1d7b8d View commit details
    Browse the repository at this point in the history
  26. intc/arm_gic: Add virtualization enabled IRQ helper functions

    Add some helper functions to gic_internal.h to get or change the state
    of an IRQ. When the current CPU is not a vCPU, the call is forwarded to
    the GIC distributor. Otherwise, it acts on the list register matching
    the IRQ in the current CPU virtual interface.
    
    gic_clear_active can have a side effect on the distributor, even in the
    vCPU case, when the correponding LR has the HW field set.
    
    Use those functions in the CPU interface code path to prepare for the
    vCPU interface implementation.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20180727095421.386-10-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    86b350f View commit details
    Browse the repository at this point in the history
  27. intc/arm_gic: Refactor secure/ns access check in the CPU interface

    An access to the CPU interface is non-secure if the current GIC instance
    implements the security extensions, and the memory access is actually
    non-secure. Until then, it was checked with tests such as
      if (s->security_extn && !attrs.secure) { ... }
    in various places of the CPU interface code.
    
    With the implementation of the virtualization extensions, those tests
    must be updated to take into account whether we are in a vCPU interface
    or not. This is because the exposed vCPU interface does not implement
    security extensions.
    
    This commits replaces all those tests with a call to the
    gic_cpu_ns_access() function to check if the current access to the CPU
    interface is non-secure. This function takes into account whether the
    current CPU is a vCPU or not.
    
    Note that this function is used only in the (v)CPU interface code path.
    The distributor code path is left unchanged, as the distributor is not
    exposed to vCPUs at all.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20180727095421.386-9-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    3dd0471 View commit details
    Browse the repository at this point in the history
  28. intc/arm_gic: Add virtualization extensions helper macros and functions

    Add some helper macros and functions related to the virtualization
    extensions to gic_internal.h.
    
    The GICH_LR_* macros help extracting specific fields of a list register
    value. The only tricky one is the priority field as only the MSB are
    stored. The value must be shifted accordingly to obtain the correct
    priority value.
    
    gic_is_vcpu() and gic_get_vcpu_real_id() help with (v)CPU id manipulation
    to abstract the fact that vCPU id are in the range
    [ GIC_NCPU; (GIC_NCPU + num_cpu) [.
    
    gic_lr_* and gic_virq_is_valid() help with the list registers.
    gic_get_lr_entry() returns the LR entry for a given (vCPU, irq) pair. It
    is meant to be used in contexts where we know for sure that the entry
    exists, so we assert that entry is actually found, and the caller can
    avoid the NULL check on the returned pointer.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20180727095421.386-8-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    4a37e0e View commit details
    Browse the repository at this point in the history
  29. intc/arm_gic: Add virtual interface register definitions

    Add the register definitions for the virtual interface of the GICv2.
    
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20180727095421.386-7-luc.michel@greensocs.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Luc Michel authored and pm215 committed Aug 14, 2018
    Copy the full SHA
    7c2fffd View commit details
    Browse the repository at this point in the history
Older