From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id EEE9DA0C4C;
	Tue, 21 Sep 2021 12:15:34 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B108740683;
	Tue, 21 Sep 2021 12:15:34 +0200 (CEST)
Received: from mail-il1-f171.google.com (mail-il1-f171.google.com
 [209.85.166.171])
 by mails.dpdk.org (Postfix) with ESMTP id 31B3E4003C
 for <dev@dpdk.org>; Tue, 21 Sep 2021 12:15:33 +0200 (CEST)
Received: by mail-il1-f171.google.com with SMTP id b15so21989766ils.10
 for <dev@dpdk.org>; Tue, 21 Sep 2021 03:15:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=hWo3ypOapb2fEifI/DwEYjADx9fhMLJIdMnITNYZcoo=;
 b=EweHjxJhbUTIwt6G+2nJEp/I6CupS05Ps/m8fgpS8QgCU3LArgMYVrfta+rs5llIdl
 JWLKES+40jboHb1PIsyjwwkZvXinMNXqMJzI1HH3/sQdgQKtknAnvWHBT+prH9l3KCPw
 qAc7GIaeAdW98kRqJmOmu3S+efKigSYWTk66PW3v9z4OlEzamWR/3W1A+trkxyDrWnGM
 bViSDLwF6C9WjXsdEKaw2xNrSiEttN8/H84OpBO9FK6UvEQxSwMdA/JZuXPYaHXLUaZR
 8fjafy2sfSXKmatBcFwrhfc6X459eFO61dM/QdNEkxw6sUBmoIWaNcxmcywtC/gAiQpJ
 iMjQ==
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=hWo3ypOapb2fEifI/DwEYjADx9fhMLJIdMnITNYZcoo=;
 b=qNzv9U2A+M1fHpvxRcRCCxfRHVQMTMO5pvYV/SuQt7juLQ5wq+WBW+gKcLSiqM2yZY
 w1g5v978D4yGriAIYt+DKWco7quzXU1SBSMpxbJA2e9NYIIkq+4CwMOGZc9fdfXBmkHO
 wQsd0A6ZhE0VEwVNnwyFxRfr5Xh3+Kdyh0S2rabZRdjCwiFVOcCWEsD5rYaFfDh9bZhP
 ENN1jLaBbRKd3cFt1siJkK8HBfhSY/WwyKu4JL9x5HAlBBE2Rdk13s+gkJExKLDtW24D
 KxEGPd0FmLTmbLTglwlajiTFelPMSnWcVnoohKwEfVvignEfXjfxTAYI5Cum6xtcv+ws
 v2lw==
X-Gm-Message-State: AOAM532jjWRL4edBlIxOo6kQo76jf5ECkk68K71yNDs3oO9b0Ga8ln3k
 OauZs8xSCcQUlOPAGGV4uXTun6rk7wbZ8dwpUXw=
X-Google-Smtp-Source: ABdhPJzNrflLXMYvEIqHbjCrMSIjiOKZ/QBUhIcJ9yhjPG34QwS4mdnU4AjmGPJN9a6ki17XZp5L/X5dTqFwxnMpJPM=
X-Received: by 2002:a05:6e02:1b03:: with SMTP id
 i3mr2197586ilv.251.1632219332505; 
 Tue, 21 Sep 2021 03:15:32 -0700 (PDT)
MIME-Version: 1.0
References: <20210910020147.148019-1-zhihongx.peng@intel.com>
 <c6573382-e6d1-82a7-5848-02c93fba755f@linux.vnet.ibm.com>
 <DM8PR11MB5591D6D29AEFB458212C75ACF0D99@DM8PR11MB5591.namprd11.prod.outlook.com>
 <61dd38ed-b570-d7d5-e839-1f845e28e932@linux.vnet.ibm.com>
 <DM8PR11MB5591CC802481FBF8455382F2F0DE9@DM8PR11MB5591.namprd11.prod.outlook.com>
 <261b1c48-3794-1b42-a794-be76819049ab@linux.vnet.ibm.com>
 <CAJFAV8ym+tuj_QD4K-HMo6XvBy=SXYOzxjdav8jG9BpCt9GWcw@mail.gmail.com>
