[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200907061616.12220.arnd@arndb.de>
Date: Mon, 6 Jul 2009 16:16:11 +0200
From: Arnd Bergmann <arnd@...db.de>
To: michal.simek@...alogix.com
Cc: Paul Mundt <lethal@...ux-sh.org>,
Linux Kernel list <linux-kernel@...r.kernel.org>,
LTP <ltp-list@...ts.sourceforge.net>,
John Williams <john.williams@...alogix.com>,
Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Grant Likely <grant.likely@...retlab.ca>,
subrata@...ux.vnet.ibm.com
Subject: Re: mmap syscall problem
On Monday 06 July 2009, Michal Simek wrote:
>
> > Not necessarily, even on platforms that manage aliases in hardware
> > mappings that violate the aliasing constraints can still result in
> > undefined behaviour, this really depends more on your cache controller
> > and MMU than anything else. I notice that microblaze sets SHMLBA to
> > PAGE_SIZE, you may want to see if this test still breaks after bumping it
> > up to something like PAGE_SIZE * 4.
> >
> Yes, test still break - behavior is the same. I don't have accurate
> information about MMU unit
> but I will ask a question about. We are able to turn off cache
> controller directly in HW.
There may still be a problem with data being queued in some write
buffers that don't get flushed before reading back from another
address.
What happens in a simple user space program that mmaps the same
page to two addresses? Something like
#include <sys/mman.h>
#include <fcntl.h>
int main(void)
{
int fd = open("existing-4k-file", O_RDWR);
char *p1 = mmap(0, 4096, PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0);
char *p2 = mmap(p1 + 4096, 4096, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_FIXED, fd, 0);
*p1 = 0xaa; *p2 = 0x55;
return *p1; /* returns 0xaa if broken, 0x55 if correct */
}
Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists