qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] ARM page crossing inside insn? (Re: ARM ethernet fixes)


From: Antti P Miettinen
Subject: [Qemu-devel] ARM page crossing inside insn? (Re: ARM ethernet fixes)
Date: Mon, 19 Dec 2005 00:29:42 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Antti P Miettinen <address@hidden> writes:
> Looks like the kernel somehow ends up thinking that we are loading
> something from zero. Hmm.. the value being loaded to r1 is zero. So
> could this be related to crossing a page boundary in the middle of an
> instruction? But anyway - I'll try to debug this further..

Looks like it might be the page crossing. The below little program is
a  bit smaller test case. Without args, no segfault, with arg it
segfaults (inside ARM sysemu - at least for me):

#include <stdio.h>
#include <string.h>

long buf[8192/4];

int
main(int ac, char **av)
{
    unsigned long base = (unsigned long)(void *)(buf + 4096/4);
    unsigned long dummy;

    if (ac > 1)
    {
        base &= ~0xfff;
        base -= 4;
    }
    printf("buf: %p, base: 0x%08lx, dummy: 0x%08lx\n", buf, base, dummy);
    __asm__ __volatile__ ("ldmia %0,{%1,%2}"
                          : "=r" (base) : "0" (base), "r" (dummy));
    printf("base: 0x%08lx, dummy: 0x%08lx\n", base, dummy);
    return 0;
}

-- 
http://www.iki.fi/~ananaza/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]