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 04270A0032; Mon, 15 Nov 2021 21:11:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6CBCE40E01; Mon, 15 Nov 2021 21:11:17 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id BA0D540141 for ; Mon, 15 Nov 2021 21:11:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637007075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Jy836KK8+SwZXm6iPdih1/vy6WHZagzqWQhzIe8l7t0=; b=iNISskmNnPSvTRag4h2Lx9KgRyl4sAGkT/YMD6fRyS8JcPclTmEV+6gr4Ve04EykQv4fzp S0q21Y46Ty+v8FKltqiWariGq2qYul2JeDC9+7B3yca5upxHoxBw2xArvst27Tzg1AtZis gntuJs9TwGozQitND/a87RPOIWoXm3I= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-23-rg0PFKE1PsuB0XZrwem66g-1; Mon, 15 Nov 2021 15:11:11 -0500 X-MC-Unique: rg0PFKE1PsuB0XZrwem66g-1 Received: by mail-lj1-f200.google.com with SMTP id z18-20020a2e8e92000000b00218e583aff1so5313567ljk.1 for ; Mon, 15 Nov 2021 12:11:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jy836KK8+SwZXm6iPdih1/vy6WHZagzqWQhzIe8l7t0=; b=ezR8gY/ugTisjBkBseNoRuFxGQhMH1+S7F17ASTxiKTa11ugGG9geqnv1TjTZ1EOq3 gTf4ZPnj6JfCS6othwxMccvSzozDQhd0RNB6tpvUI3S654poYmXz/9rmcOWLWTkj/LIt fst+svvP+UoNf7Xt9KhVMUvAfwg4rPaERnJf7tDm2QGnoYIxXgMgLK+xZa3SqkBFk8Zq WmqoOUWwCwguaeiEfOOYF3QSzVv3494rzRVLjgKCqpTCKwnCjYSphD2e+lJ8uDci4JZb 7xz1EadAv3FZnE0A2Bc4Hhsgjssc5tz/4xH53lHfPz3U21MDrvjh0PhdNGYh/bBFyQt9 97oQ== X-Gm-Message-State: AOAM533/5eiA2ss2yIZBqo+5wxY9Hw/oh6SH+5gKFpl3o6cdswDPaBcV U6XbjTuFpoHAkKyg1fmXVRFb7rIK9pLIyZ4JaJj29gSZjcQpN2M67dowMYL359JdHWzmXHCKTGb kpXbT+p7PfwEea4IZOsE= X-Received: by 2002:a05:6512:3f28:: with SMTP id y40mr1244653lfa.499.1637007070194; Mon, 15 Nov 2021 12:11:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFDvEr2UnBQHrZgVqN9xAH1IDeyC/W/sNtFCmdhy8AxU8yyY2IahN6OZsXAMzTK+m3AB4MC0XvlB6tjMJXvXY= X-Received: by 2002:a05:6512:3f28:: with SMTP id y40mr1244625lfa.499.1637007069914; Mon, 15 Nov 2021 12:11:09 -0800 (PST) MIME-Version: 1.0 References: <20211115184106.1406617-1-drc@linux.vnet.ibm.com> In-Reply-To: <20211115184106.1406617-1-drc@linux.vnet.ibm.com> From: David Marchand Date: Mon, 15 Nov 2021 21:10:59 +0100 Message-ID: Subject: Re: [PATCH] eal/ppc: support ASan To: David Christensen Cc: Bruce Richardson , Anatoly Burakov , dev Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 On Mon, Nov 15, 2021 at 7:41 PM David Christensen wrote: > > 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') Now that all supported 64-bits arches can have ASan, we can remove the check on arch_subdir. > 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. is enabled for 64-bits architectures on 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 > Thanks. -- David Marchand