@@ -132,15 +132,12 @@ static inline void efi_set_pgd(struct mm_struct *mm)
* exception when invoking the EFI run-time services.
*/
update_saved_ttbr0(current, mm);
- uaccess_ttbr0_enable();
- post_ttbr_update_workaround();
} else {
/*
* Defer the switch to the current thread's TTBR0_EL1
* until uaccess_enable(). Restore the current
* thread's saved ttbr0 corresponding to its active_mm
*/
- uaccess_ttbr0_disable();
update_saved_ttbr0(current, current->active_mm);
}
}
@@ -177,6 +177,8 @@ bool arch_efi_call_virt_setup(void)
return false;
efi_virtmap_load();
+ uaccess_ttbr0_enable();
+ post_ttbr_update_workaround();
__efi_fpsimd_begin();
return true;
}
@@ -185,6 +187,7 @@ void arch_efi_call_virt_teardown(void)
{
__efi_fpsimd_end();
efi_virtmap_unload();
+ uaccess_ttbr0_disable();
up(&efi_rt_lock);
}