Skip to content
Snippets Groups Projects
Unverified Commit 20109ee9 authored by Piotr Balcer's avatar Piotr Balcer Committed by GitHub
Browse files

Merge pull request #4875 from pbalcer/pmem-ppc64-wa-revert

pmem2: (+pmem) revert ppc64 workaround for valgrind
parents 60c1d425 41282500
No related branches found
No related tags found
No related merge requests found
......@@ -34,12 +34,6 @@ ppc_fence(void)
asm volatile(__SYNC(4) : : : "memory");
}
static void
ppc_fence_empty(void)
{
LOG(15, NULL);
}
static void
ppc_flush(const void *addr, size_t size)
{
......@@ -62,53 +56,11 @@ ppc_flush(const void *addr, size_t size)
}
}
static void
ppc_flush_msync(const void *addr, size_t len)
{
LOG(15, "addr %p len %zu", addr, len);
/* this implementation is copy of pmem_msync */
VALGRIND_DO_CHECK_MEM_IS_ADDRESSABLE(addr, len);
/*
* msync requires addr to be a multiple of pagesize but there are no
* requirements for len. Align addr down and change len so that
* [addr, addr + len) still contains initial range.
*/
/* increase len by the amount we gain when we round addr down */
len += (uintptr_t)addr & (Pagesize - 1);
/* round addr down to page boundary */
uintptr_t uptr = (uintptr_t)addr & ~((uintptr_t)Pagesize - 1);
/*
* msync accepts addresses aligned to page boundary, so we may sync
* more and part of it may have been marked as undefined/inaccessible
* Msyncing such memory is not a bug, so as a workaround temporarily
* disable error reporting.
*/
VALGRIND_DO_DISABLE_ERROR_REPORTING;
if (msync((void *)uptr, len, MS_SYNC) < 0)
ERR("!msync");
VALGRIND_DO_ENABLE_ERROR_REPORTING;
/* full flush */
VALGRIND_DO_PERSIST(uptr, len);
}
void
pmem2_arch_init(struct pmem2_arch_info *info)
{
LOG(3, "libpmem*: PPC64 support");
if (On_valgrind) {
info->fence = ppc_fence_empty;
info->flush = ppc_flush_msync;
} else {
info->fence = ppc_fence;
info->flush = ppc_flush;
}
info->fence = ppc_fence;
info->flush = ppc_flush;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment