mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
[HVM] Change VCPU->LAPIC_ID mapping so that VCPU0 has ID0.
This fixes booting of older x86/64 Linux kernels. Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
1 parent
41eabc3d5c
commit
c21d85bf59
4 files changed
+5
-4
No files matched your search
@@ -110,7 +110,7 @@ int construct_madt(struct acpi_20_madt *madt)
|
||||
memset(lapic, 0, sizeof(*lapic));
|
||||
lapic->type = ACPI_PROCESSOR_LOCAL_APIC;
|
||||
lapic->length = sizeof(*lapic);
|
||||
lapic->acpi_processor_id = lapic->apic_id = i + 1;
|
||||
lapic->acpi_processor_id = lapic->apic_id = LAPIC_ID(i);
|
||||
lapic->flags = ACPI_LOCAL_APIC_ENABLED;
|
||||
offset += sizeof(*lapic);
|
||||
lapic++;
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
#define __HVMLOADER_CONFIG_H__
|
||||
|
||||
#define IOAPIC_BASE_ADDRESS 0xfec00000
|
||||
#define IOAPIC_ID 0x00
|
||||
#define IOAPIC_ID 0x01
|
||||
#define IOAPIC_VERSION 0x11
|
||||
|
||||
#define LAPIC_BASE_ADDRESS 0xfee00000
|
||||
#define LAPIC_ID(vcpu_id) ((vcpu_id) * 2)
|
||||
|
||||
#define PCI_ISA_DEVFN 0x08 /* dev 1, fn 0 */
|
||||
#define PCI_ISA_IRQ_MASK 0x0c60U /* ISA IRQs 5,6,10,11 are PCI connected */
|
||||
|
||||
@@ -222,7 +222,7 @@ void fill_mp_config_table(struct mp_config_table *mpct, int length)
|
||||
void fill_mp_proc_entry(struct mp_proc_entry *mppe, int vcpu_id)
|
||||
{
|
||||
mppe->type = ENTRY_TYPE_PROCESSOR;
|
||||
mppe->lapic_id = vcpu_id + 1;
|
||||
mppe->lapic_id = LAPIC_ID(vcpu_id);
|
||||
mppe->lapic_version = 0x11;
|
||||
mppe->cpu_flags = CPU_FLAG_ENABLED;
|
||||
if ( vcpu_id == 0 )
|
||||
|
||||
@@ -767,7 +767,7 @@ static int vlapic_reset(struct vlapic *vlapic)
|
||||
struct vcpu *v = vlapic_vcpu(vlapic);
|
||||
int i;
|
||||
|
||||
vlapic_set_reg(vlapic, APIC_ID, (v->vcpu_id + 1) << 24);
|
||||
vlapic_set_reg(vlapic, APIC_ID, (v->vcpu_id * 2) << 24);
|
||||
vlapic_set_reg(vlapic, APIC_LVR, VLAPIC_VERSION);
|
||||
|
||||
for ( i = 0; i < 8; i++ )
|
||||
|
||||