Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
7d04aec
hwmon: (fam15h_power) Use topology_core_id()
KAGA-KOKO Aug 14, 2023
e28484f
x86/cpu: Move cpu_core_id into topology info
KAGA-KOKO Aug 14, 2023
234b9f4
x86/cpu: Move cu_id into topology info
KAGA-KOKO Aug 14, 2023
426bae9
x86/cpu: Remove pointless evaluation of x86_coreid_bits
KAGA-KOKO Aug 14, 2023
5a7a9f0
x86/cpu: Move logical package and die IDs into topology info
KAGA-KOKO Aug 14, 2023
67b9a75
x86/cpu: Move cpu_l[l2]c_id into topology info
KAGA-KOKO Aug 14, 2023
349c3e9
x86/apic: Use BAD_APICID consistently
KAGA-KOKO Aug 14, 2023
9e98b59
x86/apic: Use u32 for APIC IDs in global data
KAGA-KOKO Aug 14, 2023
44ba40b
x86/apic: Use u32 for check_apicid_used()
KAGA-KOKO Aug 14, 2023
e29b3e1
x86/apic: Use u32 for cpu_present_to_apicid()
KAGA-KOKO Aug 14, 2023
4eca1b0
x86/apic: Use u32 for phys_pkg_id()
KAGA-KOKO Aug 14, 2023
655645a
x86/apic: Use u32 for [gs]et_apic_id()
KAGA-KOKO Aug 14, 2023
c139358
x86/apic, x86/hyperv: Use u32 in hv_snp_boot_ap() too
Oct 13, 2023
537ea55
x86/apic: Use u32 for wakeup_secondary_cpu[_64]()
KAGA-KOKO Aug 14, 2023
eaa55af
x86/cpu/topology: Cure the abuse of cpuinfo for persisting logical ids
KAGA-KOKO Aug 14, 2023
d67fe5c
x86/cpu: Provide debug interface
KAGA-KOKO Aug 14, 2023
fc47edb
x86/cpu: Provide cpuid_read() et al.
KAGA-KOKO Feb 14, 2024
ff8cd17
x86/cpuid: Include <linux/build_bug.h> in <asm/cpuid.h>
Mar 4, 2025
db3b630
x86/cpu: Provide cpu_init/parse_topology()
KAGA-KOKO Feb 13, 2024
a686ce2
x86/cpu: Add legacy topology parser
KAGA-KOKO Feb 13, 2024
18c15cc
x86/cpu: Use common topology code for Centaur and Zhaoxin
KAGA-KOKO Feb 13, 2024
d077676
x86/cpu: Move __max_die_per_package to common.c
KAGA-KOKO Feb 13, 2024
a37ed92
x86/cpu: Provide a sane leaf 0xb/0x1f parser
KAGA-KOKO Feb 13, 2024
8721dcd
x86/cpu: Use common topology code for Intel
KAGA-KOKO Feb 13, 2024
2fa0401
x86/topology/intel: Unlock CPUID before evaluating anything
KAGA-KOKO May 30, 2024
9ec594b
x86/cpu: Provide an AMD/HYGON specific topology parser
KAGA-KOKO Feb 13, 2024
e449ffa
x86/cpu/amd: Make the CPUID 0x80000008 parser correct
KAGA-KOKO Apr 10, 2024
2544fd5
x86/cpu/amd: Make the NODEID_MSR union actually work
KAGA-KOKO Apr 10, 2024
23d28d2
x86/cpu/amd: Move TOPOEXT enablement into the topology parser
KAGA-KOKO Apr 11, 2024
5302eb5
x86/topology/amd: Ensure that LLC ID is initialized
KAGA-KOKO May 8, 2024
fa1a39d
x86/topology/amd: Evaluate SMT in CPUID leaf 0x8000001e only on famil…
KAGA-KOKO May 28, 2024
cbba3cc
x86/smpboot: Teach it about topo.amd_node_id
KAGA-KOKO Feb 13, 2024
6133835
x86/cpu: Use common topology code for AMD
KAGA-KOKO Feb 13, 2024
70f7572
x86/cpu: Use common topology code for HYGON
KAGA-KOKO Feb 13, 2024
ac8dd1c
x86/mm/numa: Use core domain size on AMD
KAGA-KOKO Feb 13, 2024
3fce5d9
x86/cpu: Make topology_amd_node_id() use the actual node info
KAGA-KOKO Feb 13, 2024
bed7892
x86/cpu: Remove topology.c
KAGA-KOKO Feb 13, 2024
782bea5
x86/cpu: Remove x86_coreid_bits
KAGA-KOKO Feb 13, 2024
c61ea32
x86/apic: Remove unused phys_pkg_id() callback
KAGA-KOKO Feb 13, 2024
2f6c02f
x86/xen/smp_pv: Remove cpudata fiddling
KAGA-KOKO Feb 13, 2024
348260f
x86/apic/uv: Remove the private leaf 0xb parser
KAGA-KOKO Feb 13, 2024
8c7498e
x86/cpu/topology: Use initial APIC ID from XTOPOLOGY leaf on AMD/HYGON
kudureranganath Aug 25, 2025
9f45033
x86/cpu/topology: Make the APIC mismatch warnings complete
KAGA-KOKO Feb 13, 2024
05ebf35
x86/xen: return a sane initial apic id when running as PV guest
jgross1 Apr 5, 2024
def29e6
x86/platform/ce4100: Dont override x86_init.mpparse.setup_ioapic_ids
KAGA-KOKO Feb 13, 2024
f07f36c
x86/ioapic: Replace some more set bit nonsense
KAGA-KOKO Feb 13, 2024
5eb19ff
x86/apic: Get rid of get_physical_broadcast()
KAGA-KOKO Feb 13, 2024
5abaab3
x86/ioapic: Make io_apic_get_unique_id() simpler
KAGA-KOKO Feb 13, 2024
ac130d9
x86/ioapic: Simplify setup_ioapic_ids_from_mpc_nocheck()
KAGA-KOKO Feb 13, 2024
29f7ecc
x86/apic: Remove check_apicid_used() and ioapic_phys_id_map()
KAGA-KOKO Feb 13, 2024
ead48d1
x86/mpparse: Rename default_find_smp_config()
KAGA-KOKO Feb 13, 2024
a24a319
x86/mpparse: Provide separate early/late callbacks
KAGA-KOKO Feb 13, 2024
eca3ce3
x86/mpparse: Prepare for callback separation
KAGA-KOKO Feb 13, 2024
dbde327
x86/dtb: Rename x86_dtb_init()
KAGA-KOKO Feb 13, 2024
9ce9566
x86/platform/ce4100: Prepare for separate mpparse callbacks
KAGA-KOKO Feb 13, 2024
d09db63
x86/platform/intel-mid: Prepare for separate mpparse callbacks
KAGA-KOKO Feb 13, 2024
9c6c6a2
x86/jailhouse: Prepare for separate mpparse callbacks
KAGA-KOKO Feb 13, 2024
3b7250c
x86/xen/smp_pv: Prepare for separate mpparse callbacks
KAGA-KOKO Feb 13, 2024
97e80a7
x86/hyperv/vtl: Prepare for separate mpparse callbacks
KAGA-KOKO Feb 13, 2024
2aef4d3
x86/mpparse: Switch to new init callbacks
KAGA-KOKO Feb 13, 2024
8ee5580
x86/mm/numa: Move early mptable evaluation into common code
KAGA-KOKO Feb 13, 2024
78accae
x86/mpparse: Remove the physid_t bitmap wrapper
KAGA-KOKO Feb 13, 2024
0186496
x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid
KAGA-KOKO Feb 13, 2024
06c702f
x86/apic: Remove yet another dubious callback
KAGA-KOKO Feb 13, 2024
97e357d
x86/apic: Use a proper define for invalid ACPI CPU ID
KAGA-KOKO Feb 13, 2024
1207850
x86/of: Move the x86_flattree_get_config() call out of x86_dtb_init()
Aug 25, 2023
cba4aa1
x86/hyperv/vtl: Correct x86_init.mpparse.parse_smp_cfg assignment
Apr 2, 2024
d7b2289
x86/of: Set the parse_smp_cfg for all the DeviceTree platforms by def…
Apr 2, 2024
4144317
x86/cpu/topology: Move registration out of APIC code
KAGA-KOKO Feb 13, 2024
7cadafb
x86/cpu/topology: Provide separate APIC registration functions
KAGA-KOKO Feb 13, 2024
4143ba8
x86/acpi: Use new APIC registration functions
KAGA-KOKO Feb 13, 2024
56b551a
x86/jailhouse: Use new APIC registration function
KAGA-KOKO Feb 13, 2024
cee66e5
x86/of: Use new APIC registration functions
KAGA-KOKO Feb 13, 2024
349598d
x86/mpparse: Use new APIC registration function
KAGA-KOKO Feb 13, 2024
9b3f2de
x86/acpi: Dont invoke topology_register_apic() for XEN PV
KAGA-KOKO Feb 13, 2024
a7572dd
x86/xen/smp_pv: Register fake APICs
KAGA-KOKO Feb 13, 2024
877eb85
x86/cpu/topology: Confine topology information
KAGA-KOKO Feb 13, 2024
f8edcc1
x86/cpu/topology: Simplify APIC registration
KAGA-KOKO Feb 13, 2024
05cb171
x86/cpu/topology: Use a data structure for topology info
KAGA-KOKO Feb 13, 2024
3d11222
x86/smpboot: Make error message actually useful
KAGA-KOKO Feb 13, 2024
cb0ff07
x86/cpu/topology: Sanitize the APIC admission logic
KAGA-KOKO Feb 13, 2024
afd5121
x86/cpu/topology: Rework possible CPU management
KAGA-KOKO Feb 13, 2024
1f07393
x86/cpu: Detect real BSP on crash kernels
KAGA-KOKO Feb 13, 2024
43ee9b5
x86/topology: Add a mechanism to track topology via APIC IDs
KAGA-KOKO Feb 13, 2024
864e2a0
x86/cpu/topology: Reject unknown APIC IDs on ACPI hotplug
KAGA-KOKO Feb 13, 2024
31ad02b
x86/cpu/topology: Assign hotpluggable CPUIDs during init
KAGA-KOKO Feb 13, 2024
1434703
x86/xen/smp_pv: Count number of vCPUs early
KAGA-KOKO Feb 13, 2024
58b294d
x86/cpu/topology: Let XEN/PV use topology from CPUID/MADT
KAGA-KOKO Feb 13, 2024
3633313
Revert "bytedance: x86/tsc: Enhance watchdog check exemption for 4 so…
quanxianwang Jan 6, 2026
fd74fe0
x86/cpu/topology: Use topology bitmaps for sizing
KAGA-KOKO Feb 13, 2024
f119b64
x86/cpu/topology: Mop up primary thread mask handling
KAGA-KOKO Feb 13, 2024
d60f4f3
x86/cpu/topology: Simplify cpu_mark_primary_thread()
KAGA-KOKO Feb 13, 2024
33da8da
x86/cpu/topology: Provide logical pkg/die mapping
KAGA-KOKO Feb 13, 2024
d383abb
x86/cpu/topology: Use topology logical mapping mechanism
KAGA-KOKO Feb 13, 2024
26442c6
x86/cpu/topology: Retrieve cores per package from topology bitmaps
KAGA-KOKO Feb 13, 2024
20dfc17
x86/cpu/topology: Rename smp_num_siblings
KAGA-KOKO Feb 13, 2024
fa55720
x86/cpu/topology: Rename topology_max_die_per_package()
KAGA-KOKO Feb 13, 2024
180611c
x86/cpu/topology: Provide __num_[cores|threads]_per_package
KAGA-KOKO Feb 13, 2024
6f790aa
x86/cpu/topology: Get rid of cpuinfo::x86_max_cores
KAGA-KOKO Feb 13, 2024
190fb97
x86/topology: Ignore non-present APIC IDs in a present package
KAGA-KOKO Mar 6, 2024
2b7d56e
x86/topology: Don't evaluate logical IDs during early boot
KAGA-KOKO Mar 22, 2024
043bf61
x86/topology: Don't update cpu_possible_map in topo_set_cpuids()
KAGA-KOKO Apr 8, 2024
3204f40
x86/xen/smp_pv: Register the boot CPU APIC properly
KAGA-KOKO May 2, 2024
e953f77
x86/topology: Handle bogus ACPI tables correctly
KAGA-KOKO May 17, 2024
161e54a
x86/cpu/topology: Remove limit of CPUs due to disabled IO/APIC
ffmancera Dec 2, 2024
36040f8
x86/acpi: Don't limit CPUs to 1 for Xen PV guests due to disabled ACPI
arkamar Apr 7, 2025
753e6d6
x86/xen: mark boot CPU of PV guest in MSR_IA32_APICBASE
jgross1 Oct 4, 2024
6906af9
x86/topology: Handle the !APIC case gracefully
KAGA-KOKO Mar 22, 2024
3d5dcf5
x86/tsc: Use topology_max_packages() to get package number
ftang1 Jul 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions Documentation/admin-guide/kdump/kdump.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ Dump-capture kernel config options (Arch Dependent, i386 and x86_64)
CPU is enough for kdump kernel to dump vmcore on most of systems.

