From mboxrd@z Thu Jan 1 00:00:00 1970 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 631B3C433FE for ; Wed, 19 Oct 2022 21:37:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbiJSVhM (ORCPT ); Wed, 19 Oct 2022 17:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231150AbiJSVhG (ORCPT ); Wed, 19 Oct 2022 17:37:06 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A1E1956EB for ; Wed, 19 Oct 2022 14:37:05 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id a10so31157064wrm.12 for ; Wed, 19 Oct 2022 14:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rQVk2CI7gUTucSPsYsRuO+Xgt/DLnqyh0SKi8lL+BxQ=; b=kEVsf5yva6tPgrJ28OEjDXh5az9gBpktNnS2hvVjuDF+md4bSzDCTm+yLSoP1QbyCF nmvNyXfObeOLojWLCz86IsZhxLuBaicxiZndWHvw9g8EeVbOQMDwRPb40itjjAn8SR60 nETxvBCs7XCrBF7ofuSBIcD8XDwUg25BGJeeyC5neQwRiSrK8XjG/og8YoSeibMcNzI4 cCTvbda7YB4O3z4MsBZokpHXnboje0jgXWsJ9OvWDu7xGKth403zmdIXNWN0mtOmqzln +KYYaS5K402ENk8RVDvJZG3VhziKJuQt0TNA7vm0tPoHTF1iLlFjc3Yzj4q6WncoJYWS 9GmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rQVk2CI7gUTucSPsYsRuO+Xgt/DLnqyh0SKi8lL+BxQ=; b=sw1fd+IdT3ePFAaoihN/1KHWuBbsXqO6uz5Dv+meaQC8mrrGPr2pbs2l/Uw08cizsv uyC0C2Nlf9GqIeH5wgKjEcb3fH4M3Ja/1MBJYR1P4KQsNNA65UPmD9ukx4noRPGsqoJS bM5S2AihqFgCANBD85He/3EB64OnF7SYEZZ6e3EXnp+IsA3aMPz9ondARyMBOcsQP54j j58l8s5U/tK6hfnNWY//ABvBC8vseExjudbiR0j9ioYIBHJiCBRD9PDTXLI3KGoUxkaA Ml8QQgNstRnXY8aD3t5KThqYkkT7gZ+MCfXbJJiyFiQP3waYQPH5vf4yt5E+2/moAF5p vUvw== X-Gm-Message-State: ACrzQf3ZXwev2+pAs9vEtcsJh9lCNm6HZbSJ+p8NPWhf65y2VozNj4xr LFNSzVPQPq37I9Azd1Nq/A5PWg== X-Google-Smtp-Source: AMsMyM7qopHlpx/0st3r1u+WJ8I0s2s8sNijf+qUWSM5iyTi/IS/3JDBYAUI/Wlvu3L9ZDi6G/UWsw== X-Received: by 2002:a05:6000:1843:b0:22e:77b0:2e5 with SMTP id c3-20020a056000184300b0022e77b002e5mr6255132wri.215.1666215423700; Wed, 19 Oct 2022 14:37:03 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:9c:201:b751:df72:2e0f:684c]) by smtp.gmail.com with ESMTPSA id g7-20020a05600c4ec700b003c409244bb0sm1236729wmq.6.2022.10.19.14.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 14:37:02 -0700 (PDT) Date: Wed, 19 Oct 2022 23:36:56 +0200 From: Marco Elver To: youling 257 Cc: Alexander Viro , Alexei Starovoitov , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Biggers , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Stephen Rothwell , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 18/43] instrumented.h: add KMSAN support Message-ID: References: <20220915150417.722975-19-glider@google.com> <20221019173620.10167-1-youling257@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.2.7 (2022-08-07) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 20, 2022 at 04:07AM +0800, youling 257 wrote: > That is i did,i already test, remove "u64 __tmp…kmsan_unpoison_memory", no help. > i only remove kmsan_copy_to_user, fix my issue. Ok - does only the below work (without the reverts)? diff --git a/include/linux/kmsan-checks.h b/include/linux/kmsan-checks.h index c4cae333deec..eb05caa8f523 100644 --- a/include/linux/kmsan-checks.h +++ b/include/linux/kmsan-checks.h @@ -73,8 +73,8 @@ static inline void kmsan_unpoison_memory(const void *address, size_t size) static inline void kmsan_check_memory(const void *address, size_t size) { } -static inline void kmsan_copy_to_user(void __user *to, const void *from, - size_t to_copy, size_t left) +static __always_inline void kmsan_copy_to_user(void __user *to, const void *from, + size_t to_copy, size_t left) { } ... because when you say only removing kmsan_copy_to_user() (from instrument_put_user()) works, it really doesn't make any sense. The only explanation would be if the compiler inlining is broken.