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 B5C65A0032; Mon, 15 Nov 2021 22:38:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E6E040E01; Mon, 15 Nov 2021 22:38:59 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by mails.dpdk.org (Postfix) with ESMTP id E835540141 for ; Mon, 15 Nov 2021 22:38:57 +0100 (CET) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AFKeAlh005171; Mon, 15 Nov 2021 21:38:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=FLY8Mw5w2aIO7zNz0NN4nlTER6M3qsFJifFLGDiRCWs=; b=j020scM+zmGV4vROayYY/dIJUYgRjjAVPPnLHNfUyH9nYYaBeWbk879K6yxP0OUq6if3 5uRZGgjuSQ3MMw59fArmxtgRQVH7ydtDi6SH4sG+8lMbtV8OLWIEteTqIzCmRUVCPqUl aiYday9NKaeKJOGiwyfc7oq+vT6QB9YliA4bKslSxNk7YU8pq8kk6fc81sUXaDy1XeKr zRLVpUyZe1GuN99Lcy/HMHtDWCZj4Q9NhRGjm6NzkVY+ExvbpDb6ZkPjBsiQ++Umdz17 pxWYNhH1k3wH8vY1gxHt4XxH1upO6CKQlC4uVuKuGdsCOL+UYj2ek+BSHmXEZ64Qasoa yQ== Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cbvwc3b96-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 21:38:56 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1AFLcg0V023200; Mon, 15 Nov 2021 21:38:56 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma04wdc.us.ibm.com with ESMTP id 3ca50a6tyy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 21:38:55 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1AFLcstG43712780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Nov 2021 21:38:55 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C9724AC066; Mon, 15 Nov 2021 21:38:54 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2DA0AC060; Mon, 15 Nov 2021 21:38:54 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 15 Nov 2021 21:38:54 +0000 (GMT) From: David Christensen To: Bruce Richardson , Anatoly Burakov Cc: dev@dpdk.org, David Christensen Subject: [PATCH v2] eal/ppc: support ASan Date: Mon, 15 Nov 2021 13:38:47 -0800 Message-Id: <20211115213847.1428592-1-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211115184106.1406617-1-drc@linux.vnet.ibm.com> References: <20211115184106.1406617-1-drc@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: JBFK0NmNVwStRRaVhE34l7aP72wWFeqo X-Proofpoint-GUID: JBFK0NmNVwStRRaVhE34l7aP72wWFeqo 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_15,2021-11-15_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 mlxscore=0 mlxlogscore=928 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111150109 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 --- 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(-) diff --git a/config/meson.build b/config/meson.build index 3f5912fce7..805d5d51d0 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 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..693fba36c8 100644 --- a/doc/guides/prog_guide/asan.rst +++ b/doc/guides/prog_guide/asan.rst @@ -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 ---------------------------------- 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