tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [ARM32] panic when sshd responding



On Mon, Jun 16, 2008 at 11:54 AM, Chris Gilbert <chris%dokein.co.uk@localhost> 
wrote:
> Interesting that in the second case there's no size: line, so I assme
> it's not called sodoloanfree.
>
> Any chance of the diff you used to get this output?
Yes, of course!
Look bellow.


diff --git a/sys/arch/arm/arm32/pmap.c b/sys/arch/arm/arm32/pmap.c
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 04b5327..3f3b15e 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -257,6 +257,7 @@ sodoloanfree(struct vm_page **pgs, void *buf, size_t size)
        len = eva - sva;
        npgs = len >> PAGE_SHIFT;

+printf("size: %ld[%d] se: %p-%p = %d\n", size, (int) len, (void *)
sva, (void *) eva, npgs);
        pmap_kremove(sva, len);
        pmap_update(pmap_kernel());
        uvm_unloan(pgs, npgs, UVM_LOAN_TOPAGE);
@@ -365,6 +366,7 @@ sosend_loan(struct socket *so, struct uio *uio,
struct mbuf *m, long space)
        if (lva == 0)
                return 0;

+printf("sp: %ld[%d] se: %p-%p = %d\n", space, (int) len, (void *)
sva, (void *) eva, npgs);
        error = uvm_loan(&uio->uio_vmspace->vm_map, sva, len,
            m->m_ext.ext_pgs, UVM_LOAN_TOPAGE);
        if (error) {
@@ -373,8 +375,11 @@ sosend_loan(struct socket *so, struct uio *uio,
struct mbuf *m, long space)
        }

        for (i = 0, va = lva; i < npgs; i++, va += PAGE_SIZE)
+{
+printf("pmap_kenter_pa: va 0x%08lx, pa 0x%08lx, prot 0x%x\n", va,
VM_PAGE_TO_PHYS(m->m_ext.ext_pgs[i]), VM_PROT_READ);
                pmap_kenter_pa(va, VM_PAGE_TO_PHYS(m->m_ext.ext_pgs[i]),
                    VM_PROT_READ);
+}
        pmap_update(pmap_kernel());

        lva += (vaddr_t) iov->iov_base & PAGE_MASK;
@@ -820,7 +825,8 @@ sosend(struct socket *so, struct mbuf *addr,
struct uio *uio, struct mbuf *top,
        struct mbuf     **mp, *m;
        struct proc     *p;
        long            space, len, resid, clen, mlen;
-       int             error, s, dontroute, atomic;
+       int             error = 0, s, dontroute, atomic;
+int mycounter = 1;

        p = l->l_proc;
        sodopendfree();
@@ -923,6 +929,7 @@ sosend(struct socket *so, struct mbuf *addr,
struct uio *uio, struct mbuf *top,
                                        mlen = MLEN;
                                }
                                MCLAIM(m, so->so_snd.sb_mowner);
+printf("mycounter: %d\n", mycounter++);
                                if (sock_loan_thresh >= 0 &&
                                    uio->uio_iov->iov_len >= sock_loan_thresh &&
                                    space >= sock_loan_thresh &&
@@ -959,6 +966,7 @@ sosend(struct socket *so, struct mbuf *addr,
struct uio *uio, struct mbuf *top,
                                }
                                error = uiomove(mtod(m, void *), (int)len, uio);
  have_data:
+printf("mc: %d len: %ld sp: %ld resid: %d\n", mycounter, len, space,
(int) uio->uio_resid);
                                resid = uio->uio_resid;
                                m->m_len = len;
                                *mp = m;


P.S. error = 0 doesn't change behavior (just hunting on witch).

-- 
With Best Regards,
Andy Shevchenko


Home | Main Index | Thread Index | Old Index