Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5323636rwe; Tue, 18 Apr 2023 05:31:10 -0700 (PDT) X-Google-Smtp-Source: AKy350YGfxDCPR3SlWTWMhjaNCasn7PU3qYiZf0NRRgCnmfwyaYjHQeWtJAvxyUwZ3LmJXZGkzDe X-Received: by 2002:a05:6a00:b4f:b0:63b:5f78:d6db with SMTP id p15-20020a056a000b4f00b0063b5f78d6dbmr24570506pfo.21.1681821070284; Tue, 18 Apr 2023 05:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681821070; cv=none; d=google.com; s=arc-20160816; b=QTEAmuNZ6TE73ClTK05q4gdfu78sedeglfKtvIJry963ZDFOeJzCB6iGfdYR9nYliq jMHl+ZOhvk5pDW+by+NvlUzFATsgLoC4yXvZW8gbLovXr2V286fjPaBHUpubNEbKbKY1 6yzAG+7OCVUq+EICAbtoX3C/ptWKk6db/ri/6vRxoAFrHNk5frQgw5UDkublZt6oJSsM 95NuFTiq9KQX80s6Vqy9T+U6n0m9J47bcFVyyOZ5Dt3eivRMAeTHBmFT5nNQMSkzNJRz Wkgy5EGvfx/03k8CDPugvog7qtdc0mF1LtK4rqxgkkT//qgNn5+KOVC4PHs/OXDQyhxq C94Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=VMwb91EjeaIIwMVJOlqozliVSEbH/Bchyh3fjPDYvkE=; b=u4xKbcgLixAvvoAJrAjMAgX1PqbAGLoT1CMXsibzGYHghqtZwocdlNdzjBaNo6RPaP hA2AgxRbRThgWLpteFkcFlIpHG8FY08Pyc8uxctEwLNUrLVdrEjvXGI/nRKJTF50KwDw dB2T4pZSPFIsdOwTmHFih6es+ylyQ8lxlBSrWYYIQ3Ccr1uZH8op9JGPkf6fSZZCaol3 WeV8trlnG+oT8eSfIGBHvADEqHm0lQTHHzrSzSb/7c41qcHoU0Ib9L6+m0gB7gVLXEaS 1aZEUqYeHZ0QhTgb2NhEsTD5Ho9izRByIXnQIqfGpL6g/mIGQMaxLUQc9RI0Mc6ZhKFT O0/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b="fD2wHJI/"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=fr585nbR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020aa79525000000b0063b8ab7f91csi6169559pfp.365.2023.04.18.05.30.55; Tue, 18 Apr 2023 05:31:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b="fD2wHJI/"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=fr585nbR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231346AbjDRMaW (ORCPT + 99 others); Tue, 18 Apr 2023 08:30:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231564AbjDRMaS (ORCPT ); Tue, 18 Apr 2023 08:30:18 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2D9C93D7; Tue, 18 Apr 2023 05:29:51 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 9C6495C00E8; Tue, 18 Apr 2023 08:29:16 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Tue, 18 Apr 2023 08:29:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1681820956; x=1681907356; bh=VM wb91EjeaIIwMVJOlqozliVSEbH/Bchyh3fjPDYvkE=; b=fD2wHJI/bKnYdEKMvA OFP1OMUFa/DcdiSvEeS3jyc3fs7pYGjj2nPSJWceSFkyzBgWuYkUp1kM6gzuHeiC 9ZIAxIZpZ6jMwkeMdWIPoht4kliqUH3+/QXsLdHCx8HsVa8PSNlCvAfOI2ndVMSm ODRKuMzne3ljJTZv7uka0cz7mwApFi/2JEvh5oF8dt3ZZ3EN4BFhT4kr8KbWzdlJ DuKPdGqHO+bmtVA0j93mpU0DDpPWhXPf0n4p6Kij+LAiVJhs7AzpKoDASbltxXfs 6BLCMsyBPhzjx4zag9KGu1Hqv5fb4U0qdwU7rez+twDyaalpKTDspjQHB+9enARb 8k4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1681820956; x=1681907356; bh=VMwb91EjeaIIw MVJOlqozliVSEbH/Bchyh3fjPDYvkE=; b=fr585nbRin/G68HRrhwCE2ojOa/tv 1zDamuBIAlzPSNcntpQrIdXZdKBfOTs7ToTHbB4pKSkqO3nUs6PBb1ImutS/yxBM 2B4B5Uv7EnD+4OcebfIDM8WkEW91M8+0wiglGU5TGk07FiI9dPKIJjs2unCmyzgY lO4fyf/jbo7HoOXPTQ1BAztviLrtGglfSP+qqLAVRcveQPzjYxvrARefG0V+CP+M zlJD2N9wi+SZYY8AddLhOH0tEcSScD2tHUQoRnLHNHtkuo3i/eRBdmNAfLA/SqVj 2cKnspDuPfPeAkz84iYpN/LzyZSfyfQcqNaJYxClK1/ZwGBAl82+OZUvw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdelkedghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id B7D7BB60089; Tue, 18 Apr 2023 08:29:15 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-372-g43825cb665-fm-20230411.003-g43825cb6 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20230414082943.1341757-1-arnd@kernel.org> <20230414162605.GA2161385@dev-arch.thelio-3990X> Date: Tue, 18 Apr 2023 14:28:55 +0200 From: "Arnd Bergmann" To: "Marco Elver" , "Nathan Chancellor" Cc: "Arnd Bergmann" , "Andrey Ryabinin" , "Masahiro Yamada" , "Nick Desaulniers" , "Nicolas Schier" , "Alexander Potapenko" , "Andrey Konovalov" , "Dmitry Vyukov" , "Vincenzo Frascino" , "Tom Rix" , "Andrew Morton" , "Michael Ellerman" , "Peter Zijlstra" , linux-kbuild@vger.kernel.org, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] kasan: remove hwasan-kernel-mem-intrinsic-prefix=1 for clang-14 Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 18, 2023, at 14:06, Marco Elver wrote: > On Fri, 14 Apr 2023 at 18:26, Nathan Chancellor wrote: >> On Fri, Apr 14, 2023 at 10:29:27AM +0200, Arnd Bergmann wrote: > It errors as expected. But with: > >> clang -Werror -mllvm -hwasan-does-not-exist -c -x c /dev/null -o /dev/null > > It ends up printing _help_ text, because anything "-h..." (if it > doesn't recognize it as a long-form argument), will make it produce > the help text. Ah, that explains a lot. I think I actually tried a few other options, but probably only edited part of the option name, and not the beginning, so I always saw the help text. >> > # Instrument memcpy/memset/memmove calls by using instrumented __hwasan_mem*(). >> > +ifeq ($(call clang-min-version, 150000),y) >> > CFLAGS_KASAN += $(call cc-param,hwasan-kernel-mem-intrinsic-prefix=1) >> > +endif >> > +ifeq ($(call gcc-min-version, 130000),y) >> > +CFLAGS_KASAN += $(call cc-param,hwasan-kernel-mem-intrinsic-prefix=1) >> > +endif >> >> I do not think you need to duplicate this block, I think >> >> ifeq ($(call clang-min-version, 150000)$(call gcc-min-version, 130000),y) >> CFLAGS_KASAN += $(call cc-param,hwasan-kernel-mem-intrinsic-prefix=1) >> endif > > We just need the clang version check. If the compiler is gcc, it'll do > the "right thing" (i.e. not print help text). So at a minimum, we need > if "clang version >= 15 or gcc". Checking if gcc is 13 or later > doesn't hurt though, so I don't mind either way. I've sent a v2 now, with an updated help text and the simplified version check. It might be possible to change the cc-option check in a way that parses the output, this variant should do that, if we care: echo "char *str = \"check that assembler works\";" | clang -Werror -mllvm -hwasan-does-not-exist -S -x c - -o - | grep -q "check that assembler works" Arnd