[PATCH] ppc64: User tasks must have a valid thread.regs
Anton Blanchard
anton at samba.org
Tue Sep 21 10:50:44 EST 2004
Hi,
> OK, but why wasn't SMP affected? SMP doesn't have lazy save/restore,
> it should have hit the null regs pointer "sooner".
Because the FPR space is allocated for all tasks in the thread struct:
struct thread_struct {
unsigned long ksp; /* Kernel stack pointer */
unsigned long ksp_vsid;
struct pt_regs *regs; /* Pointer to saved register state */
mm_segment_t fs; /* for get_fs() validation */
double fpr[32]; /* Complete floating point set */
unsigned long fpscr; /* Floating point status (plus pad) */
unsigned long fpexc_mode; /* Floating-point exception mode */
unsigned long pad[3]; /* was saved_msr, saved_softe */
#ifdef CONFIG_ALTIVEC
/* Complete AltiVec register set */
vector128 vr[32] __attribute((aligned(16)));
/* AltiVec status */
vector128 vscr __attribute((aligned(16)));
unsigned long vrsave;
int used_vr; /* set if process has used altivec */
#endif /* CONFIG_ALTIVEC */
};
The SMP lazy FP stuff doesnt touch stuff in thread->regs, but the UP
one does. It hits thread->regs.msr for the previous FP task I think.
Anton
More information about the Linuxppc64-dev
mailing list