[openib-general] Re: mstflint - test1

Michael S. Tsirkin mst at mellanox.co.il
Thu Jan 13 00:44:16 PST 2005


Hello!
Quoting r. Tom Duffy (tduffy at sun.com) "Re: mstflint - test1":
> On Wed, 2005-01-12 at 12:51 +0200, Michael S. Tsirkin wrote:
> > OK.
> > Tom, here's a simple test.
> > After this we will know for sure whether mmap works, or not.
> > I hard-coded the physical memory offset to
> > 1ff00100000 (this seems to be what you have), you can find out the
> > real offset
> > for the first resource from lspci -vv or from cat /proc/iomem.
> > 
> > You have to be root to run.
> 
> Bummer...
> 
> Bus error (core dumped)
> 
> tat:~# strace ./mstflint-test
> execve("./mstflint-test", ["./mstflint-test"], [/* 14 vars */]) = 0
> uname({sys="Linux", node="tat", ...})   = 0
> brk(0)                                  = 0x22000
> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
> directory)
> open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
> directory)
> open("/etc/ld.so.cache", O_RDONLY)      = 3
> fstat64(3, {st_mode=S_IFREG|0644, st_size=53602, ...}) = 0
> mmap(NULL, 53602, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7002c000
> close(3)                                = 0
> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
> directory)
> open("/lib/libc.so.6", O_RDONLY)        = 3
> read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\2\0\0\0\1\0\1\316"...,
> 512) = 512
> fstat64(3, {st_mode=S_IFREG|0644, st_size=1291948, ...}) = 0
> mmap(NULL, 1361864, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x7003c000
> mprotect(0x70170000, 100296, PROT_NONE) = 0
> mmap(0x7017c000, 49152, PROT_READ|PROT_WRITE|PROT_EXEC,
> MAP_PRIVATE|MAP_FIXED, 3, 0x130000) = 0x7017c000
> mmap(0x70188000, 1992, PROT_READ|PROT_WRITE|PROT_EXEC,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x70188000
> close(3)                                = 0
> munmap(0x7002c000, 53602)               = 0
> open("/dev/mem", O_RDWR|O_SYNC|O_LARGEFILE) = 3
> mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0x1ff00100) =
> 0x7018c000
> --- SIGBUS (Bus error) @ 0 (0) ---
> 
> I added a sleep right after mmap so I could look at the proc maps, and
> this is what I saw:
> 
> tat:~# cat /proc/7234/maps
> 00010000-00012000 r-xp 00000000 08:01 749542
> /root/mstflint-test
> 00020000-00022000 rwxp 00000000 08:01 749542
> /root/mstflint-test
> 70000000-7001a000 r-xp 00000000 08:01 700792
> /lib/ld-2.3.2.so
> 70028000-7002a000 rwxp 00018000 08:01 700792
> /lib/ld-2.3.2.so
> 7003c000-70170000 r-xp 00000000 08:01 700795
> /lib/libc-2.3.2.so
> 70170000-7017c000 ---p 00134000 08:01 700795
> /lib/libc-2.3.2.so
> 7017c000-70188000 rwxp 00130000 08:01 700795
> /lib/libc-2.3.2.so
> 70188000-7018a000 rwxp 70188000 00:00 0
> 7018c000-7028c000 rw-s 1ff00100000 00:0d 316
> /dev/mem
> efffe000-f0000000 rw-p efffe000 00:00 0
> 
> If there is a problem with mmap(/dev/mem), I will see if anybody has a
> clue on sparclinux at vger.
> 
> -tduffy

So it seems (I assume 1ff00100000 *is* the resource address).

Also, strace seems  to be broken: we are passing the last parameter
0x1ff00100000ULL explicitly, but strace shows 0x1ff00100.

mst



More information about the general mailing list