mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
apic: add support for x2APIC mode
This commit extends the APIC ID to 32-bit long and remove the 255 max APIC ID limit in userspace APIC. The array that manages local APICs is now dynamically allocated based on the max APIC ID of created x86 machine. Also, new x2APIC IPI destination determination scheme, self IPI and x2APIC mode register access are supported. Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com> Message-Id: <20240111154404.5333-3-minhquangbui99@gmail.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
b2101358e5
commit
b5ee0468e9
7 changed files with 258 additions and 74 deletions
|
@ -137,7 +137,7 @@ void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version)
|
|||
* a literal `0` in configurations where kvm_* aren't defined)
|
||||
*/
|
||||
if (kvm_enabled() && x86ms->apic_id_limit > 255 &&
|
||||
(!kvm_irqchip_in_kernel() || !kvm_enable_x2apic())) {
|
||||
kvm_irqchip_in_kernel() && !kvm_enable_x2apic()) {
|
||||
error_report("current -smp configuration requires kernel "
|
||||
"irqchip and X2APIC API support.");
|
||||
exit(EXIT_FAILURE);
|
||||
|
@ -147,6 +147,10 @@ void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version)
|
|||
kvm_set_max_apic_id(x86ms->apic_id_limit);
|
||||
}
|
||||
|
||||
if (!kvm_irqchip_in_kernel()) {
|
||||
apic_set_max_apic_id(x86ms->apic_id_limit);
|
||||
}
|
||||
|
||||
possible_cpus = mc->possible_cpu_arch_ids(ms);
|
||||
for (i = 0; i < ms->smp.cpus; i++) {
|
||||
x86_cpu_new(x86ms, possible_cpus->cpus[i].arch_id, &error_fatal);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue