Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19506C64ED9 for ; Mon, 27 Feb 2023 23:10:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbjB0XKC (ORCPT ); Mon, 27 Feb 2023 18:10:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbjB0XKB (ORCPT ); Mon, 27 Feb 2023 18:10:01 -0500 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57FB215CA7 for ; Mon, 27 Feb 2023 15:10:00 -0800 (PST) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-536b7ffdd34so221496317b3.6 for ; Mon, 27 Feb 2023 15:10:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QFjaeE4eSo23upfyzVu9yFw6RjIFdreut8TNcWwSiF4=; b=dE9jVGLG/4tiI3x6Dm2ln1b5O0ij+v6xIJv9LjSu2Sq8avzQ5a10IA9zBy09wz78lm fh1mu648v/L5g/J0LjSzxqiWhzxAlc6SyMsYfjUvDPvy15L0IQYO9zspThNSRe89Qf7m YIHoFbp1lSLh6EBlYbN1DuXyTIiiJ3MFMmJREAp8uTb0y6nn6YY/dkurgx7MnVbEnoCN yXQxw0l9EzOEWsOCDUsiccJo8JXhF6c05O9dZZC2PKw8OnS4ABpoLCLTz4U1XQcOhC0e hCsWVNFwhpNd6lfI1BbipBoVJzqRvGWVfYt/tatONd87JuzoYtE1ygzZyNONGoFE3YBX eNeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QFjaeE4eSo23upfyzVu9yFw6RjIFdreut8TNcWwSiF4=; b=W32+8MmTxfOX7GPk0cMFFZKJbn280bO76z01eryJnksFwkxM66/IN2plE9DY+DH4zl YryicWqNNotAlyu6FmmHWRPITfUOKrPC5K6t8gzcdYKbmTAzR3MRzaZtAY83X/Ar5oP9 /JyaSFHUEqs/3QY1w6unp7A3iQDJiqGabz6tE8kJi+SecWxeMCzzxFC/eJwe1S8xF3O5 1rYv6Bmb5b5DIM4u+PZ0kK0dodEznkR6ph1X+J8S9NN/PlsKdbBWjMaZsXnJjo65DoP8 DbLGKyWY0cKmNnz/xC6ZgbeX+AOQIyXNxdK0UghzGU1U/gIR0V5RNO1uWR+kpuZ/6+d5 ZZYw== X-Gm-Message-State: AO0yUKVXV25TF7km8cwFUriUqLP2b9pfPwaNniaM8j+2ccU45meRzKYE VzHTT4UcZn6x0G2yvQ6zwlTdeF6JAOglE1RRHghbsA== X-Google-Smtp-Source: AK7set9qHVWcnczC7w/zdZpnGo7qQwK8i/JAfp2TvzaYrL306mHwychbjLxDpLl/X96ArazXBXjqTO1MX9W/D4/zI7k= X-Received: by 2002:a25:e210:0:b0:a99:de9d:d504 with SMTP id h16-20020a25e210000000b00a99de9dd504mr213188ybe.12.1677539399179; Mon, 27 Feb 2023 15:09:59 -0800 (PST) MIME-Version: 1.0 References: <20230227094726.3833247-1-elver@google.com> <20230227141646.084c9a49fcae018852ca60f5@linux-foundation.org> In-Reply-To: <20230227141646.084c9a49fcae018852ca60f5@linux-foundation.org> From: Marco Elver Date: Tue, 28 Feb 2023 00:09:13 +0100 Message-ID: Subject: Re: [PATCH mm] kasan, powerpc: Don't rename memintrinsics if compiler adds prefixes To: Andrew Morton Cc: Alexander Potapenko , Andrey Ryabinin , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Liam Howlett , kasan-dev@googlegroups.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Daniel Axtens , kernel test robot Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Feb 2023 at 23:16, Andrew Morton wrote: > > On Mon, 27 Feb 2023 10:47:27 +0100 Marco Elver wrote: > > > With appropriate compiler support [1], KASAN builds use __asan prefixed > > meminstrinsics, and KASAN no longer overrides memcpy/memset/memmove. > > > > If compiler support is detected (CC_HAS_KASAN_MEMINTRINSIC_PREFIX), > > define memintrinsics normally (do not prefix '__'). > > > > On powerpc, KASAN is the only user of __mem functions, which are used to > > define instrumented memintrinsics. Alias the normal versions for KASAN > > to use in its implementation. > > > > Link: https://lore.kernel.org/all/20230224085942.1791837-1-elver@google.com/ [1] > > Link: https://lore.kernel.org/oe-kbuild-all/202302271348.U5lvmo0S-lkp@intel.com/ > > Reported-by: kernel test robot > > Signed-off-by: Marco Elver > > Seems this is a fix against "kasan: treat meminstrinsic as builtins in > uninstrumented files", so I'll plan to fold this patch into that patch. Yes, that looks right. If a powerpc maintainer could take a quick look as well would be good. The maze of memcpy/memmove/memset definitions and redefinitions isn't the simplest - I hope in a few years we can delete all the old code (before CC_HAS_KASAN_MEMINTRINSIC_PREFIX), and let the compilers just "do the right thing". Thanks, -- Marco