[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.8 16/18] pc: add 'etc/boot-cpus' fw_cfg fi
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [PATCH for-2.8 16/18] pc: add 'etc/boot-cpus' fw_cfg file for machine with more than 255 CPUs |
Date: |
Mon, 8 Aug 2016 13:40:24 +0200 |
On Sun, 7 Aug 2016 09:02:33 +0300
"Michael S. Tsirkin" <address@hidden> wrote:
> On Fri, Aug 05, 2016 at 11:46:15AM +0200, Igor Mammedov wrote:
> > 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 new
> > 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>
>
> Do we really need this? Why differentiate between boot
> cpus and others? How about reusing the hotplug
> register, such that it looks just as if all CPUs
> were just added by hotplug?
We could hijack cpu hotplug registers or even better extend it
with new command, like GET_PRESENT_CPUS_COUNT
but then we would need to tell firmware where register
is located which would lead to just adding other fw_cfg
file with register address.
So it's not better (maybe worse) than just adding
etc/boot-cpus fw_cfg file.
>
> > ---
> > hw/i386/pc.c | 12 +++++++++++-
> > 1 file changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > index c2cd5bd..2b5581a 100644
> > --- a/hw/i386/pc.c
> > +++ b/hw/i386/pc.c
> > @@ -1235,9 +1235,11 @@ void pc_machine_done(Notifier *notifier, void *data)
> > PCMachineState *pcms = container_of(notifier,
> > PCMachineState, machine_done);
> > PCIBus *bus = pcms->bus;
> > + static uint16_t boot_cpus;
> >
> > /* set the number of CPUs */
> > - rtc_set_memory(pcms->rtc, 0x5f, pc_present_cpus_count(pcms) - 1);
> > + boot_cpus = pc_present_cpus_count(pcms);
> > + rtc_set_memory(pcms->rtc, 0x5f, boot_cpus - 1);
> >
> > if (bus) {
> > int extra_hosts = 0;
> > @@ -1258,8 +1260,16 @@ void pc_machine_done(Notifier *notifier, void *data)
> >
> > acpi_setup();
> > if (pcms->fw_cfg) {
> > + MachineClass *mc = MACHINE_GET_CLASS(pcms);
> > +
> > pc_build_smbios(pcms->fw_cfg);
> > pc_build_feature_control_file(pcms);
> > +
> > + if (mc->max_cpus > 255) {
> > + boot_cpus = cpu_to_le16(boot_cpus);
> > + fw_cfg_add_file(pcms->fw_cfg, "etc/boot-cpus", &boot_cpus,
> > + sizeof(boot_cpus));
> > + }
> > }
> > }
> >
> > --
> > 2.7.4
- [Qemu-devel] [PATCH for-2.8 08/18] acpi: cphp: force switch to modern cpu hotplug if APIC ID > 254, (continued)
- [Qemu-devel] [PATCH for-2.8 08/18] acpi: cphp: force switch to modern cpu hotplug if APIC ID > 254, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 10/18] pc: apic_common: extend APIC ID property to 32bit, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 11/18] pc: apic_common: restore APIC ID to initial ID on reset, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 07/18] acpi: cphp: support x2APIC entry in cpu._MAT, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 09/18] pc: leave max apic_id_limit only in legacy cpu hotplug code, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 12/18] pc: apic_common: reset APIC ID to initial ID when switching into x2APIC mode, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 13/18] pc: kvm_apic: pass APIC ID depending on xAPIC/x2APIC mode, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 14/18] pc: clarify FW_CFG_MAX_CPUS usage comment, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 16/18] pc: add 'etc/boot-cpus' fw_cfg file for machine with more than 255 CPUs, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 15/18] increase MAX_CPUMASK_BITS from 255 to 288, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 17/18] pc: add 2.8 machine, Igor Mammedov, 2016/08/05
- [Qemu-devel] [PATCH for-2.8 18/18] pc: q35: bump max_cpus to 288, Igor Mammedov, 2016/08/05
- Re: [Qemu-devel] [PATCH for-2.8 00/18] pc: q35: x2APIC support in kvm_apic mode, Chao Gao, 2016/08/08
- Re: [Qemu-devel] [PATCH for-2.8 00/18] pc: q35: x2APIC support in kvm_apic mode, Peter Xu, 2016/08/08
- Re: [Qemu-devel] [PATCH for-2.8 00/18] pc: q35: x2APIC support in kvm_apic mode, Chao Gao, 2016/08/09
- Re: [Qemu-devel] [PATCH for-2.8 00/18] pc: q35: x2APIC support in kvm_apic mode, Peter Xu, 2016/08/09
- Re: [Qemu-devel] [PATCH for-2.8 00/18] pc: q35: x2APIC support in kvm_apic mode, Peter Xu, 2016/08/09
- Re: [Qemu-devel] [PATCH for-2.8 00/18] pc: q35: x2APIC support in kvm_apic mode, Jan Kiszka, 2016/08/09
- Re: [Qemu-devel] [PATCH for-2.8 00/18] pc: q35: x2APIC support in kvm_apic mode, Peter Xu, 2016/08/09