[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [QEMU RFC PATCH 5/7] pc: write lapic info (apic IDs) to fw_
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [QEMU RFC PATCH 5/7] pc: write lapic info (apic IDs) to fw_cfg so seabios can use it |
Date: |
Tue, 10 Jul 2012 17:22:20 -0300 |
Signed-off-by: Eduardo Habkost <address@hidden>
---
hw/pc.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/hw/pc.c b/hw/pc.c
index 3b8e469..dc95fb8 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -71,6 +71,7 @@
#define FW_CFG_IRQ0_OVERRIDE (FW_CFG_ARCH_LOCAL + 2)
#define FW_CFG_E820_TABLE (FW_CFG_ARCH_LOCAL + 3)
#define FW_CFG_HPET (FW_CFG_ARCH_LOCAL + 4)
+#define FW_CFG_LAPIC_INFO (FW_CFG_ARCH_LOCAL + 5)
#define MSI_ADDR_BASE 0xfee00000
@@ -87,6 +88,18 @@ struct e820_table {
struct e820_entry entry[E820_NR_ENTRIES];
} QEMU_PACKED __attribute((__aligned__(4)));
+struct lapic_info_entry {
+ uint8_t apic_id;
+ uint8_t reserved1;
+ uint16_t reserved2;
+ uint32_t reserved3;
+} QEMU_PACKED;
+
+struct lapic_info_table {
+ uint64_t count;
+ struct lapic_info_entry entries[];
+} QEMU_PACKED;
+
static struct e820_table e820_table;
struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
@@ -652,6 +665,16 @@ static void *bochs_bios_init(void)
fw_cfg_add_bytes(fw_cfg, FW_CFG_NUMA, (uint8_t *)numa_fw_cfg,
(1 + max_cpus + nb_numa_nodes) * 8);
+ size_t lapic_info_size = sizeof(struct lapic_info_table) + \
+ sizeof(struct lapic_info_entry) * max_cpus;
+ struct lapic_info_table *lapic_table = g_malloc0(lapic_info_size);;
+ lapic_table->count = max_cpus;
+ for (i = 0; i < max_cpus; i++) {
+ lapic_table->entries[i].apic_id = apic_id_for_cpu(i);
+ }
+ fw_cfg_add_bytes(fw_cfg, FW_CFG_LAPIC_INFO, (uint8_t *)lapic_table,
+ lapic_info_size);
+
return fw_cfg;
}
--
1.7.10.4
- [Qemu-devel] [PATCH 1/7] cpus.h: include cpu-common.h, (continued)
- [Qemu-devel] [PATCH 1/7] cpus.h: include cpu-common.h, Eduardo Habkost, 2012/07/10
- [Qemu-devel] [QEMU PATCH 2/7] hw/apic.c: rename bit functions to not conflict with bitops.h, Eduardo Habkost, 2012/07/10
- [Qemu-devel] [Seabios RFC PATCH 1/1] get lapic IDs from fw_cfg, Eduardo Habkost, 2012/07/10
- [Qemu-devel] [QEMU RFC PATCH 4/7] i386: create apic_id_for_cpu() function, Eduardo Habkost, 2012/07/10
- [Qemu-devel] [QEMU RFC PATCH 7/7] generate APIC IDs according to CPU topology, Eduardo Habkost, 2012/07/10
- [Qemu-devel] [QEMU RFC PATCH 6/7] i386: topology & APIC ID utility functions, Eduardo Habkost, 2012/07/10
- [Qemu-devel] [QEMU PATCH 3/7] kvm: set vcpu_id to APIC ID instead of CPU index, Eduardo Habkost, 2012/07/10
- [Qemu-devel] [QEMU RFC PATCH 5/7] pc: write lapic info (apic IDs) to fw_cfg so seabios can use it,
Eduardo Habkost <=
- Re: [Qemu-devel] [RFC 0/7+1] QEMU APIC ID + topology bug + CPU hotplug, Igor Mammedov, 2012/07/12