.. | .. |
---|
619 | 619 | |
---|
620 | 620 | /* |
---|
621 | 621 | * Makes the calling thread switch to/from efi_mm context. Can be used |
---|
622 | | - * for SetVirtualAddressMap() i.e. current->active_mm == init_mm as well |
---|
623 | | - * as during efi runtime calls i.e current->active_mm == current_mm. |
---|
624 | | - * We are not mm_dropping()/mm_grabbing() any mm, because we are not |
---|
625 | | - * losing/creating any references. |
---|
| 622 | + * in a kernel thread and user context. Preemption needs to remain disabled |
---|
| 623 | + * while the EFI-mm is borrowed. mmgrab()/mmdrop() is not used because the mm |
---|
| 624 | + * can not change under us. |
---|
| 625 | + * It should be ensured that there are no concurent calls to this function. |
---|
626 | 626 | */ |
---|
627 | 627 | void efi_switch_mm(struct mm_struct *mm) |
---|
628 | 628 | { |
---|
629 | | - task_lock(current); |
---|
630 | 629 | efi_scratch.prev_mm = current->active_mm; |
---|
631 | 630 | current->active_mm = mm; |
---|
632 | 631 | switch_mm(efi_scratch.prev_mm, mm, NULL); |
---|
633 | | - task_unlock(current); |
---|
634 | 632 | } |
---|
635 | 633 | |
---|
636 | 634 | #ifdef CONFIG_EFI_MIXED |
---|