aboutsummaryrefslogtreecommitdiffstats
path: root/src/fw/smp.c
Commit message (Collapse)AuthorAgeFilesLines
* drop "etc/boot-cpus" fw_cfg file and reuse legacy QEMU_CFG_NB_CPUSIgor Mammedov2016-11-211-1/+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>
* support booting with more than 255 CPUsIgor Mammedov2016-10-251-4/+20
| | | | | | | | | | | | | | | | SDM[*1] says that if there are CPUs with APIC ID greater than 254, BIOS is to pass control to OS in x2APIC mode. Use the fact that QEMU passes in "etc/max-cpus" max possible "APIC ID + 1" to detect need for x2APIC mode. Also instead of CMOS_BIOS_SMP_COUNT which is limited to 256 CPUs use a new rom file "etc/boot-cpus" that QEMU supporting more than 256 CPUs will provide. *1) SDM: Volume 3: EXTENDED XAPIC (X2APIC): Initialization by System Software Signed-off-by: Igor Mammedov <imammedo@redhat.com>
* add helpers to read etc/boot-cpus at resume timeIgor Mammedov2016-10-251-5/+6
| | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com>
* smp: consolidate CPU APIC ID detection and accountingKevin O'Connor2016-10-251-10/+15
| | | | | Signed-off-by: "Kevin O'Connor" <kevin@koconnor.net> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
* smp: restore MSRs on S3 resumePaolo Bonzini2016-07-071-14/+36
| | | | | | | | | | | | | | | | | Currently the MTRRs and MSR_IA32_FEATURE_CONTROL are not restored on S3 resume. Because these have to be applied to all processors, SMP setup has to be added to S3 resume. There are two differences between the boot and resume paths. First, romfile_* is not usable in the resume paths so we separate out the remaining common code to a new smp_scan function. Second, smp_msr has to be walked on the BSP as well, so we extract that out of handle_smp and into a new function smp_write_msrs. Then, resume can call smp_write_msrs on the BSP followed by smp_scan to initialize the APs. Reported-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fw/msr_feature_control: add support to set MSR_IA32_FEATURE_CONTROLHaozhong Zhang2016-07-011-10/+10
| | | | | | | | | | | | | OS usually expects BIOS to set certain bits in MSR_IA32_FEATURE_CONTROL for some features (e.g. VMX and LMCE). QEMU provides a fw_cfg file "etc/msr_feature_control" to advise bits that should be set in MSR_IA32_FEATURE_CONTROL. If this file exists, SeaBIOS will set the advised bits in that MSR. Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20160622065324.23812-1-haozhong.zhang@intel.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Always enable caching on transition32; backup/restore cr0 on call32Kevin O'Connor2015-10-091-3/+0
| | | | | | | | | | | Always enable caching at start of 32bit code and always make sure the paging flag is off. Because this alters the cr0 register, perform a backup and restore of it when using call32(). Also, rename get/setcr0() to cr0_read/write() to more closely match other register access functions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Make sure handle_smi() and handle_smp() are compiled out if not enabled.Kevin O'Connor2014-06-051-0/+3
| | | | | | Add CONFIG_ checks around the handle_smi/handle_smp functions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* smp: Replace QEMU SMP init assembler code with C; run only in 32bit mode.Kevin O'Connor2014-06-041-54/+56
| | | | | | | | | Change the multi-processor init code to trampoline into 32bit mode on each of the additional processors. Implement an atomic lock so that each processor performs its initialization serially. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Rename hw/cmos.h to hw/rtc.h and copy RTC code from clock.c to hw/rtc.c.Kevin O'Connor2013-09-281-2/+2
| | | | | | | | | Group the Real Time Clock code into hw/rtc.[ch]. Also, use rtc_read/write/mask function naming (instead of inb/outb_cmos) to be more consistent with other register accessors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move function definitions for output.c from util.h to new file output.h.Kevin O'Connor2013-09-181-1/+2
| | | | | | Also, sort the order of include files in the c files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move romfile definitions from util.h to new file romfile.h.Kevin O'Connor2013-09-181-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move stacks.c definitions from util.h to new file stacks.h.Kevin O'Connor2013-09-181-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Split x86 specific functions out of util.c/h to new files x86.c/h.Kevin O'Connor2013-09-181-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move code cenetered around firmware initialization to src/fw/Kevin O'Connor2013-09-021-0/+144
Move many C files from the src/ directory to the new src/fw/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>