However, you can also specify nr_cpus=X to enable multiple processors
in kdump kernel. In this case, "disable_cpu_apicid=" is needed to
tell kdump kernel which cpu is 1st kernel's BSP. Please refer to
admin-guide/kernel-parameters.txt for more details.
in kdump kernel.

With CONFIG_SMP=n, the above things are not related.

Expand Down Expand Up @@ -485,8 +483,7 @@ Notes on loading the dump-capture kernel:
to use multi-thread programs with it, such as parallel dump feature of
makedumpfile. Otherwise, the multi-thread program may have a great
performance degradation. To enable multi-cpu support, you should bring up an
SMP dump-capture kernel and specify maxcpus/nr_cpus, disable_cpu_apicid=[X]
options while loading it.
SMP dump-capture kernel and specify maxcpus/nr_cpus options while loading it.

* For s390x there are two kdump modes: If a ELF header is specified with
the elfcorehdr= kernel parameter, it is used by the kdump kernel as it
Expand Down
9 changes: 0 additions & 9 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1078,15 +1078,6 @@
Disable TLBIE instruction. Currently does not work
with KVM, with HASH MMU, or with coherent accelerators.

disable_cpu_apicid= [X86,APIC,SMP]
Format: <int>
The number of initial APIC ID for the
corresponding CPU to be disabled at boot,
mostly used for the kdump 2nd kernel to
disable BSP to wake up multiple CPUs without
causing system reset or hang due to sending
INIT from AP to BSP.

