Skip to content

Commit

Permalink
additional SMI handling & disable option
Browse files Browse the repository at this point in the history
Signed-off-by: Filip Lewiński <[email protected]>
  • Loading branch information
filipleple committed Aug 22, 2024
1 parent 6c08c67 commit fe4b7ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/soc/intel/baytrail/lockdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <soc/device_nvs.h>
#include <soc/lockdown.h>
#include <bootstate.h>
#include <dasharo/options.h>

// huge overkill with the includes
// let's worry about that later, when it works
Expand Down Expand Up @@ -64,7 +65,8 @@ bool wpd_status(void)
}

void platform_lockdown_config(void *unused){
if(CONFIG(BOOTMEDIA_SMM_BWP)){
if(CONFIG(BOOTMEDIA_SMM_BWP) && is_smm_bwp_permitted()){
printk(BIOS_DEBUG, "Enabling SMM BWP\n");
enable_smm_bwp();
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/soc/intel/baytrail/smihandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <soc/nvs.h>
#include <soc/device_nvs.h>
#include <soc/lockdown.h>
#include <dasharo/options.h>

void southbridge_smi_set_eos(void)
{
Expand Down Expand Up @@ -268,12 +269,11 @@ static void southbridge_smi_store(void)
ret = smmstore_exec(sub_command, (void *)reg_ebx);
io_smi->rax = ret;

if (!wpd_status()) {
// set_insmm_sts(true);
//disable smm_bwp
//clear the smi
printk(BIOS_DEBUG, "flash SMI triggered\n");

if (!wpd_status() && is_smm_bwp_permitted()) {
printk(BIOS_DEBUG, "enabling smm bwp again\n");
enable_smm_bwp();
// set_insmm_sts(false);
}
}

Expand Down

0 comments on commit fe4b7ff

Please sign in to comment.