Fix long-standing save/restore bug on x86-64.

Signed-off-by: Steven Hand <steven@xensource.com>
This commit is contained in:
smh22@firebug.cl.cam.ac.uk committed 2006-04-06 16:15:28 +01:00
1 parent deecd6adc0
commit 9444c07bdb
1 file changed
+19
@@ -85,6 +85,23 @@ void smp_resume(void);
#define smp_resume() ((void)0)
#endif
/* Ensure we run on the idle task page tables so that we will
switch page tables before running user space. This is needed
on architectures with separate kernel and user page tables
because the user page table pointer is not saved/restored. */
static void switch_idle_mm(void)
{
struct mm_struct *mm = current->active_mm;
if (mm == &init_mm)
return;
atomic_inc(&init_mm.mm_count);
switch_mm(mm, &init_mm, current);
current->active_mm = &init_mm;
mmdrop(mm);
}
static int __do_suspend(void *ignore)
{
int i, j, k, fpp, err;
@@ -164,6 +181,8 @@ static int __do_suspend(void *ignore)
time_resume();
switch_idle_mm();
__sti();
xencons_resume();
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.