diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-06 12:38:29 +0200 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2015-05-11 09:34:41 -0400 |
commit | 92f9b9189eb00da42a8bfcf26c664f48ee8d2868 (patch) | |
tree | 7ec447a930c8e0e6bf733980ddd1e00f4189473b /src/fw | |
parent | 945313cc84e79d7ae26b5ee7bc3142fa63ce826d (diff) | |
download | seabios-92f9b9189eb00da42a8bfcf26c664f48ee8d2868.tar.gz |
smm: ignore bits 16,18-31 of SMM revision ID
Bits 16-31 of the SMM revision ID are feature bits. We only need to
check that SMBASE relocation is supported, but do not care about other
features. In particular, this allows the SMM I/O instruction restart
feature to be present.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'src/fw')
-rw-r--r-- | src/fw/smm.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/fw/smm.c b/src/fw/smm.c index dabc6774..6cb484e7 100644 --- a/src/fw/smm.c +++ b/src/fw/smm.c @@ -18,8 +18,14 @@ #include "util.h" // smm_setup #include "x86.h" // wbinvd -#define SMM_REV_I32 0x00020000 -#define SMM_REV_I64 0x00020064 +/* + * Check SMM state save area format (bits 0-15) and require support + * for SMBASE relocation. + */ +#define SMM_REV_MASK 0x0002ffff + +#define SMM_REV_I32 0x00020000 +#define SMM_REV_I64 0x00020064 struct smm_state { union { @@ -62,9 +68,10 @@ handle_smi(u16 cs) if (smm == (void*)BUILD_SMM_INIT_ADDR) { // relocate SMBASE to 0xa0000 - if (smm->cpu.i32.smm_rev == SMM_REV_I32) { + u32 rev = smm->cpu.i32.smm_rev & SMM_REV_MASK; + if (rev == SMM_REV_I32) { smm->cpu.i32.smm_base = BUILD_SMM_ADDR; - } else if (smm->cpu.i64.smm_rev == SMM_REV_I64) { + } else if (rev == SMM_REV_I64) { smm->cpu.i64.smm_base = BUILD_SMM_ADDR; } else { warn_internalerror(); |