Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42862 )
Change subject: sb,soc/intel: Remove redundant GNVS check ......................................................................
sb,soc/intel: Remove redundant GNVS check
With gnvs_ptr assigned in SMM module loader already, gnvs is always non-NULL on entry to SMI handler.
For !SMM_TSEG GNVS is not available for SMI handler.
Change-Id: Id5dbfa6089055ce14fd24fcb059714b845483617 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/soc/intel/broadwell/smihandler.c M src/soc/intel/common/block/smm/smitraphandler.c M src/southbridge/intel/bd82x6x/smihandler.c M src/southbridge/intel/i82801gx/smihandler.c M src/southbridge/intel/i82801ix/smihandler.c M src/southbridge/intel/i82801jx/smihandler.c M src/southbridge/intel/ibexpeak/smihandler.c M src/southbridge/intel/lynxpoint/smihandler.c 8 files changed, 8 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/42862/1
diff --git a/src/soc/intel/broadwell/smihandler.c b/src/soc/intel/broadwell/smihandler.c index 1180ee6..a9d0ea0 100644 --- a/src/soc/intel/broadwell/smihandler.c +++ b/src/soc/intel/broadwell/smihandler.c @@ -443,7 +443,7 @@
/* IOTRAP(3) SMI function call */ if (IOTRAP(3)) { - if (gnvs && gnvs->smif) + if (gnvs->smif) io_trap_handler(gnvs->smif); // call function smif return; } diff --git a/src/soc/intel/common/block/smm/smitraphandler.c b/src/soc/intel/common/block/smm/smitraphandler.c index 99825f1..c6e28af 100644 --- a/src/soc/intel/common/block/smm/smitraphandler.c +++ b/src/soc/intel/common/block/smm/smitraphandler.c @@ -75,7 +75,7 @@
/* IOTRAP(3) SMI function call */ if (IOTRAP(3)) { - if (gnvs && gnvs->smif) + if (gnvs->smif) io_trap_handler(gnvs->smif); return; } diff --git a/src/southbridge/intel/bd82x6x/smihandler.c b/src/southbridge/intel/bd82x6x/smihandler.c index e24a53e..f6fbd20 100644 --- a/src/southbridge/intel/bd82x6x/smihandler.c +++ b/src/southbridge/intel/bd82x6x/smihandler.c @@ -143,7 +143,7 @@
/* IOTRAP(3) SMI function call */ if (IOTRAP(3)) { - if (gnvs && gnvs->smif) + if (gnvs->smif) io_trap_handler(gnvs->smif); // call function smif return; } diff --git a/src/southbridge/intel/i82801gx/smihandler.c b/src/southbridge/intel/i82801gx/smihandler.c index aa92781..b6dbf6b 100644 --- a/src/southbridge/intel/i82801gx/smihandler.c +++ b/src/southbridge/intel/i82801gx/smihandler.c @@ -56,7 +56,7 @@
/* IOTRAP(3) SMI function call */ if (IOTRAP(3)) { - if (gnvs && gnvs->smif) + if (gnvs->smif) io_trap_handler(gnvs->smif); // call function smif return; } diff --git a/src/southbridge/intel/i82801ix/smihandler.c b/src/southbridge/intel/i82801ix/smihandler.c index 3ca507f..894a581 100644 --- a/src/southbridge/intel/i82801ix/smihandler.c +++ b/src/southbridge/intel/i82801ix/smihandler.c @@ -9,11 +9,6 @@
#include "nvs.h"
-#if !CONFIG(SMM_TSEG) -/* For qemu/x86-q35 to build properly. */ -struct global_nvs *gnvs; -#endif - int southbridge_io_trap_handler(int smif) { switch (smif) { @@ -50,7 +45,7 @@
/* IOTRAP(3) SMI function call */ if (IOTRAP(3)) { - if (gnvs && gnvs->smif) + if (CONFIG(SMM_TSEG) && gnvs->smif) io_trap_handler(gnvs->smif); // call function smif return; } diff --git a/src/southbridge/intel/i82801jx/smihandler.c b/src/southbridge/intel/i82801jx/smihandler.c index 8e9b42a..a0bc7d4 100644 --- a/src/southbridge/intel/i82801jx/smihandler.c +++ b/src/southbridge/intel/i82801jx/smihandler.c @@ -50,7 +50,7 @@
/* IOTRAP(3) SMI function call */ if (IOTRAP(3)) { - if (gnvs && gnvs->smif) + if (gnvs->smif) io_trap_handler(gnvs->smif); // call function smif return; } diff --git a/src/southbridge/intel/ibexpeak/smihandler.c b/src/southbridge/intel/ibexpeak/smihandler.c index 5bf18c9..0bfe414 100644 --- a/src/southbridge/intel/ibexpeak/smihandler.c +++ b/src/southbridge/intel/ibexpeak/smihandler.c @@ -110,7 +110,7 @@
/* IOTRAP(3) SMI function call */ if (IOTRAP(3)) { - if (gnvs && gnvs->smif) + if (gnvs->smif) io_trap_handler(gnvs->smif); // call function smif return; } diff --git a/src/southbridge/intel/lynxpoint/smihandler.c b/src/southbridge/intel/lynxpoint/smihandler.c index 2a440c0..6676c9dc 100644 --- a/src/southbridge/intel/lynxpoint/smihandler.c +++ b/src/southbridge/intel/lynxpoint/smihandler.c @@ -429,7 +429,7 @@
/* IOTRAP(3) SMI function call */ if (IOTRAP(3)) { - if (gnvs && gnvs->smif) + if (gnvs->smif) io_trap_handler(gnvs->smif); // call function smif return; }