1. 29 6月, 2020 1 次提交
  2. 23 7月, 2018 1 次提交
    • A
      arm64: acpi: fix alignment fault in accessing ACPI · 09ffcb0d
      AKASHI Takahiro 提交于
      This is a fix against the issue that crash dump kernel may hang up
      during booting, which can happen on any ACPI-based system with "ACPI
      Reclaim Memory."
      
      (kernel messages after panic kicked off kdump)
      	   (snip...)
      	Bye!
      	   (snip...)
      	ACPI: Core revision 20170728
      	pud=000000002e7d0003, *pmd=000000002e7c0003, *pte=00e8000039710707
      	Internal error: Oops: 96000021 [#1] SMP
      	Modules linked in:
      	CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.0-rc6 #1
      	task: ffff000008d05180 task.stack: ffff000008cc0000
      	PC is at acpi_ns_lookup+0x25c/0x3c0
      	LR is at acpi_ds_load1_begin_op+0xa4/0x294
      	   (snip...)
      	Process swapper/0 (pid: 0, stack limit = 0xffff000008cc0000)
      	Call trace:
      	   (snip...)
      	[<ffff0000084a6764>] acpi_ns_lookup+0x25c/0x3c0
      	[<ffff00000849b4f8>] acpi_ds_load1_begin_op+0xa4/0x294
      	[<ffff0000084ad4ac>] acpi_ps_build_named_op+0xc4/0x198
      	[<ffff0000084ad6cc>] acpi_ps_create_op+0x14c/0x270
      	[<ffff0000084acfa8>] acpi_ps_parse_loop+0x188/0x5c8
      	[<ffff0000084ae048>] acpi_ps_parse_aml+0xb0/0x2b8
      	[<ffff0000084a8e10>] acpi_ns_one_complete_parse+0x144/0x184
      	[<ffff0000084a8e98>] acpi_ns_parse_table+0x48/0x68
      	[<ffff0000084a82cc>] acpi_ns_load_table+0x4c/0xdc
      	[<ffff0000084b32f8>] acpi_tb_load_namespace+0xe4/0x264
      	[<ffff000008baf9b4>] acpi_load_tables+0x48/0xc0
      	[<ffff000008badc20>] acpi_early_init+0x9c/0xd0
      	[<ffff000008b70d50>] start_kernel+0x3b4/0x43c
      	Code: b9008fb9 2a000318 36380054 32190318 (b94002c0)
      	---[ end trace c46ed37f9651c58e ]---
      	Kernel panic - not syncing: Fatal exception
      	Rebooting in 10 seconds..
      
      (diagnosis)
      * This fault is a data abort, alignment fault (ESR=0x96000021)
        during reading out ACPI table.
      * Initial ACPI tables are normally stored in system ram and marked as
        "ACPI Reclaim memory" by the firmware.
      * After the commit f56ab9a5 ("efi/arm: Don't mark ACPI reclaim
        memory as MEMBLOCK_NOMAP"), those regions are differently handled
        as they are "memblock-reserved", without NOMAP bit.
      * So they are now excluded from device tree's "usable-memory-range"
        which kexec-tools determines based on a current view of /proc/iomem.
      * When crash dump kernel boots up, it tries to accesses ACPI tables by
        mapping them with ioremap(), not ioremap_cache(), in acpi_os_ioremap()
        since they are no longer part of mapped system ram.
      * Given that ACPI accessor/helper functions are compiled in without
        unaligned access support (ACPI_MISALIGNMENT_NOT_SUPPORTED),
        any unaligned access to ACPI tables can cause a fatal panic.
      
      With this patch, acpi_os_ioremap() always honors memory attribute
      information provided by the firmware (EFI) and retaining cacheability
      allows the kernel safe access to ACPI tables.
      Signed-off-by: NAKASHI Takahiro <takahiro.akashi@linaro.org>
      Reviewed-by: NJames Morse <james.morse@arm.com>
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reported-by and Tested-by: Bhupesh Sharma <bhsharma@redhat.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      09ffcb0d
  3. 10 7月, 2018 1 次提交
    • L
      arm64: numa: rework ACPI NUMA initialization · e1896249
      Lorenzo Pieralisi 提交于
      Current ACPI ARM64 NUMA initialization code in
      
      acpi_numa_gicc_affinity_init()
      
      carries out NUMA nodes creation and cpu<->node mappings at the same time
      in the arch backend so that a single SRAT walk is needed to parse both
      pieces of information.  This implies that the cpu<->node mappings must
      be stashed in an array (sized NR_CPUS) so that SMP code can later use
      the stashed values to avoid another SRAT table walk to set-up the early
      cpu<->node mappings.
      
      If the kernel is configured with a NR_CPUS value less than the actual
      processor entries in the SRAT (and MADT), the logic in
      acpi_numa_gicc_affinity_init() is broken in that the cpu<->node mapping
      is only carried out (and stashed for future use) only for a number of
      SRAT entries up to NR_CPUS, which do not necessarily correspond to the
      possible cpus detected at SMP initialization in
      acpi_map_gic_cpu_interface() (ie MADT and SRAT processor entries order
      is not enforced), which leaves the kernel with broken cpu<->node
      mappings.
      
      Furthermore, given the current ACPI NUMA code parsing logic in
      acpi_numa_gicc_affinity_init(), PXM domains for CPUs that are not parsed
      because they exceed NR_CPUS entries are not mapped to NUMA nodes (ie the
      PXM corresponding node is not created in the kernel) leaving the system
      with a broken NUMA topology.
      
      Rework the ACPI ARM64 NUMA initialization process so that the NUMA
      nodes creation and cpu<->node mappings are decoupled. cpu<->node
      mappings are moved to SMP initialization code (where they are needed),
      at the cost of an extra SRAT walk so that ACPI NUMA mappings can be
      batched before being applied, fixing current parsing pitfalls.
      Acked-by: NHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: NJohn Garry <john.garry@huawei.com>
      Fixes: d8b47fca ("arm64, ACPI, NUMA: NUMA support based on SRAT and
      SLIT")
      Link: http://lkml.kernel.org/r/1527768879-88161-2-git-send-email-xiexiuqi@huawei.comReported-by: NXie XiuQi <xiexiuqi@huawei.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Punit Agrawal <punit.agrawal@arm.com>
      Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Hanjun Guo <guohanjun@huawei.com>
      Cc: Ganapatrao Kulkarni <gkulkarni@caviumnetworks.com>
      Cc: Jeremy Linton <jeremy.linton@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Xie XiuQi <xiexiuqi@huawei.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      e1896249
  4. 18 5月, 2018 1 次提交
  5. 07 11月, 2017 1 次提交
  6. 02 6月, 2017 1 次提交
    • L
      ARM64/ACPI: Fix BAD_MADT_GICC_ENTRY() macro implementation · cb7cf772
      Lorenzo Pieralisi 提交于
      The BAD_MADT_GICC_ENTRY() macro checks if a GICC MADT entry passes
      muster from an ACPI specification standpoint. Current macro detects the
      MADT GICC entry length through ACPI firmware version (it changed from 76
      to 80 bytes in the transition from ACPI 5.1 to ACPI 6.0 specification)
      but always uses (erroneously) the ACPICA (latest) struct (ie struct
      acpi_madt_generic_interrupt - that is 80-bytes long) length to check if
      the current GICC entry memory record exceeds the MADT table end in
      memory as defined by the MADT table header itself, which may result in
      false negatives depending on the ACPI firmware version and how the MADT
      entries are laid out in memory (ie on ACPI 5.1 firmware MADT GICC
      entries are 76 bytes long, so by adding 80 to a GICC entry start address
      in memory the resulting address may well be past the actual MADT end,
      triggering a false negative).
      
      Fix the BAD_MADT_GICC_ENTRY() macro by reshuffling the condition checks
      and update them to always use the firmware version specific MADT GICC
      entry length in order to carry out boundary checks.
      
      Fixes: b6cfb277 ("ACPI / ARM64: add BAD_MADT_GICC_ENTRY() macro")
      Reported-by: NJulien Grall <julien.grall@arm.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Julien Grall <julien.grall@arm.com>
      Cc: Hanjun Guo <hanjun.guo@linaro.org>
      Cc: Al Stone <ahs3@redhat.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      cb7cf772
  7. 11 4月, 2017 1 次提交
    • M
      arm64: add function to get a cpu's MADT GICC table · e0013aed
      Mark Rutland 提交于
      Currently the ACPI parking protocol code needs to parse each CPU's MADT
      GICC table to extract the mailbox address and so on. Each time we parse
      a GICC table, we call back to the parking protocol code to parse it.
      
      This has been fine so far, but we're about to have more code that needs
      to extract data from the GICC tables, and adding a callback for each
      user is going to get unwieldy.
      
      Instead, this patch ensures that we stash a copy of each CPU's GICC
      table at boot time, such that anything needing to parse it can later
      request it. This will allow for other parsers of GICC, and for
      simplification to the ACPI parking protocol code. Note that we must
      store a copy, rather than a pointer, since the core ACPI code
      temporarily maps/unmaps tables while iterating over them.
      
      Since we parse the MADT before we know how many CPUs we have (and hence
      before we setup the percpu areas), we must use an NR_CPUS sized array.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Reviewed-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Tested-by: NJeremy Linton <jeremy.linton@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      e0013aed
  8. 21 12月, 2016 1 次提交
  9. 02 12月, 2016 1 次提交
  10. 26 8月, 2016 1 次提交
  11. 22 6月, 2016 1 次提交
    • J
      ACPI: ARM64: support for ACPI_TABLE_UPGRADE · 38b04a74
      Jon Masters 提交于
      This patch adds support for ACPI_TABLE_UPGRADE for ARM64
      
      To access initrd image we need to move initialization
      of linear mapping a bit earlier.
      
      The implementation of the feature acpi_table_upgrade()
      (drivers/acpi/tables.c) works with initrd data represented as an array
      in virtual memory.  It uses some library utility to find the redefined
      tables in that array and iterates over it to copy the data to new
      allocated memory.  So to access the initrd data via fixmap
      we need to rewrite it considerably.
      
      In x86 arch, kernel memory is already mapped by the time when
      acpi_table_upgrade() and acpi_boot_table_init() are called so I
      think that we can just move this mapping one function earlier too.
      Signed-off-by: NJon Masters <jcm@redhat.com>
      Signed-off-by: NAleksey Makarov <aleksey.makarov@linaro.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      38b04a74
  12. 30 5月, 2016 1 次提交
  13. 16 2月, 2016 1 次提交
    • 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
  14. 01 10月, 2015 1 次提交
  15. 14 9月, 2015 1 次提交
  16. 03 8月, 2015 1 次提交
  17. 07 7月, 2015 1 次提交
    • A
      ACPI / ARM64: add BAD_MADT_GICC_ENTRY() macro · b6cfb277
      Al Stone 提交于
      The BAD_MADT_ENTRY() macro is designed to work for all of the subtables
      of the MADT.  In the ACPI 5.1 version of the spec, the struct for the
      GICC subtable (struct acpi_madt_generic_interrupt) is 76 bytes long; in
      ACPI 6.0, the struct is 80 bytes long.  But, there is only one definition
      in ACPICA for this struct -- and that is the 6.0 version.  Hence, when
      BAD_MADT_ENTRY() compares the struct size to the length in the GICC
      subtable, it fails if 5.1 structs are in use, and there are systems in
      the wild that have them.
      
      This patch adds the BAD_MADT_GICC_ENTRY() that checks the GICC subtable
      only, accounting for the difference in specification versions that are
      possible.  The BAD_MADT_ENTRY() will continue to work as is for all other
      MADT subtables.
      
      This code is being added to an arm64 header file since that is currently
      the only architecture using the GICC subtable of the MADT.  As a GIC is
      specific to ARM, it is also unlikely the subtable will be used elsewhere.
      
      Fixes: aeb823bb ("ACPICA: ACPI 6.0: Add changes for FADT table.")
      Signed-off-by: NAl Stone <al.stone@linaro.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: N"Rafael J. Wysocki" <rjw@rjwysocki.net>
      [catalin.marinas@arm.com: extra brackets around macro arguments]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      b6cfb277
  18. 27 5月, 2015 1 次提交
    • M
      arm64: psci: remove ACPI coupling · c5a13305
      Mark Rutland 提交于
      The 32-bit ARM port doesn't have ACPI headers, and conditionally
      including them is going to look horrendous. In preparation for sharing
      the PSCI invocation code with 32-bit, move the acpi_psci_* function
      declarations and definitions such that the PSCI client code need not
      include ACPI headers.
      
      While it would seem like we could simply hide the ACPI includes in
      psci.h, the ACPI headers have hilarious circular dependencies which make
      this infeasible without reorganising most of ACPICA. So rather than
      doing that, move the acpi_psci_* prototypes into psci.h.
      
      The psci_acpi_init function is made dependent on CONFIG_ACPI (with a
      stub implementation in asm/psci.h) such that it need not be built for
      32-bit ARM or kernels without ACPI support. The currently missing __init
      annotations are added to the prototypes in the header.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NHanjun Guo <hanjun.guo@linaro.org>
      Reviewed-by: NAl Stone <al.stone@linaro.org>
      Reviewed-by: NAshwin Chaugule <ashwin.chaugule@linaro.org>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      c5a13305
  19. 19 5月, 2015 1 次提交
  20. 26 3月, 2015 4 次提交
  21. 25 3月, 2015 5 次提交