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 68097A0C4C; Tue, 21 Sep 2021 10:29:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF38740683; Tue, 21 Sep 2021 10:29:52 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 91D394003C for ; Tue, 21 Sep 2021 10:29:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632212990; 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=kyYfSSxZiKk3mOVLu78KPAhV/JOhtJNqtsLU4rG16H0=; b=iiVQfHPksW3ccncNB/acTZwI05x6TbhOV6RXRF3fDLzOgWaqJjMAJ29+viJYGdbiGEMvwT DvjDYRr40ZTUQJ4U/4ZDDHfsndxi2PLeg6hhv11/MsLNcIemPs6iTkB9UVMR2BTFcTVf/c 511eN/Bs38ESmCWUMQqt1t7o0PVbalI= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-185-zFL7o157MnCRioqPuc9KsQ-1; Tue, 21 Sep 2021 04:29:45 -0400 X-MC-Unique: zFL7o157MnCRioqPuc9KsQ-1 Received: by mail-lf1-f71.google.com with SMTP id x33-20020a0565121321b02903ac51262781so14391238lfu.9 for ; Tue, 21 Sep 2021 01:29:45 -0700 (PDT) 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=kyYfSSxZiKk3mOVLu78KPAhV/JOhtJNqtsLU4rG16H0=; b=jicmxJEV6cBeRwB6DxB74jwkRieaVr9bqzBnikAZRIMirGNBdGYy6V7LMDL6LVorp/ 52QDxN0wnJqOC+p/eOTEgvY8sdfAUalD8B0f3IsyCj6wT2xX2q6VfzIzQXgaO3ldxTss N53eMIKHJapM4AUPfYboV8N4LA8WHQEkUFwRgyYBSN/6+VQhrbJdh7ZeTqsM7ILKVtp1 bpFzRvl3NqEzVTaXzqPAdulZBDR8PWLqgoU7UzI+kxStIl1HV2VWUH4UwZkrq02X8v/V ZyqaaSUyTaVJigEGsPthTt5R4+aQ0zlVJgbBI9yzUXNUZ2GsGqz2HTZ5Cx/LKX6RMFKO UnOg== X-Gm-Message-State: AOAM5318P17Y+1+Dr/nCI2lgquc3Qsf35FO/x0Y8ef2GmSB4ZqjJ7ohq GWpciRoEpKWgqXBP3EhgX7nC9WpMjZiJN7phxqjToaoAcnkR4htzM+yWrpWvElt9hmO1uT0lzN9 lUPh73Z71+H4fb2y33BM= X-Received: by 2002:a05:6512:3095:: with SMTP id z21mr21594273lfd.265.1632212984013; Tue, 21 Sep 2021 01:29:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya24JPjo6Pl5LlujIBuLZSyQ+XiFFxO/dvu87ZOHLq1QwVQwHLeqXE9q6R+A2F+/n3kGKts2nePBRX68rIpgA= X-Received: by 2002:a05:6512:3095:: with SMTP id z21mr21594257lfd.265.1632212983771; Tue, 21 Sep 2021 01:29:43 -0700 (PDT) MIME-Version: 1.0 References: <20210910020147.148019-1-zhihongx.peng@intel.com> <61dd38ed-b570-d7d5-e839-1f845e28e932@linux.vnet.ibm.com> <261b1c48-3794-1b42-a794-be76819049ab@linux.vnet.ibm.com> In-Reply-To: <261b1c48-3794-1b42-a794-be76819049ab@linux.vnet.ibm.com> From: David Marchand Date: Tue, 21 Sep 2021 10:29:31 +0200 Message-ID: To: "Peng, ZhihongX" Cc: "Burakov, Anatoly" , David Christensen , "Ananyev, Konstantin" , "stephen@networkplumber.org" , "dev@dpdk.org" , "Lin, Xueqin" 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" 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Sep 20, 2021 at 9:41 PM David Christensen 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'll wait for a new revision, thanks. -- David Marchand