Date: Thu, 25 Nov 2010 15:41:34 +0000 (UTC) From: Colin Percival <cperciva@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r215819 - head/sys/i386/xen Message-ID: <201011251541.oAPFfYfD009621@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cperciva Date: Thu Nov 25 15:41:34 2010 New Revision: 215819 URL: http://svn.freebsd.org/changeset/base/215819 Log: Work around paging bug. Somehow we seem to be ending up with entries in the TLB which don't correspond to ptes with PG_V set; prior to this commit I'm sometimes getting the wrong data when pages are loaded into the buffer cache (they're being loaded, but the missing TLB invalidation is causing the wrong data to be visible). Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Thu Nov 25 15:05:21 2010 (r215818) +++ head/sys/i386/xen/pmap.c Thu Nov 25 15:41:34 2010 (r215819) @@ -1292,7 +1292,19 @@ pmap_qenter(vm_offset_t sva, vm_page_t * mclp->args[0] = va; mclp->args[1] = (uint32_t)(pa & 0xffffffff); mclp->args[2] = (uint32_t)(pa >> 32); +#if 0 mclp->args[3] = (*pte & PG_V) ? UVMF_INVLPG|UVMF_ALL : 0; +#else + /* + * Somehow we seem to be ending up with pages which are in + * the TLB in spite of not having PG_V set, resulting in + * pages newly loaded into the bufcache not showing up + * immediately (i.e., accessing them provides the old data). + * As a workaround, always perform a TLB flush, even if the + * old page didn't have PG_V. + */ + mclp->args[3] = UVMF_INVLPG|UVMF_ALL; +#endif va += PAGE_SIZE; pte++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011251541.oAPFfYfD009621>