In-Reply-To: <CAJFAV8ym+tuj_QD4K-HMo6XvBy=SXYOzxjdav8jG9BpCt9GWcw@mail.gmail.com>
From: Jerin Jacob <jerinjacobk@gmail.com>
Date: Tue, 21 Sep 2021 15:45:06 +0530
Message-ID: <CALBAE1NJh0VE+OxBu29UaMf+03oG80dQTsPFLb0xdH_zfc=oGg@mail.gmail.com>
To: David Marchand <david.marchand@redhat.com>
Cc: "Peng, ZhihongX" <zhihongx.peng@intel.com>, "Burakov,
 Anatoly" <anatoly.burakov@intel.com>, 
 David Christensen <drc@linux.vnet.ibm.com>, 
 "Ananyev, Konstantin" <konstantin.ananyev@intel.com>, 
 "stephen@networkplumber.org" <stephen@networkplumber.org>,
 "dev@dpdk.org" <dev@dpdk.org>, "Lin, Xueqin" <xueqin.lin@intel.com>
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH] Enable AddressSanitizer feature on DPDK
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Tue, Sep 21, 2021 at 1:59 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Mon, Sep 20, 2021 at 9:41 PM David Christensen
> <drc@linux.vnet.ibm.com> wrote:
> > >>> We do not have a ppc platform, so there is no adaptation.
> > >>> doc/guides/prog_guide/asan.rst has stated that we currently only
> > >>> support Linux x86_64. You can adapt according to the following documents,
> > >> the main work is to modify the base address according to the platform.
> > >>> Documents:
> > >>> https://github.com/google/sanitizers/wiki/AddressSanitizer
> > >>> https://github.com/llvm/llvm-project/tree/main/compiler-rt
> > >>
> > >> Understand you don't have such a platform.  I looked into it and suggest the
> > >> following change in lib/eal/common/malloc_elem.h:
> > >>
> > >> #define ASAN_SHADOW_GRAIN_SIZE  8
> > >> #define ASAN_SHADOW_SCALE       3
> > >> #ifdef RTE_ARCH_PPC_64
> > >> #define ASAN_SHADOW_OFFSET 0x020000000000 #else #define
> > >> ASAN_SHADOW_OFFSET 0x00007fff8000 #endif
> > >> #define ASAN_MEM_FREE_FLAG      0xfd
> > >> #define ASAN_MEM_REDZONE_FLAG   0xfa
> > >> #define ASAN_MEM_TO_SHADOW(mem) (((mem) >>
> > >> ASAN_SHADOW_SCALE) +
> > >> ASAN_SHADOW_OFFSET)
> > >>
> > >>
> > >> This resolves the segmentation error I receive.
> > >>
> > >> Dave
> > >>
> > >
> > > Great, good information for dpdk asan tool. Because we can't do many tests,
> > > so when this patch is merged into the main line, you can submit the ppc
> > > architecture patch.
> >
> > If your argument is that this is x86 only then please ensure it can't be
> > enabled on non-x86 platforms such as ARM and PPC.  I can then easily
> > submit a follow-on patch to enable for PPC.
> >
> > As the patch currently stands it enables ASAN on a non-tested platform
> > and provides an unexpected error for some users when it can easily be
> > avoided.  I'd advise not accepting the patch as currently presented.
>
> Please make sure only x86_64 gets this code enabled.

I think, we need to opt out only the PPC. According
https://developer.android.com/ndk/guides/asan, Arm64 and x86 are
supported.
I suggest resping by opting out PPC, I can test the next version and
confirm the behavior on arm64 and give Ack.


> I'll wait for a new revision, thanks.
>
>
> --
> David Marchand
>