1. 14 9月, 2015 1 次提交
    • W
      KVM: arm64: add workaround for Cortex-A57 erratum #852523 · 43297dda
      Will Deacon 提交于
      When restoring the system register state for an AArch32 guest at EL2,
      writes to DACR32_EL2 may not be correctly synchronised by Cortex-A57,
      which can lead to the guest effectively running with junk in the DACR
      and running into unexpected domain faults.
      
      This patch works around the issue by re-ordering our restoration of the
      AArch32 register aliases so that they happen before the AArch64 system
      registers. Ensuring that the registers are restored in this order
      guarantees that they will be correctly synchronised by the core.
      
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      43297dda
  2. 20 8月, 2015 1 次提交
  3. 12 8月, 2015 2 次提交
  4. 21 7月, 2015 8 次提交
  5. 17 6月, 2015 3 次提交
  6. 12 6月, 2015 1 次提交
  7. 27 3月, 2015 1 次提交
  8. 23 3月, 2015 1 次提交
  9. 12 3月, 2015 3 次提交
  10. 30 1月, 2015 1 次提交
    • M
      arm/arm64: KVM: Use set/way op trapping to track the state of the caches · 3c1e7165
      Marc Zyngier 提交于
      Trying to emulate the behaviour of set/way cache ops is fairly
      pointless, as there are too many ways we can end-up missing stuff.
      Also, there is some system caches out there that simply ignore
      set/way operations.
      
      So instead of trying to implement them, let's convert it to VA ops,
      and use them as a way to re-enable the trapping of VM ops. That way,
      we can detect the point when the MMU/caches are turned off, and do
      a full VM flush (which is what the guest was trying to do anyway).
      
      This allows a 32bit zImage to boot on the APM thingy, and will
      probably help bootloaders in general.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      3c1e7165
  11. 21 1月, 2015 5 次提交
    • A
      arm64: KVM: add SGI generation register emulation · 6d52f35a
      Andre Przywara 提交于
      While the generation of a (virtual) inter-processor interrupt (SGI)
      on a GICv2 works by writing to a MMIO register, GICv3 uses the system
      register ICC_SGI1R_EL1 to trigger them.
      Add a trap handler function that calls the new SGI register handler
      in the GICv3 code. As ICC_SRE_EL1.SRE at this point is still always 0,
      this will not trap yet, but will only be used later when all the data
      structures have been initialized properly.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      6d52f35a
    • A
      arm/arm64: KVM: add virtual GICv3 distributor emulation · a0675c25
      Andre Przywara 提交于
      With everything separated and prepared, we implement a model of a
      GICv3 distributor and redistributors by using the existing framework
      to provide handler functions for each register group.
      
      Currently we limit the emulation to a model enforcing a single
      security state, with SRE==1 (forcing system register access) and
      ARE==1 (allowing more than 8 VCPUs).
      
      We share some of the functions provided for GICv2 emulation, but take
      the different ways of addressing (v)CPUs into account.
      Save and restore is currently not implemented.
      
      Similar to the split-off of the GICv2 specific code, the new emulation
      code goes into a new file (vgic-v3-emul.c).
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      a0675c25
    • A
      arm/arm64: KVM: split GICv2 specific emulation code from vgic.c · 1d916229
      Andre Przywara 提交于
      vgic.c is currently a mixture of generic vGIC emulation code and
      functions specific to emulating a GICv2. To ease the addition of
      GICv3, split off strictly v2 specific parts into a new file
      vgic-v2-emul.c.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Acked-by: NChristoffer Dall <christoffer.dall@linaro.org>
      
      -------
      As the diff isn't always obvious here (and to aid eventual rebases),
      here is a list of high-level changes done to the code:
      * added new file to respective arm/arm64 Makefiles
      * moved GICv2 specific functions to vgic-v2-emul.c:
        - handle_mmio_misc()
        - handle_mmio_set_enable_reg()
        - handle_mmio_clear_enable_reg()
        - handle_mmio_set_pending_reg()
        - handle_mmio_clear_pending_reg()
        - handle_mmio_priority_reg()
        - vgic_get_target_reg()
        - vgic_set_target_reg()
        - handle_mmio_target_reg()
        - handle_mmio_cfg_reg()
        - handle_mmio_sgi_reg()
        - vgic_v2_unqueue_sgi()
        - read_set_clear_sgi_pend_reg()
        - write_set_clear_sgi_pend_reg()
        - handle_mmio_sgi_set()
        - handle_mmio_sgi_clear()
        - vgic_v2_handle_mmio()
        - vgic_get_sgi_sources()
        - vgic_dispatch_sgi()
        - vgic_v2_queue_sgi()
        - vgic_v2_map_resources()
        - vgic_v2_init()
        - vgic_v2_add_sgi_source()
        - vgic_v2_init_model()
        - vgic_v2_init_emulation()
        - handle_cpu_mmio_misc()
        - handle_mmio_abpr()
        - handle_cpu_mmio_ident()
        - vgic_attr_regs_access()
        - vgic_create() (renamed to vgic_v2_create())
        - vgic_destroy() (renamed to vgic_v2_destroy())
        - vgic_has_attr() (renamed to vgic_v2_has_attr())
        - vgic_set_attr() (renamed to vgic_v2_set_attr())
        - vgic_get_attr() (renamed to vgic_v2_get_attr())
        - struct kvm_mmio_range vgic_dist_ranges[]
        - struct kvm_mmio_range vgic_cpu_ranges[]
        - struct kvm_device_ops kvm_arm_vgic_v2_ops {}
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      1d916229
    • A
      arm/arm64: KVM: make the value of ICC_SRE_EL1 a per-VM variable · 2f5fa41a
      Andre Przywara 提交于
      ICC_SRE_EL1 is a system register allowing msr/mrs accesses to the
      GIC CPU interface for EL1 (guests). Currently we force it to 0, but
      for proper GICv3 support we have to allow guests to use it (depending
      on their selected virtual GIC model).
      So add ICC_SRE_EL1 to the list of saved/restored registers on a
      world switch, but actually disallow a guest to change it by only
      restoring a fixed, once-initialized value.
      This value depends on the GIC model userland has chosen for a guest.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      2f5fa41a
    • A
      arm/arm64: KVM: rework MPIDR assignment and add accessors · 4429fc64
      Andre Przywara 提交于
      The virtual MPIDR registers (containing topology information) for the
      guest are currently mapped linearily to the vcpu_id. Improve this
      mapping for arm64 by using three levels to not artificially limit the
      number of vCPUs.
      To help this, change and rename the kvm_vcpu_get_mpidr() function to
      mask off the non-affinity bits in the MPIDR register.
      Also add an accessor to later allow easier access to a vCPU with a
      given MPIDR. Use this new accessor in the PSCI emulation.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      4429fc64
  12. 16 1月, 2015 2 次提交
  13. 15 1月, 2015 3 次提交
  14. 12 1月, 2015 2 次提交
  15. 07 1月, 2015 1 次提交
    • P
      rcu: Make SRCU optional by using CONFIG_SRCU · 83fe27ea
      Pranith Kumar 提交于
      SRCU is not necessary to be compiled by default in all cases. For tinification
      efforts not compiling SRCU unless necessary is desirable.
      
      The current patch tries to make compiling SRCU optional by introducing a new
      Kconfig option CONFIG_SRCU which is selected when any of the components making
      use of SRCU are selected.
      
      If we do not select CONFIG_SRCU, srcu.o will not be compiled at all.
      
         text    data     bss     dec     hex filename
         2007       0       0    2007     7d7 kernel/rcu/srcu.o
      
      Size of arch/powerpc/boot/zImage changes from
      
         text    data     bss     dec     hex filename
       831552   64180   23944  919676   e087c arch/powerpc/boot/zImage : before
       829504   64180   23952  917636   e0084 arch/powerpc/boot/zImage : after
      
      so the savings are about ~2000 bytes.
      Signed-off-by: NPranith Kumar <bobby.prani@gmail.com>
      CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      CC: Josh Triplett <josh@joshtriplett.org>
      CC: Lai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      [ paulmck: resolve conflict due to removal of arch/ia64/kvm/Kconfig. ]
      83fe27ea
  16. 13 12月, 2014 2 次提交
  17. 26 11月, 2014 1 次提交
    • C
      arm64: KVM: Handle traps of ICC_SRE_EL1 as RAZ/WI · db7dedd0
      Christoffer Dall 提交于
      When running on a system with a GICv3, we currenly don't allow the guest
      to access the system register interface of the GICv3.  We do this by
      clearing the ICC_SRE_EL2.Enable, which causes all guest accesses to
      ICC_SRE_EL1 to trap to EL2 and causes all guest accesses to other ICC_
      registers to cause an undefined exception in the guest.
      
      However, we currently don't handle the trap of guest accesses to
      ICC_SRE_EL1 and will spill out a warning.  The trap just needs to handle
      the access as RAZ/WI, and a guest that tries to prod this register and
      set ICC_SRE_EL1.SRE=1, must read back the value (which Linux already
      does) to see if it succeeded, and will thus observe that ICC_SRE_EL1.SRE
      was not set.
      
      Add the simple trap handler in the sorted table of the system registers.
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      [ardb: added cp15 handling]
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      db7dedd0
  18. 07 11月, 2014 1 次提交
  19. 16 10月, 2014 1 次提交