eal/ppc: support ASan
PATCH 1/1 eal/ppc: support ASan
Add support for Address Sanitizer (ASan) for PPC/POWER architecture.
--- config/meson.build | 2 +- doc/guides/prog_guide/asan.rst | 4 ++-- lib/eal/common/malloc_elem.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-)
config/meson.build +1 -1
@@ -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 arch_subdir in ['x86', 'arm', 'ppc'] and dpdk_conf.get('RTE_ARCH_64') dpdk_conf.set10('RTE_MALLOC_ASAN', true) endif endif
doc/guides/prog_guide/asan.rst +2 -2
@@ -32,8 +32,8 @@ 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. +ASan is aware of DPDK memory allocations, thanks to added instrumentation, and +is enabled on x86_64, arm64, and PPC64 architectures. Other architectures may have to define ASAN_SHADOW_OFFSET. Example heap-buffer-overflow error
lib/eal/common/malloc_elem.h +2 -0
@@ -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
Signature · 1 line
2.27.0
Quoted 15 lines · David Christensen
Add support for Address Sanitizer (ASan) for PPC/POWER architecture.
Signed-off-by David Christensen <[email protected]>--- config/meson.build | 2 +- doc/guides/prog_guide/asan.rst | 4 ++-- lib/eal/common/malloc_elem.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-)config/meson.build +0
-0
config/meson.build if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address · line 436
Quoted 5 lines
config/meson.build +1
-1@@ -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 arch_subdir in ['x86', 'arm', 'ppc'] and dpdk_conf.get('RTE_ARCH_64')
Now that all supported 64-bits arches can have ASan, we can remove the check on arch_subdir.
Quoted 8 lines
config/meson.build +0
-0dpdk_conf.set10('RTE_MALLOC_ASAN', true) endif endifdoc/guides/prog_guide/asan.rst +0
-0
doc/guides/prog_guide/asan.rst Example:: · line 36
Quoted 7 lines
doc/guides/prog_guide/asan.rst +2
-2@@ -32,8 +32,8 @@ 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. +ASan is aware of DPDK memory allocations, thanks to added instrumentation, and +is enabled on x86_64, arm64, and PPC64 architectures.
is enabled for 64-bits architectures on Linux.
Quoted 17 lines
doc/guides/prog_guide/asan.rst +0
-0Other architectures may have to define ASAN_SHADOW_OFFSET. Example heap-buffer-overflow errorlib/eal/common/malloc_elem.h +2
-1@@ -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 --
Quoted 2 lines
2.27.0
Thanks.
Signature · 1 line
David Marchand
PATCH v2 1/1 eal/ppc: support ASan
In reply to David ChristensenAdd support for Address Sanitizer (ASan) for PPC/POWER architecture.
---
v2: Removed architecture test, modified programmer's guide text
config/meson.build | 2 +- doc/guides/prog_guide/asan.rst | 6 +++--- lib/eal/common/malloc_elem.h | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-)
config/meson.build +1 -1
@@ -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
doc/guides/prog_guide/asan.rst +3 -3
@@ -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 ----------------------------------
lib/eal/common/malloc_elem.h +2 -0
@@ -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
--
2.27.0
Quoted 4 lines · David Christensen
Add support for Address Sanitizer (ASan) for PPC/POWER architecture.
Signed-off-by David Christensen <[email protected]>
Signature · 1 line
David Marchand
David Marchand
AppliedQuoted 8 lines · David Marchand
Quoted 4 lines · David Christensen
Add support for Address Sanitizer (ASan) for PPC/POWER architecture.
Signed-off-by David Christensen <[email protected]>Reviewed-by David Marchand <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand