]> xenbits.xensource.com Git - seabios.git/commitdiff
smm: ignore bits 16,18-31 of SMM revision ID
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 6 May 2015 10:38:29 +0000 (12:38 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 15 Jun 2015 12:18:57 +0000 (14:18 +0200)
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>
(cherry picked from commit 92f9b9189eb00da42a8bfcf26c664f48ee8d2868)

src/fw/smm.c

index dabc67744274068034e0baa74c55bbfc85ce2b8d..6cb484e7e579d7f01ce6fa0322e73f605fa78f99 100644 (file)
 #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();