[SeaBIOS] [PATCH v3 3/3] support booting with more than 255 CPUs

Igor Mammedov imammedo at redhat.com
Thu Aug 11 13:18:53 CEST 2016


On Wed, 10 Aug 2016 11:25:41 -0400
"Kevin O'Connor" <kevin at koconnor.net> wrote:

> On Wed, Aug 10, 2016 at 12:59:16PM +0200, Igor Mammedov wrote:
> > On Mon, 8 Aug 2016 18:42:07 -0400
> > "Kevin O'Connor" <kevin at koconnor.net> wrote:  
> > > On Fri, Aug 05, 2016 at 12:47:29PM +0200, Igor Mammedov wrote:  
> > > > @@ -164,6 +178,8 @@ smp_setup(void)
> > > >      if (MaxCountCPUs < cmos_smp_count)
> > > >          MaxCountCPUs = cmos_smp_count;
> > > >  
> > > > +    boot_cpus_count = romfile_loadint("etc/boot-cpus", cmos_smp_count);
> > > > +    
> > > 
> > > Wouldn't boot_cpus_count then also need to be updated in smp_resume()?
> > > If the user hotplugs a new cpu between system start and prior to an s3
> > > resume event, then the new could should be handled during that resume.  
> > when I try to put romfile_loadint() into smp_scan(), it breaks compilation with:
> > 
> > ERROR: .data.varinit../src/romfile.c.13 is VARVERIFY32INIT but used from ['.text.runtime../src/resume.c.142', '.text.smp_scan', '.text.romfile_loadint', '.text.romfile_find']
> > 
> > I'm not sure how to fix it
> >   
> 
> Right - one can't use the romfile code on resume.  I forgot about
> that.
> 
> I don't have a good solution.  One option is to record the fw_cfg
> 'select' and then call qemu_cfg_read_entry() directly on the resume
> path.  Another option would be to pass the number of active CPUs using
> some mechanism other than fw_cfg.  Neither seems like a great option.
QEMU has cpu hotplug MMIO registers, what we can do is to
replace fwcfg(etc/boot_cpus) with registers address fwcfg(etc/cphp_addr)
and add a command to return number of cpus in QEMU:
  https://github.com/qemu/qemu/blob/master/docs/specs/acpi_cpu_hotplug.txt
Then Seabios would be able to query it at resume time.
But that's even more complicated than
 "record the fw_cfg 'select' and then call qemu_cfg_read_entry()"

> 
> -Kevin




More information about the SeaBIOS mailing list