checkpoint/i386: use task_user_gs to checkpoint gs
PATCH 1/1 checkpoint/i386: use task_user_gs to checkpoint gs
Depending on the setting of CONFIG_X86_32_LAZY_GS, gs may be saved in the thread_struct or in pt_regs. Use the task_user_gs() accessor to checkpoint gs appropriately for both cases. This solves post-restart program crashes when CONFIG_X86_32_LAZY_GS=n.
--- arch/x86/kernel/checkpoint_32.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-)
arch/x86/kernel/checkpoint_32.c +1 -7
@@ -86,7 +86,6 @@ static unsigned short decode_segment(__u16 seg)void save_cpu_regs (struct ckpt_hdr_cpu *h,struct task_struct *t) { -struct thread_struct *thread = &t->thread;struct pt_regs *regs =task_pt_regs (t);unsigned long _gs;
@@ -108,15 +107,10 @@ void save_cpu_regs(struct ckpt_hdr_cpu *h, struct task_struct *t) h->ds =encode_segment (regs->ds); h->es =encode_segment (regs->es); -/* -* for checkpoint in process context (from within a container) -* the GS segment register should be saved from the hardware; -* otherwise it is already saved on the thread structure -*/ if (t == current) _gs =get_user_gs (regs);else - _gs = thread->gs; + _gs =task_user_gs (t); h->fsindex =encode_segment (regs->fs); h->gsindex =encode_segment (_gs);
Signature · 1 line
1.6.6.1
A message that is not in the archive (sent off-list or not yet received): 1270597061-26041-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org
Quoted 4 lines · Nathan Lynch
Depending on the setting of
CONFIG_X86_32_LAZY_GS, gs may be saved in thethread_structor inpt_regs. Use thetask_user_gs()accessor to checkpoint gs appropriately for both cases. This solves post-restart program crashes whenCONFIG_X86_32_LAZY_GS=n.
Hey Oren,
We noticed this one isn't in ckpt-v21-rc7, so restart is failing on some i386 configurations still.