diff options
author | Igor Mammedov <imammedo@redhat.com> | 2016-11-11 16:35:15 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-11-21 16:56:36 +0100 |
commit | 8891697e3f7d84355420573efd98e94f14736768 (patch) | |
tree | 24100d3d6936b2fb7b5dcd64169db727779f08cc | |
parent | d7adf6044a4c772b497e97272adf97426b34a249 (diff) | |
download | seabios-hppa-rel-1.10.1.zip seabios-hppa-rel-1.10.1.tar.gz seabios-hppa-rel-1.10.1.tar.bz2 |
drop "etc/boot-cpus" fw_cfg file and reuse legacy QEMU_CFG_NB_CPUSrel-1.10.1
since QEMU_CFG_NB_CPUS not going away anytime soon
and serves the same purpose as just added "etc/boot-cpus" fw_cfg
drop support for "etc/boot-cpus" while this code is not
in use yet (i.e. QEMU with "etc/boot-cpus" hasn't been released)
and reuse QEMU_CFG_NB_CPUS instead of it.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
(cherry picked from commit b98c6586c0c3d519359d6e751ecb3e637e82dbcb)
-rw-r--r-- | src/fw/paravirt.c | 37 | ||||
-rw-r--r-- | src/fw/paravirt.h | 1 | ||||
-rw-r--r-- | src/fw/smp.c | 2 |
3 files changed, 7 insertions, 33 deletions
diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c index 125066d..6de70f6 100644 --- a/src/fw/paravirt.c +++ b/src/fw/paravirt.c @@ -205,6 +205,7 @@ qemu_platform_setup(void) #define QEMU_CFG_UUID 0x02 #define QEMU_CFG_NUMA 0x0d #define QEMU_CFG_BOOT_MENU 0x0e +#define QEMU_CFG_NB_CPUS 0x05 #define QEMU_CFG_MAX_CPUS 0x0f #define QEMU_CFG_FILE_DIR 0x19 #define QEMU_CFG_ARCH_LOCAL 0x8000 @@ -319,40 +320,14 @@ qemu_romfile_add(char *name, int select, int skip, int size) romfile_add(&qfile->file); } -static int -qemu_romfile_get_fwcfg_entry(char *name, int *select) -{ - struct romfile_s *file = romfile_find(name); - if (!file) - return 0; - struct qemu_romfile_s *qfile; - qfile = container_of(file, struct qemu_romfile_s, file); - if (select) - *select = qfile->select; - return file->size; -} - -static int boot_cpus_sel; -static int boot_cpus_file_sz; - -u16 -qemu_init_present_cpus_count(void) -{ - u16 smp_count = romfile_loadint("etc/boot-cpus", - rtc_read(CMOS_BIOS_SMP_COUNT) + 1); - boot_cpus_file_sz = - qemu_romfile_get_fwcfg_entry("etc/boot-cpus", &boot_cpus_sel); - return smp_count; -} - u16 qemu_get_present_cpus_count(void) { - u16 smp_count; - if (!boot_cpus_file_sz) { - smp_count = rtc_read(CMOS_BIOS_SMP_COUNT) + 1; - } else { - qemu_cfg_read_entry(&smp_count, boot_cpus_sel, boot_cpus_file_sz); + u16 smp_count = 0; + qemu_cfg_read_entry(&smp_count, QEMU_CFG_NB_CPUS, sizeof(smp_count)); + u16 cmos_cpu_count = rtc_read(CMOS_BIOS_SMP_COUNT) + 1; + if (smp_count < cmos_cpu_count) { + smp_count = cmos_cpu_count; } return smp_count; } diff --git a/src/fw/paravirt.h b/src/fw/paravirt.h index 6f26fd0..d8eb7c4 100644 --- a/src/fw/paravirt.h +++ b/src/fw/paravirt.h @@ -52,7 +52,6 @@ void qemu_preinit(void); void qemu_platform_setup(void); void qemu_cfg_init(void); -u16 qemu_init_present_cpus_count(void); u16 qemu_get_present_cpus_count(void); #endif diff --git a/src/fw/smp.c b/src/fw/smp.c index bcbad69..46d1da1 100644 --- a/src/fw/smp.c +++ b/src/fw/smp.c @@ -176,7 +176,7 @@ smp_setup(void) return; MaxCountCPUs = romfile_loadint("etc/max-cpus", 0); - u16 smp_count = qemu_init_present_cpus_count(); + u16 smp_count = qemu_get_present_cpus_count(); if (MaxCountCPUs < smp_count) MaxCountCPUs = smp_count; |