Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
pc: Set CPU APIC ID explicitly
The PC code takes care of CPU topology, and CPU topology affect the CPU APIC ID. So the PC CPU initialization code needs to set the APIC ID explicitly. By now, keep the existing behavior but create a apic_id_for_cpu() function that will be changed later to implement appropriate topology-dependent behavior. The cpuid_apic_id field is used only at: - x86_cpu_apic_init(), called from x86_cpu_realize() - kvm_init_vcpu(), that is called from the VCPU thread created by qemu_init_vcpu(), called by x86_cpu_realize() - helper_cpuid(), called only when the VCPU is already running - kvm_arch_init_vcpu(), that's called by kvm_init_vcpu() So it's safe to change it before x86_cpu_realize() is called. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- This is based on the patch that I have originally suybmitted as: Subject: pc: create apic_id_for_cpu() function (v3) Changes v2: - Implement it without the PCInitArgs PC code refactor - cpu_index is now on CPUState - Use "apic-id" property
- Loading branch information