@@ -2042,31 +2042,21 @@ void __init setup_virt_paging(void)
[7] = { 0 } /* Invalid */
};
- unsigned int i, cpu;
+ unsigned int i;
unsigned int pa_range = 0x10; /* Larger than any possible value */
- bool vmid_8_bit = false;
-
- for_each_online_cpu ( cpu )
- {
- const struct cpuinfo_arm *info = &cpu_data[cpu];
- /*
- * Restrict "p2m_ipa_bits" if needed. As P2M table is always configured
- * with IPA bits == PA bits, compare against "pabits".
- */
- if ( pa_range_info[info->mm64.pa_range].pabits < p2m_ipa_bits )
- p2m_ipa_bits = pa_range_info[info->mm64.pa_range].pabits;
-
- /* Set a flag if the current cpu does not support 16 bit VMIDs. */
- if ( info->mm64.vmid_bits != MM64_VMID_16_BITS_SUPPORT )
- vmid_8_bit = true;
- }
+ /*
+ * Restrict "p2m_ipa_bits" if needed. As P2M table is always configured
+ * with IPA bits == PA bits, compare against "pabits".
+ */
+ if ( pa_range_info[system_cpuinfo.mm64.pa_range].pabits < p2m_ipa_bits )
+ p2m_ipa_bits = pa_range_info[system_cpuinfo.mm64.pa_range].pabits;
/*
- * If the flag is not set then it means all CPUs support 16-bit
- * VMIDs.
+ * cpu info sanitization made sure we support 16bits VMID only if all
+ * cores are supporting it.
*/
- if ( !vmid_8_bit )
+ if ( system_cpuinfo.mm64.vmid_bits == MM64_VMID_16_BITS_SUPPORT )
max_vmid = MAX_VMID_16_BIT;
/* Choose suitable "pa_range" according to the resulted "p2m_ipa_bits". */