]> git.droids-corp.org - dpdk.git/commitdiff
eal/ppc: support ASan
authorDavid Christensen <drc@linux.vnet.ibm.com>
Mon, 15 Nov 2021 21:38:47 +0000 (13:38 -0800)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 16 Nov 2021 10:24:22 +0000 (11:24 +0100)
Add support for Address Sanitizer (ASan) for PPC/POWER architecture.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
config/meson.build
doc/guides/prog_guide/asan.rst
lib/eal/common/malloc_elem.h

index 3f5912fce7a4e71ae9ca121ca61dd6d85e372b8b..805d5d51d06ff4e9565adbd75eeb367e341bcb02 100644 (file)
@@ -433,7 +433,7 @@ if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address
         dpdk_extra_ldflags += '-lasan'
     endif
 
-    if is_linux and arch_subdir in ['x86', 'arm'] and dpdk_conf.get('RTE_ARCH_64')
+    if is_linux and dpdk_conf.get('RTE_ARCH_64')
         dpdk_conf.set10('RTE_MALLOC_ASAN', true)
     endif
 endif
index 28b2382fc7e3f17b0a38a2c01a8880e7a17b8578..9a6c5a7e4b7b398a4df82c4d32b6e4be01a628e4 100644 (file)
@@ -32,9 +32,9 @@ Example::
   - If the program is tested using cmdline, you may need to execute the
     "stty echo" command when an error occurs.
 
-ASan is aware of DPDK memory allocations, thanks to added instrumentation.
-This is enabled on x86_64 and arm64 at the moment.
-Other architectures may have to define ASAN_SHADOW_OFFSET.
+ASan is aware of DPDK memory allocations, thanks to added instrumentation, and
+is enabled on all 64 bit architectures for Linux. Other architectures may have
+to define ASAN_SHADOW_OFFSET.
 
 Example heap-buffer-overflow error
 ----------------------------------
index b982c83f70f4beef014b4d3ca1b5573cbdf7f16e..15d8ba7af27fde2f286afd1d6f6a38651c2aaaf2 100644 (file)
@@ -112,6 +112,8 @@ malloc_elem_cookies_ok(const struct malloc_elem *elem)
 #define ASAN_SHADOW_OFFSET    0x00007fff8000
 #elif defined(RTE_ARCH_ARM64)
 #define ASAN_SHADOW_OFFSET    0x001000000000
+#elif defined(RTE_ARCH_PPC_64)
+#define ASAN_SHADOW_OFFSET    0x020000000000
 #endif
 
 #define ASAN_SHADOW_GRAIN_SIZE 8