[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 12/14] pc: add 'etc/boot-cpus' fw_cfg file for m
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH RFC 12/14] pc: add 'etc/boot-cpus' fw_cfg file for machine with more than 255 CPUs |
Date: |
Mon, 9 May 2016 11:26:58 +0200 |
Currently firmware uses 1 byte at 0x5F offset in RTC CMOS
to get number of CPUs present at boot. However 1 byte is
not enough to handle more than 255 CPUs. So add a fw_cfg
file that would allow QEMU to tell it.
For compat reasons add file only for machine types that
support more than 255 CPUs.
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/i386/pc.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 5fa5668..7161485 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -738,6 +738,7 @@ static void pc_build_smbios(FWCfgState *fw_cfg)
static FWCfgState *bochs_bios_init(AddressSpace *as, PCMachineState *pcms)
{
+ MachineClass *mc = MACHINE_GET_CLASS(pcms);
FWCfgState *fw_cfg;
uint64_t *numa_fw_cfg;
int i, j;
@@ -770,6 +771,11 @@ static FWCfgState *bochs_bios_init(AddressSpace *as,
PCMachineState *pcms)
sizeof(struct e820_entry) * e820_entries);
fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, &hpet_cfg, sizeof(hpet_cfg));
+ if (mc->max_cpus > 255) {
+ static uint16_t boot_cpus;
+ boot_cpus = cpu_to_le16(smp_cpus);
+ fw_cfg_add_file(fw_cfg, "etc/boot-cpus", &smp_cpus, sizeof(boot_cpus));
+ }
/* allocate memory for the NUMA channel: one (64bit) word for the number
* of nodes, one word for each VCPU->node and one word for each node to
* hold the amount of memory.
--
1.8.3.1
- [Qemu-devel] [PATCH RFC 04/14] pc: leave max apic_id_limit only in legacy cpu hotplug code, (continued)
- [Qemu-devel] [PATCH RFC 04/14] pc: leave max apic_id_limit only in legacy cpu hotplug code, Igor Mammedov, 2016/05/09
- [Qemu-devel] [PATCH RFC 03/14] acpi: cphp: add support for x2APIC in _MAT method, Igor Mammedov, 2016/05/09
- [Qemu-devel] [PATCH RFC 05/14] pc: apic: move MAX_APICS check to 'apic' class, Igor Mammedov, 2016/05/09
- [Qemu-devel] [PATCH RFC 06/14] pc: apic_common: extend APIC ID property to 32bit, Igor Mammedov, 2016/05/09
- [Qemu-devel] [PATCH RFC 08/14] pc: apic_common: reset APIC ID to initial ID when switching into x2APIC mode, Igor Mammedov, 2016/05/09
- [Qemu-devel] [PATCH RFC 09/14] pc: kvm_apic: pass APIC ID depending on xAPIC/x2APIC mode, Igor Mammedov, 2016/05/09
- [Qemu-devel] [PATCH RFC 10/14] pc: clarify FW_CFG_MAX_CPUS usage comment, Igor Mammedov, 2016/05/09
- [Qemu-devel] [PATCH RFC 11/14] increase MAX_CPUMASK_BITS from 255 to 288, Igor Mammedov, 2016/05/09
- [Qemu-devel] [PATCH RFC 07/14] pc: apic_common: restore APIC ID to initial ID on reset, Igor Mammedov, 2016/05/09
- [Qemu-devel] [PATCH RFC 12/14] pc: add 'etc/boot-cpus' fw_cfg file for machine with more than 255 CPUs,
Igor Mammedov <=
- [Qemu-devel] [PATCH RFC 13/14] pc: q35: bump max_cpus to 288, Igor Mammedov, 2016/05/09
- [Qemu-devel] [PATCH RFC 14/14] DO NOT APPLY: hack to make 2nd CPU APIC ID to be x2APIC one, Igor Mammedov, 2016/05/09