srat.c (b6715dab8fff7e4869777a68db83c26c2bf841fd) srat.c (ab3059a8e7f382cff93dbe4d1b082adf62f4d849)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2010 Hudson River Trading LLC
5 * Written by: John H. Baldwin <jhb@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 518 unchanged lines hidden (view full) ---

527 if (CPU_ABSENT(i))
528 continue;
529 pc = pcpu_find(i);
530 KASSERT(pc != NULL, ("no pcpu data for CPU %u", i));
531 cpu = &cpus[pc->pc_apic_id];
532 if (!cpu->enabled)
533 panic("SRAT: CPU with APIC ID %u is not known",
534 pc->pc_apic_id);
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2010 Hudson River Trading LLC
5 * Written by: John H. Baldwin <jhb@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 518 unchanged lines hidden (view full) ---

527 if (CPU_ABSENT(i))
528 continue;
529 pc = pcpu_find(i);
530 KASSERT(pc != NULL, ("no pcpu data for CPU %u", i));
531 cpu = &cpus[pc->pc_apic_id];
532 if (!cpu->enabled)
533 panic("SRAT: CPU with APIC ID %u is not known",
534 pc->pc_apic_id);
535#ifdef NUMA
535 pc->pc_domain = cpu->domain;
536 pc->pc_domain = cpu->domain;
536 CPU_SET(i, &cpuset_domain[cpu->domain]);
537#else
538 pc->pc_domain = 0;
539#endif
540 CPU_SET(i, &cpuset_domain[pc->pc_domain]);
537 if (bootverbose)
538 printf("SRAT: CPU %u has memory domain %d\n", i,
541 if (bootverbose)
542 printf("SRAT: CPU %u has memory domain %d\n", i,
539 cpu->domain);
543 pc->pc_domain);
540 }
541
542 /* Last usage of the cpus array, unmap it. */
543 pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * (max_apic_id + 1));
544 cpus = NULL;
545}
546SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL);
547

--- 28 unchanged lines hidden ---
544 }
545
546 /* Last usage of the cpus array, unmap it. */
547 pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * (max_apic_id + 1));
548 cpus = NULL;
549}
550SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL);
551

--- 28 unchanged lines hidden ---