@@ -459,11 +459,14 @@ static void cache_setup_acpi_cpu(struct acpi_table_header *table,
459459{
460460 struct acpi_pptt_cache * found_cache ;
461461 struct cpu_cacheinfo * this_cpu_ci = get_cpu_cacheinfo (cpu );
462- u32 acpi_cpu_id = get_acpi_id_for_cpu ( cpu ) ;
462+ u32 acpi_cpu_id ;
463463 struct cacheinfo * this_leaf ;
464464 unsigned int index = 0 ;
465465 struct acpi_pptt_processor * cpu_node = NULL ;
466466
467+ if (acpi_get_cpu_uid (cpu , & acpi_cpu_id ) != 0 )
468+ return ;
469+
467470 while (index < get_cpu_cacheinfo (cpu )-> num_leaves ) {
468471 this_leaf = this_cpu_ci -> info_list + index ;
469472 found_cache = acpi_find_cache_node (table , acpi_cpu_id ,
@@ -546,7 +549,10 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
546549 unsigned int cpu , int level , int flag )
547550{
548551 struct acpi_pptt_processor * cpu_node ;
549- u32 acpi_cpu_id = get_acpi_id_for_cpu (cpu );
552+ u32 acpi_cpu_id ;
553+
554+ if (acpi_get_cpu_uid (cpu , & acpi_cpu_id ) != 0 )
555+ return - ENOENT ;
550556
551557 cpu_node = acpi_find_processor_node (table , acpi_cpu_id );
552558 if (cpu_node ) {
@@ -614,18 +620,22 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag)
614620 *
615621 * Check the node representing a CPU for a given flag.
616622 *
617- * Return: -ENOENT if the PPTT doesn't exist, the CPU cannot be found or
618- * the table revision isn't new enough.
623+ * Return: -ENOENT if can't get CPU's ACPI Processor UID, the PPTT doesn't
624+ * exist, the CPU cannot be found or the table revision isn't new
625+ * enough.
619626 * 1, any passed flag set
620627 * 0, flag unset
621628 */
622629static int check_acpi_cpu_flag (unsigned int cpu , int rev , u32 flag )
623630{
624631 struct acpi_table_header * table ;
625- u32 acpi_cpu_id = get_acpi_id_for_cpu ( cpu ) ;
632+ u32 acpi_cpu_id ;
626633 struct acpi_pptt_processor * cpu_node = NULL ;
627634 int ret = - ENOENT ;
628635
636+ if (acpi_get_cpu_uid (cpu , & acpi_cpu_id ) != 0 )
637+ return - ENOENT ;
638+
629639 table = acpi_get_pptt ();
630640 if (!table )
631641 return - ENOENT ;
@@ -651,7 +661,8 @@ static int check_acpi_cpu_flag(unsigned int cpu, int rev, u32 flag)
651661 * in the PPTT. Errors caused by lack of a PPTT table, or otherwise, return 0
652662 * indicating we didn't find any cache levels.
653663 *
654- * Return: -ENOENT if no PPTT table or no PPTT processor struct found.
664+ * Return: -ENOENT if no PPTT table, can't get CPU's ACPI Process UID or no PPTT
665+ * processor struct found.
655666 * 0 on success.
656667 */
657668int acpi_get_cache_info (unsigned int cpu , unsigned int * levels ,
@@ -671,7 +682,9 @@ int acpi_get_cache_info(unsigned int cpu, unsigned int *levels,
671682
672683 pr_debug ("Cache Setup: find cache levels for CPU=%d\n" , cpu );
673684
674- acpi_cpu_id = get_acpi_id_for_cpu (cpu );
685+ if (acpi_get_cpu_uid (cpu , & acpi_cpu_id ))
686+ return - ENOENT ;
687+
675688 cpu_node = acpi_find_processor_node (table , acpi_cpu_id );
676689 if (!cpu_node )
677690 return - ENOENT ;
@@ -780,8 +793,9 @@ int find_acpi_cpu_topology_package(unsigned int cpu)
780793 * It may not exist in single CPU systems. In simple multi-CPU systems,
781794 * it may be equal to the package topology level.
782795 *
783- * Return: -ENOENT if the PPTT doesn't exist, the CPU cannot be found
784- * or there is no toplogy level above the CPU..
796+ * Return: -ENOENT if the PPTT doesn't exist, can't get CPU's ACPI
797+ * Processor UID, the CPU cannot be found or there is no toplogy level
798+ * above the CPU.
785799 * Otherwise returns a value which represents the package for this CPU.
786800 */
787801
@@ -797,7 +811,9 @@ int find_acpi_cpu_topology_cluster(unsigned int cpu)
797811 if (!table )
798812 return - ENOENT ;
799813
800- acpi_cpu_id = get_acpi_id_for_cpu (cpu );
814+ if (acpi_get_cpu_uid (cpu , & acpi_cpu_id ) != 0 )
815+ return - ENOENT ;
816+
801817 cpu_node = acpi_find_processor_node (table , acpi_cpu_id );
802818 if (!cpu_node || !cpu_node -> parent )
803819 return - ENOENT ;
@@ -872,7 +888,9 @@ static void acpi_pptt_get_child_cpus(struct acpi_table_header *table_hdr,
872888 cpumask_clear (cpus );
873889
874890 for_each_possible_cpu (cpu ) {
875- acpi_id = get_acpi_id_for_cpu (cpu );
891+ if (acpi_get_cpu_uid (cpu , & acpi_id ) != 0 )
892+ continue ;
893+
876894 cpu_node = acpi_find_processor_node (table_hdr , acpi_id );
877895
878896 while (cpu_node ) {
@@ -966,10 +984,13 @@ int find_acpi_cache_level_from_id(u32 cache_id)
966984 for_each_possible_cpu (cpu ) {
967985 bool empty ;
968986 int level = 1 ;
969- u32 acpi_cpu_id = get_acpi_id_for_cpu ( cpu ) ;
987+ u32 acpi_cpu_id ;
970988 struct acpi_pptt_cache * cache ;
971989 struct acpi_pptt_processor * cpu_node ;
972990
991+ if (acpi_get_cpu_uid (cpu , & acpi_cpu_id ) != 0 )
992+ continue ;
993+
973994 cpu_node = acpi_find_processor_node (table , acpi_cpu_id );
974995 if (!cpu_node )
975996 continue ;
@@ -1030,10 +1051,13 @@ int acpi_pptt_get_cpumask_from_cache_id(u32 cache_id, cpumask_t *cpus)
10301051 for_each_possible_cpu (cpu ) {
10311052 bool empty ;
10321053 int level = 1 ;
1033- u32 acpi_cpu_id = get_acpi_id_for_cpu ( cpu ) ;
1054+ u32 acpi_cpu_id ;
10341055 struct acpi_pptt_cache * cache ;
10351056 struct acpi_pptt_processor * cpu_node ;
10361057
1058+ if (acpi_get_cpu_uid (cpu , & acpi_cpu_id ) != 0 )
1059+ continue ;
1060+
10371061 cpu_node = acpi_find_processor_node (table , acpi_cpu_id );
10381062 if (!cpu_node )
10391063 continue ;
0 commit comments