aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pptt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-08 12:54:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-08 12:54:55 -0400
commitdfd437a257924484b144ee750e60affc95562c6d (patch)
treed692781730ed72743b8abbc42a04a176cb2f1d6d /drivers/acpi/pptt.c
parent0ecfebd2b52404ae0c54a878c872bb93363ada36 (diff)
parent0c61efd322b75ed3143e3d130ebecbebf561adf5 (diff)
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 updates from Catalin Marinas: - arm64 support for syscall emulation via PTRACE_SYSEMU{,_SINGLESTEP} - Wire up VM_FLUSH_RESET_PERMS for arm64, allowing the core code to manage the permissions of executable vmalloc regions more strictly - Slight performance improvement by keeping softirqs enabled while touching the FPSIMD/SVE state (kernel_neon_begin/end) - Expose a couple of ARMv8.5 features to user (HWCAP): CondM (new XAFLAG and AXFLAG instructions for floating point comparison flags manipulation) and FRINT (rounding floating point numbers to integers) - Re-instate ARM64_PSEUDO_NMI support which was previously marked as BROKEN due to some bugs (now fixed) - Improve parking of stopped CPUs and implement an arm64-specific panic_smp_self_stop() to avoid warning on not being able to stop secondary CPUs during panic - perf: enable the ARM Statistical Profiling Extensions (SPE) on ACPI platforms - perf: DDR performance monitor support for iMX8QXP - cache_line_size() can now be set from DT or ACPI/PPTT if provided to cope with a system cache info not exposed via the CPUID registers - Avoid warning on hardware cache line size greater than ARCH_DMA_MINALIGN if the system is fully coherent - arm64 do_page_fault() and hugetlb cleanups - Refactor set_pte_at() to avoid redundant READ_ONCE(*ptep) - Ignore ACPI 5.1 FADTs reported as 5.0 (infer from the 'arm_boot_flags' introduced in 5.1) - CONFIG_RANDOMIZE_BASE now enabled in defconfig - Allow the selection of ARM64_MODULE_PLTS, currently only done via RANDOMIZE_BASE (and an erratum workaround), allowing modules to spill over into the vmalloc area - Make ZONE_DMA32 configurable * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (54 commits) perf: arm_spe: Enable ACPI/Platform automatic module loading arm_pmu: acpi: spe: Add initial MADT/SPE probing ACPI/PPTT: Add function to return ACPI 6.3 Identical tokens ACPI/PPTT: Modify node flag detection to find last IDENTICAL x86/entry: Simplify _TIF_SYSCALL_EMU handling arm64: rename dump_instr as dump_kernel_instr arm64/mm: Drop [PTE|PMD]_TYPE_FAULT arm64: Implement panic_smp_self_stop() arm64: Improve parking of stopped CPUs arm64: Expose FRINT capabilities to userspace arm64: Expose ARMv8.5 CondM capability to userspace arm64: defconfig: enable CONFIG_RANDOMIZE_BASE arm64: ARM64_MODULES_PLTS must depend on MODULES arm64: bpf: do not allocate executable memory arm64/kprobes: set VM_FLUSH_RESET_PERMS on kprobe instruction pages arm64/mm: wire up CONFIG_ARCH_HAS_SET_DIRECT_MAP arm64: module: create module allocations without exec permissions arm64: Allow user selection of ARM64_MODULE_PLTS acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 arm64: Allow selecting Pseudo-NMI again ...
Diffstat (limited to 'drivers/acpi/pptt.c')
-rw-r--r--drivers/acpi/pptt.c61
1 files changed, 55 insertions, 6 deletions
diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
index b72e6afaa8fb..1e7ac0bd0d3a 100644
--- a/drivers/acpi/pptt.c
+++ b/drivers/acpi/pptt.c
@@ -432,17 +432,40 @@ static void cache_setup_acpi_cpu(struct acpi_table_header *table,
432 } 432 }
433} 433}
434 434
435static bool flag_identical(struct acpi_table_header *table_hdr,
436 struct acpi_pptt_processor *cpu)
437{
438 struct acpi_pptt_processor *next;
439
440 /* heterogeneous machines must use PPTT revision > 1 */
441 if (table_hdr->revision < 2)
442 return false;
443
444 /* Locate the last node in the tree with IDENTICAL set */
445 if (cpu->flags & ACPI_PPTT_ACPI_IDENTICAL) {
446 next = fetch_pptt_node(table_hdr, cpu->parent);
447 if (!(next && next->flags & ACPI_PPTT_ACPI_IDENTICAL))
448 return true;
449 }
450
451 return false;
452}
453
435/* Passing level values greater than this will result in search termination */ 454/* Passing level values greater than this will result in search termination */
436#define PPTT_ABORT_PACKAGE 0xFF 455#define PPTT_ABORT_PACKAGE 0xFF
437 456
438static struct acpi_pptt_processor *acpi_find_processor_package_id(struct acpi_table_header *table_hdr, 457static struct acpi_pptt_processor *acpi_find_processor_tag(struct acpi_table_header *table_hdr,
439 struct acpi_pptt_processor *cpu, 458 struct acpi_pptt_processor *cpu,
440 int level, int flag) 459 int level, int flag)
441{ 460{
442 struct acpi_pptt_processor *prev_node; 461 struct acpi_pptt_processor *prev_node;
443 462
444 while (cpu && level) { 463 while (cpu && level) {
445 if (cpu->flags & flag) 464 /* special case the identical flag to find last identical */
465 if (flag == ACPI_PPTT_ACPI_IDENTICAL) {
466 if (flag_identical(table_hdr, cpu))
467 break;
468 } else if (cpu->flags & flag)
446 break; 469 break;
447 pr_debug("level %d\n", level); 470 pr_debug("level %d\n", level);
448 prev_node = fetch_pptt_node(table_hdr, cpu->parent); 471 prev_node = fetch_pptt_node(table_hdr, cpu->parent);
@@ -480,8 +503,8 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
480 503
481 cpu_node = acpi_find_processor_node(table, acpi_cpu_id); 504 cpu_node = acpi_find_processor_node(table, acpi_cpu_id);
482 if (cpu_node) { 505 if (cpu_node) {
483 cpu_node = acpi_find_processor_package_id(table, cpu_node, 506 cpu_node = acpi_find_processor_tag(table, cpu_node,
484 level, flag); 507 level, flag);
485 /* 508 /*
486 * As per specification if the processor structure represents 509 * As per specification if the processor structure represents
487 * an actual processor, then ACPI processor ID must be valid. 510 * an actual processor, then ACPI processor ID must be valid.
@@ -660,3 +683,29 @@ int find_acpi_cpu_topology_package(unsigned int cpu)
660 return find_acpi_cpu_topology_tag(cpu, PPTT_ABORT_PACKAGE, 683 return find_acpi_cpu_topology_tag(cpu, PPTT_ABORT_PACKAGE,
661 ACPI_PPTT_PHYSICAL_PACKAGE); 684 ACPI_PPTT_PHYSICAL_PACKAGE);
662} 685}
686
687/**
688 * find_acpi_cpu_topology_hetero_id() - Get a core architecture tag
689 * @cpu: Kernel logical CPU number
690 *
691 * Determine a unique heterogeneous tag for the given CPU. CPUs with the same
692 * implementation should have matching tags.
693 *
694 * The returned tag can be used to group peers with identical implementation.
695 *
696 * The search terminates when a level is found with the identical implementation
697 * flag set or we reach a root node.
698 *
699 * Due to limitations in the PPTT data structure, there may be rare situations
700 * where two cores in a heterogeneous machine may be identical, but won't have
701 * the same tag.
702 *
703 * Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found.
704 * Otherwise returns a value which represents a group of identical cores
705 * similar to this CPU.
706 */
707int find_acpi_cpu_topology_hetero_id(unsigned int cpu)
708{
709 return find_acpi_cpu_topology_tag(cpu, PPTT_ABORT_PACKAGE,
710 ACPI_PPTT_ACPI_IDENTICAL);
711}