1. 19 5月, 2015 1 次提交
    • L
      ARM64: kernel: make cpu_ops hooks DT agnostic · 819a8826
      Lorenzo Pieralisi 提交于
      ARM64 CPU operations such as cpu_init and cpu_init_idle take
      a struct device_node pointer as a parameter, which corresponds to
      the device tree node of the logical cpu on which the operation
      has to be applied.
      
      With the advent of ACPI on arm64, where MADT static table entries
      are used to initialize cpus, the device tree node parameter
      in cpu_ops hooks become useless when booting with ACPI, since
      in that case cpu device tree nodes are not present and can not be
      used for cpu initialization.
      
      The current cpu_init hook requires a struct device_node pointer
      parameter because it is called while parsing the device tree to
      initialize CPUs, when the cpu_logical_map (that is used to match
      a cpu node reg property to a device tree node) for a given logical
      cpu id is not set up yet. This means that the cpu_init hook cannot
      rely on the of_get_cpu_node function to retrieve the device tree
      node corresponding to the logical cpu id passed in as parameter,
      so the cpu device tree node must be passed in as a parameter to fix
      this catch-22 dependency cycle.
      
      This patch reshuffles the cpu_logical_map initialization code so
      that the cpu_init cpu_ops hook can safely use the of_get_cpu_node
      function to retrieve the cpu device tree node, removing the need for
      the device tree node pointer parameter.
      
      In the process, the patch removes device tree node parameters
      from all cpu_ops hooks, in preparation for SMP DT/ACPI cpus
      initialization consolidation.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NHanjun Guo <hanjun.guo@linaro.org>
      Acked-by: NSudeep Holla <sudeep.holla@arm.com>
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: Mark Rutland <mark.rutland@arm.com> [DT]
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      819a8826
  2. 27 4月, 2015 1 次提交
  3. 15 4月, 2015 3 次提交
  4. 13 4月, 2015 1 次提交
  5. 09 4月, 2015 1 次提交
    • A
      jump_label: Allow asm/jump_label.h to be included in assembly · 55dd0df7
      Anton Blanchard 提交于
      Wrap asm/jump_label.h for all archs with #ifndef __ASSEMBLY__.
      Since these are kernel only headers, we don't need #ifdef
      __KERNEL__ so can simplify things a bit.
      
      If an architecture wants to use jump labels in assembly, it
      will still need to define a macro to create the __jump_table
      entries (see ARCH_STATIC_BRANCH in the powerpc asm/jump_label.h
      for an example).
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: benh@kernel.crashing.org
      Cc: catalin.marinas@arm.com
      Cc: davem@davemloft.net
      Cc: heiko.carstens@de.ibm.com
      Cc: jbaron@akamai.com
      Cc: linux@arm.linux.org.uk
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: liuj97@gmail.com
      Cc: mgorman@suse.de
      Cc: mmarek@suse.cz
      Cc: mpe@ellerman.id.au
      Cc: paulus@samba.org
      Cc: ralf@linux-mips.org
      Cc: rostedt@goodmis.org
      Cc: schwidefsky@de.ibm.com
      Cc: will.deacon@arm.com
      Link: http://lkml.kernel.org/r/1428551492-21977-1-git-send-email-anton@samba.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      55dd0df7
  6. 01 4月, 2015 1 次提交
  7. 31 3月, 2015 2 次提交
    • J
      arm64: Use bool function return values of true/false not 1/0 · cc3979b5
      Joe Perches 提交于
      Use the normal return values for bool functions
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      cc3979b5
    • A
      KVM: arm/arm64: rework MMIO abort handling to use KVM MMIO bus · 950324ab
      Andre Przywara 提交于
      Currently we have struct kvm_exit_mmio for encapsulating MMIO abort
      data to be passed on from syndrome decoding all the way down to the
      VGIC register handlers. Now as we switch the MMIO handling to be
      routed through the KVM MMIO bus, it does not make sense anymore to
      use that structure already from the beginning. So we keep the data in
      local variables until we put them into the kvm_io_bus framework.
      Then we fill kvm_exit_mmio in the VGIC only, making it a VGIC private
      structure. On that way we replace the data buffer in that structure
      with a pointer pointing to a single location in a local variable, so
      we get rid of some copying on the way.
      With all of the virtual GIC emulation code now being registered with
      the kvm_io_bus, we can remove all of the old MMIO handling code and
      its dispatching functionality.
      
      I didn't bother to rename kvm_exit_mmio (to vgic_mmio or something),
      because that touches a lot of code lines without any good reason.
      
      This is based on an original patch by Nikolay.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Cc: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      950324ab
  8. 30 3月, 2015 2 次提交
  9. 27 3月, 2015 1 次提交
    • S
      arm-cci: Get rid of secure transactions for PMU driver · 772742a6
      Suzuki K. Poulose 提交于
      Avoid secure transactions while probing the CCI PMU. The
      existing code makes use of the Peripheral ID2 (PID2) register
      to determine the revision of the CCI400, which requires a
      secure transaction. This puts a limitation on the usage of the
      driver on systems running non-secure Linux(e.g, ARM64).
      
      Updated the device-tree binding for cci pmu node to add the explicit
      revision number for the compatible field.
      
      The supported strings are :
      	arm,cci-400-pmu,r0
      	arm,cci-400-pmu,r1
      	arm,cci-400-pmu - DEPRECATED. See NOTE below
      
      NOTE: If the revision is not mentioned, we need to probe the cci revision,
      which could be fatal on a platform running non-secure. We need a reliable way
      to know if we can poke the CCI registers at runtime on ARM32. We depend on
      'mcpm_is_available()' when it is available. mcpm_is_available() returns true
      only when there is a registered driver for mcpm. Otherwise, we assume that we
      don't have secure access, and skips probing the revision number(ARM64 case).
      
      The MCPM should figure out if it is safe to access the CCI. Unfortunately
      there isn't a reliable way to indicate the same via dtb. This patch doesn't
      address/change the current situation. It only deals with the CCI-PMU, leaving
      the assumptions about the secure access as it has been, prior to this patch.
      
      Cc: devicetree@vger.kernel.org
      Cc: Punit Agrawal <punit.agrawal@arm.com>
      Tested-by: NSudeep Holla <sudeep.holla@arm.com>
      Acked-by: NNicolas Pitre <nicolas.pitre@linaro.org>
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NSuzuki K. Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      772742a6
  10. 26 3月, 2015 4 次提交
  11. 25 3月, 2015 8 次提交
  12. 24 3月, 2015 4 次提交
  13. 23 3月, 2015 2 次提交
  14. 21 3月, 2015 1 次提交
    • W
      arm64: efi: don't restore TTBR0 if active_mm points at init_mm · 130c93fd
      Will Deacon 提交于
      init_mm isn't a normal mm: it has swapper_pg_dir as its pgd (which
      contains kernel mappings) and is used as the active_mm for the idle
      thread.
      
      When restoring the pgd after an EFI call, we write current->active_mm
      into TTBR0. If the current task is actually the idle thread (e.g. when
      initialising the EFI RTC before entering userspace), then the TLB can
      erroneously populate itself with junk global entries as a result of
      speculative table walks.
      
      When we do eventually return to userspace, the task can end up hitting
      these junk mappings leading to lockups, corruption or crashes.
      
      This patch fixes the problem in the same way as the CPU suspend code by
      ensuring that we never switch to the init_mm in efi_set_pgd and instead
      point TTBR0 at the zero page. A check is also added to cpu_switch_mm to
      BUG if we get passed swapper_pg_dir.
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Fixes: f3cdfd23 ("arm64/efi: move SetVirtualAddressMap() to UEFI stub")
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      130c93fd
  15. 20 3月, 2015 3 次提交
  16. 19 3月, 2015 2 次提交
  17. 18 3月, 2015 1 次提交
  18. 17 3月, 2015 1 次提交
  19. 14 3月, 2015 1 次提交
    • C
      arm64: Invalidate the TLB corresponding to intermediate page table levels · 285994a6
      Catalin Marinas 提交于
      The ARM architecture allows the caching of intermediate page table
      levels and page table freeing requires a sequence like:
      
      	pmd_clear()
      	TLB invalidation
      	pte page freeing
      
      With commit 5e5f6dc1 (arm64: mm: enable HAVE_RCU_TABLE_FREE logic),
      the page table freeing batching was moved from tlb_remove_page() to
      tlb_remove_table(). The former takes care of TLB invalidation as this is
      also shared with pte clearing and page cache page freeing. The latter,
      however, does not invalidate the TLBs for intermediate page table levels
      as it probably relies on the architecture code to do it if required.
      When the mm->mm_users < 2, tlb_remove_table() does not do any batching
      and page table pages are freed before tlb_finish_mmu() which performs
      the actual TLB invalidation.
      
      This patch introduces __tlb_flush_pgtable() for arm64 and calls it from
      the {pte,pmd,pud}_free_tlb() directly without relying on deferred page
      table freeing.
      
      Fixes: 5e5f6dc1 arm64: mm: enable HAVE_RCU_TABLE_FREE logic
      Reported-by: NJon Masters <jcm@redhat.com>
      Tested-by: NJon Masters <jcm@redhat.com>
      Tested-by: NSteve Capper <steve.capper@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      285994a6