From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 69CCAA0032; Mon, 15 Nov 2021 19:41:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2EE1140E01; Mon, 15 Nov 2021 19:41:39 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by mails.dpdk.org (Postfix) with ESMTP id B6C4D40141 for ; Mon, 15 Nov 2021 19:41:37 +0100 (CET) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AFHTpvO002972; Mon, 15 Nov 2021 18:41:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=pQ7kmNctH3t9mYw/RdUkygZ5SuIKAblrw5R8I90l49c=; b=M5LB6pD6AhL/YTYXbchMgsm9qJ4eUCVeq+v/ZwB3l3y4FciRE78FkHKGHAxG3EEkSKo9 JK8FX92PaeLgbQtni1Ss+h/2K985+r4KtBancSEIeq1fWtQ8d+SqUo5Opky78PyupJCZ mVJ/MFadBRJwGxOiRN52qRIPTFIkaYx+oAE6zVOL1cp0BBOSgLJhlpc3f/qty8L1sxlt HvwzZJDddSjHn4B0wRAcQy1TUMjNXsdxO0Zvju46OtG6aXlsX4KeYZmAve8omnDLWR5C d99LGkfe+pThevnTDBMhqF7kXF6+2vBY1gLJjaukNRWcwDXfhz57uo49TZfjVU7dG0Qs yg== Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cbq34gya1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 18:41:36 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1AFIGcZP032201; Mon, 15 Nov 2021 18:41:36 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma02dal.us.ibm.com with ESMTP id 3ca50b50sh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 18:41:35 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1AFIfYqN56295826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Nov 2021 18:41:34 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9113A6E04E; Mon, 15 Nov 2021 18:41:34 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA85C6E050; Mon, 15 Nov 2021 18:41:33 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 15 Nov 2021 18:41:33 +0000 (GMT) From: David Christensen To: Bruce Richardson , Anatoly Burakov Cc: dev@dpdk.org, David Christensen Subject: [PATCH] eal/ppc: support ASan Date: Mon, 15 Nov 2021 10:41:05 -0800 Message-Id: <20211115184106.1406617-1-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 7KUzPLL1U11CebCHLmmhdHO4GD_N6b81 X-Proofpoint-GUID: 7KUzPLL1U11CebCHLmmhdHO4GD_N6b81 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-15_14,2021-11-15_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 clxscore=1011 bulkscore=0 mlxlogscore=858 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111150093 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add support for Address Sanitizer (ASan) for PPC/POWER architecture. Signed-off-by: David Christensen --- 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(-) diff --git a/config/meson.build b/config/meson.build index 3f5912fce7..ba433af7d9 100644 --- a/config/meson.build +++ b/config/meson.build @@ -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 diff --git a/doc/guides/prog_guide/asan.rst b/doc/guides/prog_guide/asan.rst index 28b2382fc7..7c1b59cfea 100644 --- a/doc/guides/prog_guide/asan.rst +++ b/doc/guides/prog_guide/asan.rst @@ -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 diff --git a/lib/eal/common/malloc_elem.h b/lib/eal/common/malloc_elem.h index b982c83f70..15d8ba7af2 100644 --- a/lib/eal/common/malloc_elem.h +++ b/lib/eal/common/malloc_elem.h @@ -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