From 92f9b9189eb00da42a8bfcf26c664f48ee8d2868 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 6 May 2015 12:38:29 +0200 Subject: 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 --- src/fw/smm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/fw/smm.c') 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(); -- cgit