From: Paolo Bonzini Date: Thu, 7 Jul 2016 14:00:40 +0000 (+0200) Subject: smp: restore MSRs on S3 resume X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ba57bed537f1b86aee109daae2de30ded4f1d055;p=seabios.git smp: restore MSRs on S3 resume 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 Signed-off-by: Paolo Bonzini Signed-off-by: Kevin O'Connor (cherry picked from commit 54e3a88609da074aaae2f04e592026ebf82169dc) --- diff --git a/src/fw/smp.c b/src/fw/smp.c index 6e706e4..719d51d 100644 --- a/src/fw/smp.c +++ b/src/fw/smp.c @@ -36,6 +36,15 @@ wrmsr_smp(u32 index, u64 val) smp_msr_count++; } +static void +smp_write_msrs(void) +{ + // MTRR and MSR_IA32_FEATURE_CONTROL setup + int i; + for (i=0; i>24; dprintf(DEBUG_HDL_smp, "handle_smp: apic_id=%d\n", apic_id); - // MTRR and MSR_IA32_FEATURE_CONTROL setup - int i; - for (i=0; i