aboutsummaryrefslogtreecommitdiff
path: root/src/fw/smp.c
diff options
context:
space:
mode:
authorHaozhong Zhang <haozhong.zhang@intel.com>2016-06-22 14:53:24 +0800
committerGerd Hoffmann <kraxel@redhat.com>2016-07-01 14:02:12 +0200
commite2fc41e24ee0ada60fc511d60b15a41b294538be (patch)
tree73eb68fa3ef7a8e975e94196e0f8b90ead1df729 /src/fw/smp.c
parent8dada77beed057e93e36a1c67eb8b3dfe86398c9 (diff)
downloadseabios-hppa-e2fc41e24ee0ada60fc511d60b15a41b294538be.zip
seabios-hppa-e2fc41e24ee0ada60fc511d60b15a41b294538be.tar.gz
seabios-hppa-e2fc41e24ee0ada60fc511d60b15a41b294538be.tar.bz2
fw/msr_feature_control: add support to set MSR_IA32_FEATURE_CONTROLrel-1.9.3
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> (cherry picked from commit 20f83d5c7c0f9ae5f775b6701c205349abe003fb)
Diffstat (limited to 'src/fw/smp.c')
-rw-r--r--src/fw/smp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/fw/smp.c b/src/fw/smp.c
index 579acdb..6e706e4 100644
--- a/src/fw/smp.c
+++ b/src/fw/smp.c
@@ -10,7 +10,7 @@
#include "output.h" // dprintf
#include "romfile.h" // romfile_loadint
#include "stacks.h" // yield
-#include "util.h" // smp_setup
+#include "util.h" // smp_setup, msr_feature_control_setup
#include "x86.h" // wrmsr
#define APIC_ICR_LOW ((u8*)BUILD_APIC_ADDR + 0x300)
@@ -20,20 +20,20 @@
#define APIC_ENABLED 0x0100
-static struct { u32 index; u64 val; } smp_mtrr[32];
-static u32 smp_mtrr_count;
+static struct { u32 index; u64 val; } smp_msr[32];
+static u32 smp_msr_count;
void
wrmsr_smp(u32 index, u64 val)
{
wrmsr(index, val);
- if (smp_mtrr_count >= ARRAY_SIZE(smp_mtrr)) {
+ if (smp_msr_count >= ARRAY_SIZE(smp_msr)) {
warn_noalloc();
return;
}
- smp_mtrr[smp_mtrr_count].index = index;
- smp_mtrr[smp_mtrr_count].val = val;
- smp_mtrr_count++;
+ smp_msr[smp_msr_count].index = index;
+ smp_msr[smp_msr_count].val = val;
+ smp_msr_count++;
}
u32 MaxCountCPUs;
@@ -58,10 +58,10 @@ handle_smp(void)
u8 apic_id = ebx>>24;
dprintf(DEBUG_HDL_smp, "handle_smp: apic_id=%d\n", apic_id);
- // MTRR setup
+ // MTRR and MSR_IA32_FEATURE_CONTROL setup
int i;
- for (i=0; i<smp_mtrr_count; i++)
- wrmsr(smp_mtrr[i].index, smp_mtrr[i].val);
+ for (i=0; i<smp_msr_count; i++)
+ wrmsr(smp_msr[i].index, smp_msr[i].val);
// Set bit on FoundAPICIDs
FoundAPICIDs[apic_id/32] |= (1 << (apic_id % 32));