1. 11 5月, 2016 1 次提交
  2. 25 4月, 2016 1 次提交
    • S
      arm64: Fix behavior of maxcpus=N · 44dbcc93
      Suzuki K Poulose 提交于
      maxcpu=n sets the number of CPUs activated at boot time to a max of n,
      but allowing the remaining CPUs to be brought up later if the user
      decides to do so. However, on arm64 due to various reasons, we disallowed
      hotplugging CPUs beyond n, by marking them not present. Now that
      we have checks in place to make sure the hotplugged CPUs have compatible
      features with system and requires no new errata, relax the restriction.
      
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      44dbcc93
  3. 19 4月, 2016 1 次提交
    • J
      arm64: Reduce verbosity on SMP CPU stop · 82611c14
      Jan Glauber 提交于
      When CPUs are stopped during an abnormal operation like panic
      for each CPU a line is printed and the stack trace is dumped.
      
      This information is only interesting for the aborting CPU
      and on systems with many CPUs it only makes it harder to
      debug if after the aborting CPU the log is flooded with data
      about all other CPUs too.
      
      Therefore remove the stack dump and printk of other CPUs
      and only print a single line that the other CPUs are going to be
      stopped and, in case any CPUs remain online list them.
      Signed-off-by: NJan Glauber <jglauber@cavium.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      82611c14
  4. 16 4月, 2016 2 次提交
  5. 02 3月, 2016 1 次提交
    • T
      arch/hotplug: Call into idle with a proper state · fc6d73d6
      Thomas Gleixner 提交于
      Let the non boot cpus call into idle with the corresponding hotplug state, so
      the hotplug core can handle the further bringup. That's a first step to
      convert the boot side of the hotplugged cpus to do all the synchronization
      with the other side through the state machine. For now it'll only start the
      hotplug thread and kick the full bringup of the cpu.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: linux-arch@vger.kernel.org
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Rafael Wysocki <rafael.j.wysocki@intel.com>
      Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Sebastian Siewior <bigeasy@linutronix.de>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul Turner <pjt@google.com>
      Link: http://lkml.kernel.org/r/20160226182341.614102639@linutronix.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      fc6d73d6
  6. 25 2月, 2016 2 次提交
    • S
      arm64: Handle early CPU boot failures · bb905274
      Suzuki K Poulose 提交于
      A secondary CPU could fail to come online due to insufficient
      capabilities and could simply die or loop in the kernel.
      e.g, a CPU with no support for the selected kernel PAGE_SIZE
      loops in kernel with MMU turned off.
      or a hotplugged CPU which doesn't have one of the advertised
      system capability will die during the activation.
      
      There is no way to synchronise the status of the failing CPU
      back to the master. This patch solves the issue by adding a
      field to the secondary_data which can be updated by the failing
      CPU. If the secondary CPU fails even before turning the MMU on,
      it updates the status in a special variable reserved in the head.txt
      section to make sure that the update can be cache invalidated safely
      without possible sharing of cache write back granule.
      
      Here are the possible states :
      
       -1. CPU_MMU_OFF - Initial value set by the master CPU, this value
      indicates that the CPU could not turn the MMU on, hence the status
      could not be reliably updated in the secondary_data. Instead, the
      CPU has updated the status @ __early_cpu_boot_status.
      
       0. CPU_BOOT_SUCCESS - CPU has booted successfully.
      
       1. CPU_KILL_ME - CPU has invoked cpu_ops->die, indicating the
      master CPU to synchronise by issuing a cpu_ops->cpu_kill.
      
       2. CPU_STUCK_IN_KERNEL - CPU couldn't invoke die(), instead is
      looping in the kernel. This information could be used by say,
      kexec to check if it is really safe to do a kexec reboot.
      
       3. CPU_PANIC_KERNEL - CPU detected some serious issues which
      requires kernel to crash immediately. The secondary CPU cannot
      call panic() until it has initialised the GIC. This flag can
      be used to instruct the master to do so.
      
      Cc: Mark Rutland <mark.rutland@arm.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      [catalin.marinas@arm.com: conflict resolution]
      [catalin.marinas@arm.com: converted "status" from int to long]
      [catalin.marinas@arm.com: updated update_early_cpu_boot_status to use str_l]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      bb905274
    • S
      arm64: Move cpu_die_early to smp.c · fce6361f
      Suzuki K Poulose 提交于
      This patch moves cpu_die_early to smp.c, where it fits better.
      No functional changes, except for adding the necessary checks
      for CONFIG_HOTPLUG_CPU.
      
      Cc: Mark Rutland <mark.rutland@arm.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      fce6361f
  7. 16 2月, 2016 2 次提交
    • L
      arm64: kernel: implement ACPI parking protocol · 5e89c55e
      Lorenzo Pieralisi 提交于
      The SBBR and ACPI specifications allow ACPI based systems that do not
      implement PSCI (eg systems with no EL3) to boot through the ACPI parking
      protocol specification[1].
      
      This patch implements the ACPI parking protocol CPU operations, and adds
      code that eases parsing the parking protocol data structures to the
      ARM64 SMP initializion carried out at the same time as cpus enumeration.
      
      To wake-up the CPUs from the parked state, this patch implements a
      wakeup IPI for ARM64 (ie arch_send_wakeup_ipi_mask()) that mirrors the
      ARM one, so that a specific IPI is sent for wake-up purpose in order
      to distinguish it from other IPI sources.
      
      Given the current ACPI MADT parsing API, the patch implements a glue
      layer that helps passing MADT GICC data structure from SMP initialization
      code to the parking protocol implementation somewhat overriding the CPU
      operations interfaces. This to avoid creating a completely trasparent
      DT/ACPI CPU operations layer that would require creating opaque
      structure handling for CPUs data (DT represents CPU through DT nodes, ACPI
      through static MADT table entries), which seems overkill given that ACPI
      on ARM64 mandates only two booting protocols (PSCI and parking protocol),
      so there is no need for further protocol additions.
      
      Based on the original work by Mark Salter <msalter@redhat.com>
      
      [1] https://acpica.org/sites/acpica/files/MP%20Startup%20for%20ARM%20platforms.docxSigned-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Tested-by: NLoc Ho <lho@apm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Hanjun Guo <hanjun.guo@linaro.org>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Al Stone <ahs3@redhat.com>
      [catalin.marinas@arm.com: Added WARN_ONCE(!acpi_parking_protocol_valid() on the IPI]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      5e89c55e
    • M
      arm64: unify idmap removal · 9e8e865b
      Mark Rutland 提交于
      We currently open-code the removal of the idmap and restoration of the
      current task's MMU state in a few places.
      
      Before introducing yet more copies of this sequence, unify these to call
      a new helper, cpu_uninstall_idmap.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Tested-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Tested-by: NJeremy Linton <jeremy.linton@arm.com>
      Cc: Laura Abbott <labbott@fedoraproject.org>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      9e8e865b
  8. 12 11月, 2015 1 次提交
  9. 21 10月, 2015 4 次提交
    • S
      arm64: Delay cpu feature capability checks · dbb4e152
      Suzuki K. Poulose 提交于
      At the moment we run through the arm64_features capability list for
      each CPU and set the capability if one of the CPU supports it. This
      could be problematic in a heterogeneous system with differing capabilities.
      Delay the CPU feature checks until all the enabled CPUs are up(i.e,
      smp_cpus_done(), so that we can make better decisions based on the
      overall system capability. Once we decide and advertise the capabilities
      the alternatives can be applied. From this state, we cannot roll back
      a feature to disabled based on the values from a new hotplugged CPU,
      due to the runtime patching and other reasons. So, for all new CPUs,
      we need to make sure that they have the established system capabilities.
      Failing which, we bring the CPU down, preventing it from turning online.
      Once the capabilities are decided, any new CPU booting up goes through
      verification to ensure that it has all the enabled capabilities and also
      invokes the respective enable() method on the CPU.
      
      The CPU errata checks are not delayed and is still executed per-CPU
      to detect the respective capabilities. If we ever come across a non-errata
      capability that needs to be checked on each-CPU, we could introduce them via
      a new capability table(or introduce a flag), which can be processed per CPU.
      
      The next patch will make the feature checks use the system wide
      safe value of a feature register.
      
      NOTE: The enable() methods associated with the capability is scheduled
      on all the CPUs (which is the only use case at the moment). If we need
      a different type of 'enable()' which only needs to be run once on any CPU,
      we should be able to handle that when needed.
      Signed-off-by: NSuzuki K. Poulose <suzuki.poulose@arm.com>
      Tested-by: NDave Martin <Dave.Martin@arm.com>
      [catalin.marinas@arm.com: static variable and coding style fixes]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      dbb4e152
    • S
      arm64: Delay cpuinfo_store_boot_cpu · 4b998ff1
      Suzuki K. Poulose 提交于
      At the moment the boot CPU stores the cpuinfo long before the
      PERCPU areas are initialised by the kernel. This could be problematic
      as the non-boot CPU data structures might get copied with the data
      from the boot CPU, giving us no chance to detect if a particular CPU
      updated its cpuinfo. This patch delays the boot cpu store to
      smp_prepare_boot_cpu().
      
      Also kills the setup_processor() which no longer does meaningful
      work.
      Signed-off-by: NSuzuki K. Poulose <suzuki.poulose@arm.com>
      Tested-by: NDave Martin <Dave.Martin@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      4b998ff1
    • S
      arm64: Delay ELF HWCAP initialisation until all CPUs are up · 3a75578e
      Suzuki K. Poulose 提交于
      Delay the ELF HWCAP initialisation until all the (enabled) CPUs are
      up, i.e, smp_cpus_done(). This is in preparation for detecting the
      common features across the CPUS and creating a consistent ELF HWCAP
      for the system.
      Signed-off-by: NSuzuki K. Poulose <suzuki.poulose@arm.com>
      Tested-by: NDave Martin <Dave.Martin@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      3a75578e
    • S
      arm64: Make the CPU information more clear · 64f17818
      Suzuki K. Poulose 提交于
      At early boot, we print the CPU version/revision. On a heterogeneous
      system, we could have different types of CPUs. Print the CPU info for
      all active cpus. Also, the secondary CPUs prints the message only when
      they turn online.
      
      Also, remove the redundant 'revision' information which doesn't
      make any sense without the 'variant' field.
      Signed-off-by: NSuzuki K. Poulose <suzuki.poulose@arm.com>
      Tested-by: NDave Martin <Dave.Martin@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      64f17818
  10. 10 10月, 2015 1 次提交
    • Y
      arm64: fix a migrating irq bug when hotplug cpu · 217d453d
      Yang Yingliang 提交于
      When cpu is disabled, all irqs will be migratged to another cpu.
      In some cases, a new affinity is different, the old affinity need
      to be updated and if irq_set_affinity's return value is IRQ_SET_MASK_OK_DONE,
      the old affinity can not be updated. Fix it by using irq_do_set_affinity.
      
      And migrating interrupts is a core code matter, so use the generic
      function irq_migrate_all_off_this_cpu() to migrate interrupts in
      kernel/irq/migration.c.
      
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
      Cc: Hanjun Guo <hanjun.guo@linaro.org>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      217d453d
  11. 07 10月, 2015 2 次提交
  12. 30 7月, 2015 1 次提交
  13. 07 7月, 2015 1 次提交
  14. 03 7月, 2015 1 次提交
    • H
      ARM64 / SMP: Switch pr_err() to pr_debug() for disabled GICC entry · f9058929
      Hanjun Guo 提交于
      It is normal that firmware presents GICC entry or entries (processors)
      with disabled flag in ACPI MADT, taking a system of 16 cpus for example,
      ACPI firmware may present 8 ebabled first with another 8 cpus disabled
      in MADT, the disabled cpus can be hot-added later.
      
      Firmware may also present more cpus than the hardware actually has, but
      disabled the unused ones, and easily enable it when the hardware has such
      cpus to make the firmware code scalable.
      
      So that's not an error for disabled cpus in MADT, we can switch pr_err()
      to pr_debug() to make the boot a little quieter by default.
      
      Since hwid for disabled cpus often are invalid, and we check invalid hwid
      first in the code, for use case that hot add cpus later will be filtered
      out and will not be counted in possible cups, so move this check before
      the hwid one to prepare the code to count for disabeld cpus when cpu
      hot-plug is introduced.
      Signed-off-by: NHanjun Guo <hanjun.guo@linaro.org>
      Reviewed-by: NAl Stone <ahs3@redhat.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      f9058929
  15. 25 6月, 2015 1 次提交
  16. 27 5月, 2015 1 次提交
  17. 21 5月, 2015 1 次提交
  18. 19 5月, 2015 2 次提交
    • L
      ARM64: kernel: unify ACPI and DT cpus initialization · 0f078336
      Lorenzo Pieralisi 提交于
      The code that initializes cpus on arm64 is currently split in two
      different code paths that carry out DT and ACPI cpus initialization.
      
      Most of the code executing SMP initialization is common and should
      be merged to reduce discrepancies between ACPI and DT initialization
      and to have code initializing cpus in a single common place in the
      kernel.
      
      This patch refactors arm64 SMP cpus initialization code to merge
      ACPI and DT boot paths in a common file and to create sanity
      checks that can be reused by both boot methods.
      
      Current code assumes PSCI is the only available boot method
      when arm64 boots with ACPI; this can be easily extended if/when
      the ACPI parking protocol is merged into the kernel.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NHanjun Guo <hanjun.guo@linaro.org>
      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>
      0f078336
    • 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
  19. 25 3月, 2015 1 次提交
  20. 23 3月, 2015 1 次提交
  21. 18 3月, 2015 1 次提交
  22. 05 3月, 2015 1 次提交
  23. 24 1月, 2015 1 次提交
  24. 04 12月, 2014 1 次提交
    • A
      arm64: add module support for alternatives fixups · 932ded4b
      Andre Przywara 提交于
      Currently the kernel patches all necessary instructions once at boot
      time, so modules are not covered by this.
      Change the apply_alternatives() function to take a beginning and an
      end pointer and introduce a new variant (apply_alternatives_all()) to
      cover the existing use case for the static kernel image section.
      Add a module_finalize() function to arm64 to check for an
      alternatives section in a module and patch only the instructions from
      that specific area.
      Since that module code is not touched before the module
      initialization has ended, we don't need to halt the machine before
      doing the patching in the module's code.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      932ded4b
  25. 25 11月, 2014 1 次提交
  26. 14 9月, 2014 1 次提交
  27. 08 8月, 2014 1 次提交
  28. 18 7月, 2014 1 次提交
  29. 17 5月, 2014 1 次提交
  30. 15 5月, 2014 1 次提交
  31. 04 3月, 2014 1 次提交
    • M
      arm64: topology: Implement basic CPU topology support · f6e763b9
      Mark Brown 提交于
      Add basic CPU topology support to arm64, based on the existing pre-v8
      code and some work done by Mark Hambleton.  This patch does not
      implement any topology discovery support since that should be based on
      information from firmware, it merely implements the scaffolding for
      integration of topology support in the architecture.
      
      No locking of the topology data is done since it is only modified during
      CPU bringup with external serialisation from the SMP code.
      
      The goal is to separate the architecture hookup for providing topology
      information from the DT parsing in order to ease review and avoid
      blocking the architecture code (which will be built on by other work)
      with the DT code review by providing something simple and basic.
      
      Following patches will implement support for interpreting topology
      information from MPIDR and for parsing the DT topology bindings for ARM,
      similar patches will be needed for ACPI.
      Signed-off-by: NMark Brown <broonie@linaro.org>
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      [catalin.marinas@arm.com: removed CONFIG_CPU_TOPOLOGY, always on if SMP]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      f6e763b9
  32. 26 2月, 2014 1 次提交