Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
"An initrd microcode loading fix, and an SMP bootup topology setup fix
to resolve crashes on SGI/UV systems if the BIOS is configured in a
certain way"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/smp: Fix __max_logical_packages value setup
x86/microcode/AMD: Fix initrd loading with CONFIG_RANDOMIZE_MEMORY=y

+24 -10
+8 -1
arch/x86/kernel/cpu/microcode/amd.c
··· 355 355 unsigned int cpu = smp_processor_id(); 356 356 struct equiv_cpu_entry *eq; 357 357 struct microcode_amd *mc; 358 + u8 *cont = container; 358 359 u32 rev, eax; 359 360 u16 eq_id; 360 361 ··· 372 371 if (check_current_patch_level(&rev, false)) 373 372 return; 374 373 374 + /* Add CONFIG_RANDOMIZE_MEMORY offset. */ 375 + cont += PAGE_OFFSET - __PAGE_OFFSET_BASE; 376 + 375 377 eax = cpuid_eax(0x00000001); 376 - eq = (struct equiv_cpu_entry *)(container + CONTAINER_HDR_SZ); 378 + eq = (struct equiv_cpu_entry *)(cont + CONTAINER_HDR_SZ); 377 379 378 380 eq_id = find_equiv_id(eq, eax); 379 381 if (!eq_id) ··· 437 433 (cont - boot_params.hdr.ramdisk_image)); 438 434 else 439 435 container = cont_va; 436 + 437 + /* Add CONFIG_RANDOMIZE_MEMORY offset. */ 438 + container += PAGE_OFFSET - __PAGE_OFFSET_BASE; 440 439 441 440 eax = cpuid_eax(0x00000001); 442 441 eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
+16 -9
arch/x86/kernel/smpboot.c
··· 100 100 /* Logical package management. We might want to allocate that dynamically */ 101 101 static int *physical_to_logical_pkg __read_mostly; 102 102 static unsigned long *physical_package_map __read_mostly;; 103 - static unsigned long *logical_package_map __read_mostly; 104 103 static unsigned int max_physical_pkg_id __read_mostly; 105 104 unsigned int __max_logical_packages __read_mostly; 106 105 EXPORT_SYMBOL(__max_logical_packages); 106 + static unsigned int logical_packages __read_mostly; 107 + static bool logical_packages_frozen __read_mostly; 107 108 108 109 /* Maximum number of SMT threads on any online core */ 109 110 int __max_smt_threads __read_mostly; ··· 278 277 if (test_and_set_bit(pkg, physical_package_map)) 279 278 goto found; 280 279 281 - new = find_first_zero_bit(logical_package_map, __max_logical_packages); 282 - if (new >= __max_logical_packages) { 280 + if (logical_packages_frozen) { 283 281 physical_to_logical_pkg[pkg] = -1; 284 - pr_warn("APIC(%x) Package %u exceeds logical package map\n", 282 + pr_warn("APIC(%x) Package %u exceeds logical package max\n", 285 283 apicid, pkg); 286 284 return -ENOSPC; 287 285 } 288 - set_bit(new, logical_package_map); 286 + 287 + new = logical_packages++; 289 288 pr_info("APIC(%x) Converting physical %u to logical package %u\n", 290 289 apicid, pkg, new); 291 290 physical_to_logical_pkg[pkg] = new; ··· 342 341 } 343 342 344 343 __max_logical_packages = DIV_ROUND_UP(total_cpus, ncpus); 344 + logical_packages = 0; 345 345 346 346 /* 347 347 * Possibly larger than what we need as the number of apic ids per ··· 354 352 memset(physical_to_logical_pkg, 0xff, size); 355 353 size = BITS_TO_LONGS(max_physical_pkg_id) * sizeof(unsigned long); 356 354 physical_package_map = kzalloc(size, GFP_KERNEL); 357 - size = BITS_TO_LONGS(__max_logical_packages) * sizeof(unsigned long); 358 - logical_package_map = kzalloc(size, GFP_KERNEL); 359 - 360 - pr_info("Max logical packages: %u\n", __max_logical_packages); 361 355 362 356 for_each_present_cpu(cpu) { 363 357 unsigned int apicid = apic->cpu_present_to_apicid(cpu); ··· 367 369 set_cpu_possible(cpu, false); 368 370 set_cpu_present(cpu, false); 369 371 } 372 + 373 + if (logical_packages > __max_logical_packages) { 374 + pr_warn("Detected more packages (%u), then computed by BIOS data (%u).\n", 375 + logical_packages, __max_logical_packages); 376 + logical_packages_frozen = true; 377 + __max_logical_packages = logical_packages; 378 + } 379 + 380 + pr_info("Max logical packages: %u\n", __max_logical_packages); 370 381 } 371 382 372 383 void __init smp_store_boot_cpu_info(void)