On 24 July 2018 at 17:29, Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> wrote: > On 2018-07-24 17:00:09 [+0200], Peter Zijlstra wrote: >> On Tue, Jul 24, 2018 at 04:35:09PM +0200, Sebastian Andrzej Siewior wrote: >> > I doubt that there any need to set ->active_mm. It is used by the >> > scheduler to keep track of the "currently used mm" so it can reuse one >> > for the kernel thread which does not own one and take a reference on it >> > so it does not go away while the thread (that borrows it) is active. >> >> > void efi_switch_mm(struct mm_struct *mm) >> > { >> > - task_lock(current); >> > efi_scratch.prev_mm = current->active_mm; >> > - current->active_mm = mm; >> > switch_mm(efi_scratch.prev_mm, mm, NULL); >> > - task_unlock(current); >> > } >> >> I think that's broken. Take for instance stuff like >> perf_callchain_user32() -> get_segment_base(). That looks at active_mm >> to get at the current LDT. > > right. I saw that briefly not sure why I dropped it. I have no idea > where the LDT points to but it probably sense to return EFI's version of > it. > >> Now, I'm not saying the whole perf vs EFI thing isn't already terminally >> wrecked, but the rule is that active_mm really should point at the >> current active mm, and the above breaks that. > Right. Even if we not perform a context switch. Okay. Will update that > part. > Please refer to what has been queued up in tip:efi/core. Sai has implemented a work queue for EFI calls so they occur from a kernel thread, and the mixed mode locking has been fixed as well. -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html