disable_ddw [PPC/PSERIES]
Disable Dynamic DMA Window support. Use this
to workaround buggy firmware.
Expand Down
30 changes: 11 additions & 19 deletions Documentation/arch/x86/topology.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ AMD nomenclature for package is 'Node'.

Package-related topology information in the kernel:

- cpuinfo_x86.x86_max_cores:
- topology_num_threads_per_package()

The number of cores in a package. This information is retrieved via CPUID.
The number of threads in a package.

- cpuinfo_x86.x86_max_dies:
- topology_num_cores_per_package()

The number of dies in a package. This information is retrieved via CPUID.
The number of cores in a package.

- topology_max_dies_per_package()

The maximum number of dies in a package.

- cpuinfo_x86.topo.die_id:

The physical ID of the die. This information is retrieved via CPUID.
The physical ID of the die.

- cpuinfo_x86.topo.pkg_id:

Expand All @@ -67,7 +71,7 @@ Package-related topology information in the kernel:
Modern systems use this value for the socket. There may be multiple
packages within a socket. This value may differ from topo.die_id.

- cpuinfo_x86.logical_proc_id:
- cpuinfo_x86.topo.logical_pkg_id:

The logical ID of the package. As we do not trust BIOSes to enumerate the
packages in a consistent way, we introduced the concept of logical package
Expand All @@ -79,9 +83,7 @@ Package-related topology information in the kernel:
The maximum possible number of packages in the system. Helpful for per
package facilities to preallocate per package information.

