From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 8 May 2008 16:39:33 +0200 From: Hans Rosenfeld Subject: Re: [PATCH] x86: fix PAE pmd_bad bootup warning Message-ID: <20080508143933.GF12654@escobedo.amd.com> References: <20080506124946.GA2146@elte.hu> <20080506202201.GB12654@escobedo.amd.com> <1210106579.4747.51.camel@nimitz.home.sr71.net> <20080508143453.GE12654@escobedo.amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline In-Reply-To: <20080508143453.GE12654@escobedo.amd.com> Sender: owner-linux-mm@kvack.org Return-Path: To: Dave Hansen Cc: Hugh Dickins , Ingo Molnar , Jeff Chua , Thomas Gleixner , "H. Peter Anvin" , Gabriel C , Arjan van de Ven , Nishanth Aravamudan , linux-kernel@vger.kernel.org, linux-mm@kvack.org List-ID: --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, May 08, 2008 at 04:34:53PM +0200, Hans Rosenfeld wrote: > A stripped-down program exposing the leak is attached. It is now :) -- %SYSTEM-F-ANARCHISM, The operating system has been overthrown --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="hugetest.c" #include #include #include #include #include #include #include #include #include #include #include #include #include #define HUGEPAGES "/proc/sys/vm/nr_hugepages" #define HUGE_FILE "/mnt/huge/foobar" void *huge; int main(int argc, char **argv) { uint64_t ppte; int fd, maps; if ((fd = open(HUGEPAGES, O_WRONLY, 0)) == -1) { perror(HUGEPAGES); return 1; } write(fd, "20\n", 3); close(fd); if ((fd = open(HUGE_FILE, O_RDWR | O_CREAT, 0)) == -1) { perror(HUGE_FILE); return 1; } huge = mmap((void *) 0x1000000, 0x400000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0); if (huge == MAP_FAILED) { perror(HUGE_FILE); return 1; } fprintf(stderr, "huge: 0x%0.*" PRIxPTR "\n", sizeof(huge) * 2, huge); memset(huge, 1, 12345); if ((maps = open("/proc/self/pagemap", O_RDONLY, 0)) < 0) { perror("/proc/self/pagemap"); return 1; } if (pread(maps, &ppte, sizeof(ppte), ((uintptr_t) huge) >> 9) < 0) { perror("pread"); return 1; } fprintf(stderr, "ppte: 0x%0.16" PRIx64 "\n", ppte); return 0; } --3MwIy2ne0vdjdPXF-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org