DDB and SMP causes Unaligned Reference

Alan Robinson alan.robinson at fujitsu-siemens.com
Tue Jun 10 02:27:47 PDT 2003


On Tue, Jun 10, 2003 at 10:53:06AM +0200, Alan Robinson wrote:
> On Fri, Jun 06, 2003 at 11:20:15AM -0700, Marcel Moolenaar wrote:
> > 
> > We don't set pc_pcb on ia64. The line above should read:
> > 	savectx(curthread->td_pcb);
> > 
> Tried it.
> > 
> > Try it and let me know if it works. I'll commit it then.
> > 
> Works.
> Works.
> (It still causes the strange double entry into DDB)
> 
> It would also be a good idea to remove the unneeded pc_pcb line with its
> incorrect comment from src/sys/ia64/include/pcpu.h
> 

I deleted the pc_pcb line from src/sys/ia64/include/pcpu.h and 
much to my surprise got a compile error in src/sys/ia64/ia64/machdep.c 
where the function cpu_pcpu_init does indeed set pc_pcb:

void
cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
{
        KASSERT(size >= sizeof(struct pcpu) + sizeof(struct pcb),
            ("%s: too small an allocation for pcpu", __func__));
        pcpu->pc_pcb = (void*)(pcpu+1);
}

so much for it not being set!. It is set, just the alignment of
struct pcb is wrong.

Is your suggested (and working) change 
> > 	savectx(curthread->td_pcb);
still correct ?

Alan


More information about the freebsd-ia64 mailing list