Skip to content
Snippets Groups Projects
Commit 41282500 authored by Piotr Balcer's avatar Piotr Balcer
Browse files

pmem2: (+pmem) revert ppc64 workaround for valgrind

This caused more issues then it solved... The CI environment simply
has to have a new enough valgrind.
parent b86f9653
No related branches found
No related tags found
Loading
...@@ -34,12 +34,6 @@ ppc_fence(void) ...@@ -34,12 +34,6 @@ ppc_fence(void)
asm volatile(__SYNC(4) : : : "memory"); asm volatile(__SYNC(4) : : : "memory");
} }
static void
ppc_fence_empty(void)
{
LOG(15, NULL);
}
static void static void
ppc_flush(const void *addr, size_t size) ppc_flush(const void *addr, size_t size)
{ {
...@@ -62,53 +56,11 @@ 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 void
pmem2_arch_init(struct pmem2_arch_info *info) pmem2_arch_init(struct pmem2_arch_info *info)
{ {
LOG(3, "libpmem*: PPC64 support"); LOG(3, "libpmem*: PPC64 support");
if (On_valgrind) { info->fence = ppc_fence;
info->fence = ppc_fence_empty; info->flush = ppc_flush;
info->flush = ppc_flush_msync;
} else {
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