- cpu_llc_id:

A per-CPU variable containing:
- cpuinfo_x86.topo.llc_id:

- On Intel, the first APIC ID of the list of CPUs sharing the Last Level
Cache
Expand All @@ -98,16 +100,6 @@ are SMT- or CMT-type threads.
AMDs nomenclature for a CMT core is "Compute Unit". The kernel always uses
"core".

Core-related topology information in the kernel:

- smp_num_siblings:

The number of threads in a core. The number of threads in a package can be
calculated by::

threads_per_package = cpuinfo_x86.x86_max_cores * smp_num_siblings


Threads
=======
A thread is a single scheduling unit. It's the equivalent to a logical Linux
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/events/amd/uncore.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ void amd_uncore_l3_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
info.split.aux_data = 0;
info.split.num_pmcs = NUM_COUNTERS_L2;
info.split.gid = 0;
info.split.cid = get_llc_id(cpu);
info.split.cid = per_cpu_llc_id(cpu);

if (boot_cpu_data.x86 >= 0x17)
info.split.num_pmcs = NUM_COUNTERS_L3;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/events/intel/cstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ static int __init cstate_init(void)
}

if (has_cstate_pkg) {
if (topology_max_die_per_package() > 1) {
if (topology_max_dies_per_package() > 1) {
err = perf_pmu_register(&cstate_pkg_pmu,
"cstate_die", -1);
} else {
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/events/intel/uncore.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int uncore_device_to_die(struct pci_dev *dev)
struct cpuinfo_x86 *c = &cpu_data(cpu);

if (c->initialized && cpu_to_node(cpu) == node)
return c->logical_die_id;
return c->topo.logical_die_id;
}

return -1;
Expand Down Expand Up @@ -1914,7 +1914,7 @@ static int __init intel_uncore_init(void)
return -ENODEV;

__uncore_max_dies =
topology_max_packages() * topology_max_die_per_package();
topology_max_packages() * topology_max_dies_per_package();

id = x86_match_cpu(intel_uncore_match);
if (!id) {
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/events/intel/uncore_nhmex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,8 +1221,8 @@ void nhmex_uncore_cpu_init(void)
uncore_nhmex = true;
else
nhmex_uncore_mbox.event_descs = wsmex_uncore_mbox_events;
if (nhmex_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
nhmex_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
if (nhmex_uncore_cbox.num_boxes > topology_num_cores_per_package())
nhmex_uncore_cbox.num_boxes = topology_num_cores_per_package();
uncore_msr_uncores = nhmex_msr_uncores;
}
/* end of Nehalem-EX uncore support */
8 changes: 4 additions & 4 deletions arch/x86/events/intel/uncore_snb.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ static struct intel_uncore_type *snb_msr_uncores[] = {
void snb_uncore_cpu_init(void)
{
uncore_msr_uncores = snb_msr_uncores;
if (snb_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
snb_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
if (snb_uncore_cbox.num_boxes > topology_num_cores_per_package())
snb_uncore_cbox.num_boxes = topology_num_cores_per_package();
}

static void skl_uncore_msr_init_box(struct intel_uncore_box *box)
Expand Down Expand Up @@ -428,8 +428,8 @@ static struct intel_uncore_type *skl_msr_uncores[] = {
void skl_uncore_cpu_init(void)
{
uncore_msr_uncores = skl_msr_uncores;
if (skl_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
skl_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
if (skl_uncore_cbox.num_boxes > topology_num_cores_per_package())
skl_uncore_cbox.num_boxes = topology_num_cores_per_package();
snb_uncore_arb.ops = &skl_uncore_msr_ops;
}

Expand Down
18 changes: 9 additions & 9 deletions arch/x86/events/intel/uncore_snbep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,8 @@ static struct intel_uncore_type *snbep_msr_uncores[] = {

void snbep_uncore_cpu_init(void)
{
if (snbep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
snbep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
if (snbep_uncore_cbox.num_boxes > topology_num_cores_per_package())
snbep_uncore_cbox.num_boxes = topology_num_cores_per_package();
uncore_msr_uncores = snbep_msr_uncores;
}

Expand Down Expand Up @@ -1443,7 +1443,7 @@ static int snbep_pci2phy_map_init(int devid, int nodeid_loc, int idmap_loc, bool
*/
for (i = 0; i < 8; i++) {
if (nodeid == GIDNIDMAP(config, i)) {
if (topology_max_die_per_package() > 1)
if (topology_max_dies_per_package() > 1)
die_id = i;
else
die_id = topology_phys_to_logical_pkg(i);
Expand Down Expand Up @@ -1839,8 +1839,8 @@ static struct intel_uncore_type *ivbep_msr_uncores[] = {

void ivbep_uncore_cpu_init(void)
{
if (ivbep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
ivbep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
if (ivbep_uncore_cbox.num_boxes > topology_num_cores_per_package())
ivbep_uncore_cbox.num_boxes = topology_num_cores_per_package();
uncore_msr_uncores = ivbep_msr_uncores;
}

Expand Down Expand Up @@ -2911,8 +2911,8 @@ static bool hswep_has_limit_sbox(unsigned int device)

void hswep_uncore_cpu_init(void)
{
if (hswep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
hswep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
if (hswep_uncore_cbox.num_boxes > topology_num_cores_per_package())
hswep_uncore_cbox.num_boxes = topology_num_cores_per_package();

/* Detect 6-8 core systems with only two SBOXes */
if (hswep_has_limit_sbox(HSWEP_PCU_DID))
Expand Down Expand Up @@ -3274,8 +3274,8 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = {

void bdx_uncore_cpu_init(void)
{
if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
if (bdx_uncore_cbox.num_boxes > topology_num_cores_per_package())
bdx_uncore_cbox.num_boxes = topology_num_cores_per_package();
uncore_msr_uncores = bdx_msr_uncores;

/* Detect systems with no SBOXes */
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/events/rapl.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ static const struct attribute_group *rapl_attr_update[] = {

static int __init init_rapl_pmus(void)
{
int maxdie = topology_max_packages() * topology_max_die_per_package();
int maxdie = topology_max_packages() * topology_max_dies_per_package();
size_t size;

size = sizeof(*rapl_pmus) + maxdie * sizeof(struct rapl_pmu *);
Expand Down
6 changes: 3 additions & 3 deletions arch/x86/hyperv/hv_vtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ void __init hv_vtl_init_platform(void)
x86_init.resources.probe_roms = x86_init_noop;

/* Avoid searching for BIOS MP tables */
x86_init.mpparse.find_smp_config = x86_init_noop;
x86_init.mpparse.get_smp_config = x86_init_uint_noop;
x86_init.mpparse.find_mptable = x86_init_noop;
x86_init.mpparse.early_parse_smp_cfg = x86_init_noop;

x86_platform.get_wallclock = get_rtc_noop;
x86_platform.set_wallclock = set_rtc_noop;
Expand Down Expand Up @@ -207,7 +207,7 @@ static int hv_vtl_apicid_to_vp_id(u32 apic_id)
return ret;
}

static int hv_vtl_wakeup_secondary_cpu(int apicid, unsigned long start_eip)
static int hv_vtl_wakeup_secondary_cpu(u32 apicid, unsigned long start_eip)
{
int vp_id, cpu;

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/hyperv/ivm.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static void snp_cleanup_vmsa(struct sev_es_save_area *vmsa)
free_page((unsigned long)vmsa);
}

int hv_snp_boot_ap(int cpu, unsigned long start_ip)
int hv_snp_boot_ap(u32 cpu, unsigned long start_ip)
{
struct sev_es_save_area *vmsa = (struct sev_es_save_area *)
__get_free_page(GFP_KERNEL | __GFP_ZERO);
Expand Down
53 changes: 24 additions & 29 deletions arch/x86/include/asm/apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ extern void x86_32_probe_apic(void);
static inline void x86_32_probe_apic(void) { }
#endif

extern u32 cpuid_to_apicid[];

#define CPU_ACPIID_INVALID U32_MAX

#ifdef CONFIG_X86_LOCAL_APIC

extern int apic_verbosity;
Expand All @@ -55,8 +59,6 @@ extern int local_apic_timer_c2_ok;
extern bool apic_is_disabled;
extern unsigned int lapic_timer_period;

extern int cpuid_to_apicid[];

extern enum apic_intr_mode_id apic_intr_mode;
enum apic_intr_mode_id {
APIC_PIC,
Expand Down Expand Up @@ -170,6 +172,14 @@ extern bool apic_needs_pit(void);

extern void apic_send_IPI_allbutself(unsigned int vector);

extern void topology_register_apic(u32 apic_id, u32 acpi_id, bool present);
extern void topology_register_boot_apic(u32 apic_id);
extern int topology_hotplug_apic(u32 apic_id, u32 acpi_id);
extern void topology_hotunplug_apic(unsigned int cpu);
extern void topology_apply_cmdline_limits_early(void);
extern void topology_init_possible_cpus(void);
extern void topology_reset_possible_cpus_up(void);

#else /* !CONFIG_X86_LOCAL_APIC */
static inline void lapic_shutdown(void) { }
#define local_apic_timer_c2_ok 1
Expand All @@ -184,6 +194,8 @@ static inline void apic_intr_mode_init(void) { }
static inline void lapic_assign_system_vectors(void) { }
static inline void lapic_assign_legacy_vector(unsigned int i, bool r) { }
static inline bool apic_needs_pit(void) { return true; }
static inline void topology_apply_cmdline_limits_early(void) { }
static inline void topology_init_possible_cpus(void) { }
#endif /* !CONFIG_X86_LOCAL_APIC */

#ifdef CONFIG_X86_X2APIC
Expand Down Expand Up @@ -292,21 +304,16 @@ struct apic {
/* Probe, setup and smpboot functions */
int (*probe)(void);
int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
bool (*apic_id_registered)(void);

bool (*check_apicid_used)(physid_mask_t *map, int apicid);
void (*init_apic_ldr)(void);
void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap);
int (*cpu_present_to_apicid)(int mps_cpu);
int (*phys_pkg_id)(int cpuid_apic, int index_msb);
u32 (*cpu_present_to_apicid)(int mps_cpu);

u32 (*get_apic_id)(unsigned long x);
u32 (*set_apic_id)(unsigned int id);
u32 (*get_apic_id)(u32 id);

/* wakeup_secondary_cpu */
int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
int (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip);
/* wakeup secondary CPU using 64-bit wakeup point */
int (*wakeup_secondary_cpu_64)(int apicid, unsigned long start_eip);
int (*wakeup_secondary_cpu_64)(u32 apicid, unsigned long start_eip);

char *name;
};
Expand All @@ -324,8 +331,8 @@ struct apic_override {
void (*send_IPI_self)(int vector);
u64 (*icr_read)(void);
void (*icr_write)(u32 low, u32 high);
int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
int (*wakeup_secondary_cpu_64)(int apicid, unsigned long start_eip);
int (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip);
int (*wakeup_secondary_cpu_64)(u32 apicid, unsigned long start_eip);
};

/*
Expand Down Expand Up @@ -495,16 +502,6 @@ static inline bool lapic_vector_set_in_irr(unsigned int vector)
return !!(irr & (1U << (vector % 32)));
}

static inline unsigned default_get_apic_id(unsigned long x)
{
unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));

if (APIC_XAPIC(ver) || boot_cpu_has(X86_FEATURE_EXTD_APICID))
return (x >> 24) & 0xFF;
else
return (x >> 24) & 0x0F;
}

/*
* Warm reset vector position:
*/
Expand All @@ -519,9 +516,9 @@ extern void generic_bigsmp_probe(void);

extern struct apic apic_noop;

static inline unsigned int read_apic_id(void)
static inline u32 read_apic_id(void)
{
unsigned int reg = apic_read(APIC_ID);
u32 reg = apic_read(APIC_ID);

return apic->get_apic_id(reg);
}
Expand All @@ -540,15 +537,13 @@ extern int default_apic_id_valid(u32 apicid);
extern u32 apic_default_calc_apicid(unsigned int cpu);
extern u32 apic_flat_calc_apicid(unsigned int cpu);

extern bool default_check_apicid_used(physid_mask_t *map, int apicid);
extern void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap);
extern int default_cpu_present_to_apicid(int mps_cpu);
extern u32 default_cpu_present_to_apicid(int mps_cpu);

void apic_send_nmi_to_offline_cpu(unsigned int cpu);

#else /* CONFIG_X86_LOCAL_APIC */

static inline unsigned int read_apic_id(void) { return 0; }
static inline u32 read_apic_id(void) { return 0; }

#endif /* !CONFIG_X86_LOCAL_APIC */

Expand Down
3 changes: 0 additions & 3 deletions arch/x86/include/asm/cacheinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ extern unsigned int memory_caching_control;
#define CACHE_MTRR 0x01
#define CACHE_PAT 0x02

void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu);
void cacheinfo_hygon_init_llc_id(struct cpuinfo_x86 *c, int cpu);

void cache_disable(void);
void cache_enable(void);
void set_cache_aps_delayed_init(bool val);
Expand Down
Loading