All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpoint/i386: use task_user_gs to checkpoint gs
@ 2010-04-06 23:37 Nathan Lynch
       [not found] ` <1270597061-26041-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Lynch @ 2010-04-06 23:37 UTC (permalink / raw)
  To: Oren Laadan; +Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

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.

Tested-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Nathan Lynch <ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
---
 arch/x86/kernel/checkpoint_32.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/checkpoint_32.c b/arch/x86/kernel/checkpoint_32.c
index 32cde34..c4ce450 100644
--- a/arch/x86/kernel/checkpoint_32.c
+++ b/arch/x86/kernel/checkpoint_32.c
@@ -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);
-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] checkpoint/i386: use task_user_gs to checkpoint gs
       [not found] ` <1270597061-26041-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
@ 2010-04-29 21:13   ` Nathan Lynch
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Lynch @ 2010-04-29 21:13 UTC (permalink / raw)
  To: Oren Laadan; +Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On Tue, 2010-04-06 at 18:37 -0500, Nathan Lynch wrote:
> 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.

Hey Oren,

We noticed this one isn't in ckpt-v21-rc7, so restart is failing on some
i386 configurations still.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-29 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-06 23:37 [PATCH] checkpoint/i386: use task_user_gs to checkpoint gs Nathan Lynch
     [not found] ` <1270597061-26041-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2010-04-29 21:13   ` Nathan Lynch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.