WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [HVM] Change VCPU->LAPIC_ID mapping so th

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [HVM] Change VCPU->LAPIC_ID mapping so that VCPU0 has ID0.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 31 Dec 2006 06:05:06 -0800
Delivery-date: Sun, 31 Dec 2006 06:05:09 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxxx
# Date 1167568002 0
# Node ID 4fc6ffff2ac583dc0c386eb3452484b31b37fd0e
# Parent  dbddea768e2933b7379d1f10a410081f4946f33f
[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@xxxxxxxxxxxxx>
---
 tools/firmware/hvmloader/acpi/build.c |    2 +-
 tools/firmware/hvmloader/config.h     |    3 ++-
 tools/firmware/hvmloader/mp_tables.c  |    2 +-
 xen/arch/x86/hvm/vlapic.c             |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff -r dbddea768e29 -r 4fc6ffff2ac5 tools/firmware/hvmloader/acpi/build.c
--- a/tools/firmware/hvmloader/acpi/build.c     Sun Dec 31 11:59:47 2006 +0000
+++ b/tools/firmware/hvmloader/acpi/build.c     Sun Dec 31 12:26:42 2006 +0000
@@ -110,7 +110,7 @@ int construct_madt(struct acpi_20_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++;
diff -r dbddea768e29 -r 4fc6ffff2ac5 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h Sun Dec 31 11:59:47 2006 +0000
+++ b/tools/firmware/hvmloader/config.h Sun Dec 31 12:26:42 2006 +0000
@@ -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 */
diff -r dbddea768e29 -r 4fc6ffff2ac5 tools/firmware/hvmloader/mp_tables.c
--- a/tools/firmware/hvmloader/mp_tables.c      Sun Dec 31 11:59:47 2006 +0000
+++ b/tools/firmware/hvmloader/mp_tables.c      Sun Dec 31 12:26:42 2006 +0000
@@ -222,7 +222,7 @@ void fill_mp_proc_entry(struct mp_proc_e
 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 )
diff -r dbddea768e29 -r 4fc6ffff2ac5 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c Sun Dec 31 11:59:47 2006 +0000
+++ b/xen/arch/x86/hvm/vlapic.c Sun Dec 31 12:26:42 2006 +0000
@@ -767,7 +767,7 @@ static int vlapic_reset(struct vlapic *v
     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++ )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [HVM] Change VCPU->LAPIC_ID mapping so that VCPU0 has ID0., Xen patchbot-unstable <=