diff --git a/lib/sbi/sbi_fwft.c b/lib/sbi/sbi_fwft.c index a2aefb9a..373140b7 100644 --- a/lib/sbi/sbi_fwft.c +++ b/lib/sbi/sbi_fwft.c @@ -13,8 +13,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -167,7 +169,16 @@ static int fwft_adue_supported(struct fwft_config *conf) static int fwft_set_adue(struct fwft_config *conf, unsigned long value) { - return fwft_menvcfg_set_bit(value, ENVCFG_ADUE_SHIFT); + int res = fwft_menvcfg_set_bit(value, ENVCFG_ADUE_SHIFT); + + if (res == SBI_OK) { + __sbi_sfence_vma_all(); + + if (misa_extension('H')) + __sbi_hfence_gvma_all(); + } + + return res; } static int fwft_get_adue(struct fwft_config *conf, unsigned long *value)