From patchwork Thu Mar 16 22:47:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Elver X-Patchwork-Id: 71005 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp37043wrt; Thu, 16 Mar 2023 15:57:55 -0700 (PDT) X-Google-Smtp-Source: AK7set/+TBKDiCLtGHCk+iGU7QGw9g4eVwvJi2oZCGUOsCirDystNjrLFMr4/KSBVtea9MQImiZi X-Received: by 2002:a05:6a20:d5:b0:c7:73ad:1071 with SMTP id 21-20020a056a2000d500b000c773ad1071mr3865285pzh.14.1679007475593; Thu, 16 Mar 2023 15:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679007475; cv=none; d=google.com; s=arc-20160816; b=JvDFws9dBl5FBPtoqGroGxl1qhR5aSV06MiJVBF8bm7dddhlFmI4h0H4Ap8wMvR07e DlOkERuEsozVsoiaibch5VtHvZcCxJFk1udlWJ9Tr7j3DQqReDBahLqSCisC2RtnHhXp tlRX4Pl7ckKmrtXAem7DyrT4HvHti5eN7bWlNj9cOmCIaG5JkoZvp7hlOyMjuhAxFGuE rgcwaHtQnnZ5p2pIW83prf83C5G5JUGOa2janazKNQ6oT93HRYsykAyxqmWmS0Cktqul IDVmA/Y7rtTdgEBrVH6DJzMljlmvIB64FEaJdHlzEjCluPfzOo/6/OD8PBZT4XaPEyRt TxgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=mIMhApGgO8tdqBq7ln4mUoYAtVQfctnuG47znmR3Hdk=; b=XFjAvFl7Fd5tDKbHTvIOaN61i4kO9hQJPHNd3/uLsKLrXVyJNSzkxu47PgDX+jMvi5 aU1k/xnzKqYlCHxo9C3/sQcvZuie2ls1nUObei/C+o0nMa9nwQWbE1jJuXxL+8K2RDTy 4ttAIsd0CpOUt2gEqxIUqllDFUfg+CxUmPZ6O8ERTl+dh7M/kTVTnqlHliIFnoeCwpdY NktuXALHFDR8nSbNzPqrZ05aGpJKUe8reQUZY1rfdi/wiPXCmN4/Efh42jNVJ3fUaDPc nybreukd41s62t8nX2jse/7AdqC3GTcph1ImaNzQ0cieprWlGJ5rN5BQWYvPpKCZkMkl HJ4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=dG1Fj3EX; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r3-20020a632b03000000b0050bfbd270c4si537989pgr.54.2023.03.16.15.57.39; Thu, 16 Mar 2023 15:57:55 -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=@google.com header.s=20210112 header.b=dG1Fj3EX; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjCPWrX (ORCPT + 99 others); Thu, 16 Mar 2023 18:47:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjCPWrS (ORCPT ); Thu, 16 Mar 2023 18:47:18 -0400 Received: from mail-ed1-x54a.google.com (mail-ed1-x54a.google.com [IPv6:2a00:1450:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBEE1E6D8C for ; Thu, 16 Mar 2023 15:47:16 -0700 (PDT) Received: by mail-ed1-x54a.google.com with SMTP id c1-20020a0564021f8100b004acbe232c03so4905951edc.9 for ; Thu, 16 Mar 2023 15:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679006835; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=mIMhApGgO8tdqBq7ln4mUoYAtVQfctnuG47znmR3Hdk=; b=dG1Fj3EX4sgJuQwgp2UhU7BloxdGqfpKCXNsSUwcImn0Gtitsw4nucQeqec/zudYiq 79+GE640VKDtERe9UcudVnI3IJwjavox42UEIyWrax04lelN9sgHSInSVI7K9aXmCBdX 3bKG/P5pP+f95mS62WQEBleu1VD+z6Kc4FO3l8Au9P2St2CD7Y3WMAUG8ktwBnw1rHT9 s47xHUyBGN4xrFp7/wYWe3AHWZPTgCwyHNiYQrSSD6TBpgb67ltgdkb09LDw/PNSJBNO EJx4qe+cc5vCmCJcoRSeeT5kns/WNboi6XPBBAxi2836S2HBaG/P9Uwa9R6xiUbh5qNl Eyig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679006835; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=mIMhApGgO8tdqBq7ln4mUoYAtVQfctnuG47znmR3Hdk=; b=eWRaTzNkHs/9a6C9BHqrqQ/t+dYA0A7MBRBlXkh3INh9/pKiyFID8dbYnC0K/P+n8a NM6bxDBNVQGc3SyQu9rAGegbfSHI7CealtbfFTVAhplVkU7oSrIJjADz1mO9aFhY3Sgp 9HBbrLMQ8rpOXHxHNxyG+TlKmdaW1TE1uFiBr3ed/GVtgQrMYudrMkfn8y7I1zSnRvvL ORoMjWsQU/GUU9pU2fdV1XHfC2LHPBrE/27BONdUvS40rX+FNuwQEh/wCp1u48IriDv5 70FpOHjq5GI5ZFyUmqAfkgN8ggLYuEHxaZWapVq9lwc4Py6HZgv4fz4lSum2l2XWgHyi qAEg== X-Gm-Message-State: AO0yUKU1pGHl0R5yxQKUbRoZfVBSqADiUiZta7hMGKv92/3ZXC9P26Nu J3iPVILKJN8H+DF6g0IJ6UQAyuo+KQ== X-Received: from elver.muc.corp.google.com ([2a00:79e0:9c:201:f359:6b95:96e:1317]) (user=elver job=sendgmr) by 2002:a17:907:8a01:b0:92f:b8f1:7239 with SMTP id sc1-20020a1709078a0100b0092fb8f17239mr3202420ejc.4.1679006835449; Thu, 16 Mar 2023 15:47:15 -0700 (PDT) Date: Thu, 16 Mar 2023 23:47:04 +0100 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230316224705.709984-1-elver@google.com> Subject: [PATCH 1/2] kfence: avoid passing -g for test From: Marco Elver To: elver@google.com, Andrew Morton Cc: Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Nathan Chancellor X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760566942802059808?= X-GMAIL-MSGID: =?utf-8?q?1760566942802059808?= Nathan reported that when building with GNU as and a version of clang that defaults to DWARF5: $ make -skj"$(nproc)" ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \ LLVM=1 LLVM_IAS=0 O=build \ mrproper allmodconfig mm/kfence/kfence_test.o /tmp/kfence_test-08a0a0.s: Assembler messages: /tmp/kfence_test-08a0a0.s:14627: Error: non-constant .uleb128 is not supported /tmp/kfence_test-08a0a0.s:14628: Error: non-constant .uleb128 is not supported /tmp/kfence_test-08a0a0.s:14632: Error: non-constant .uleb128 is not supported /tmp/kfence_test-08a0a0.s:14633: Error: non-constant .uleb128 is not supported /tmp/kfence_test-08a0a0.s:14639: Error: non-constant .uleb128 is not supported ... This is because `-g` defaults to the compiler debug info default. If the assembler does not support some of the directives used, the above errors occur. To fix, remove the explicit passing of `-g`. All the test wants is that stack traces print valid function names, and debug info is not required for that. (I currently cannot recall why I added the explicit `-g`.) Fixes: bc8fbc5f305a ("kfence: add test suite") Reported-by: Nathan Chancellor Signed-off-by: Marco Elver --- mm/kfence/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kfence/Makefile b/mm/kfence/Makefile index 0bb95728a784..2de2a58d11a1 100644 --- a/mm/kfence/Makefile +++ b/mm/kfence/Makefile @@ -2,5 +2,5 @@ obj-y := core.o report.o -CFLAGS_kfence_test.o := -g -fno-omit-frame-pointer -fno-optimize-sibling-calls +CFLAGS_kfence_test.o := -fno-omit-frame-pointer -fno-optimize-sibling-calls obj-$(CONFIG_KFENCE_KUNIT_TEST) += kfence_test.o From patchwork Thu Mar 16 22:47:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Elver X-Patchwork-Id: 71006 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp38793wrt; Thu, 16 Mar 2023 16:02:15 -0700 (PDT) X-Google-Smtp-Source: AK7set9xPUYboxPdGWJ7HTgDwHHUkqPr0bBA6QKItzuyC0/SjCyYk0DK1p2+/TtDjNRV/dOE2Wk8 X-Received: by 2002:a17:903:6c5:b0:1a0:5bb1:3f0a with SMTP id kj5-20020a17090306c500b001a05bb13f0amr4596165plb.47.1679007734760; Thu, 16 Mar 2023 16:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679007734; cv=none; d=google.com; s=arc-20160816; b=bFSKfkkoy+akVlMUec1/iwgY+sD6/6xO5JjrACqP3U15TFycZ4jGoAAZUkhwxmNxE+ WCBRxr6cXZd0UFUnOgBabG1tmIapTEZ1StTDAf3Ki64nst8oUJc9WHsZJ30wdlzhLZNg PsTcwkLWEk39M9QrhLPHQvT3y1n6aovRX14F+c65XcHbSZVszerW9WWfQBvMfLtbikOr UlLZ0eOXl1JyoOYbO0Put2EwtYb3vCEPwNyShrBzl2e6xKc1ifGFnW0iSHCd8ZpBZcSJ 66BCPYZrNqtH/KCSVwNkWrHZRH4+IZ80GbWCSCGmWjV77d573ZPG+9NAbvBDgYh0RpOu NRdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=DKOoaD6Ra29v+G2EYQelA/9U1zSfLrdqKtsejRDWzBc=; b=hfucrsYC8CuBUjxXuA+xGj+3C5vsjcEEoAud391Un5nQq+g68rCGrFJBkuMW+o0fFL BDtvkQEMWzWw9Hro9w5ToA8M4YvxbiPQ/rhowA9yo83wpIaVYtHhnuJ7QfN5EQy6epA/ rZWFc7+EruLSMBjxTGvKzBt+nDECFoqHHv7ULRR1OnHWB7Qyu33iGC8QB0Nv5oUNBHGH y6xVxZlamzOwfZNsABtwYR+9OOqc7+QhL3JjvyzEeUgCAlVwzDfAz6IsWraFGIyWW86d jEByKhPsuSJcSnJc3gZv4UgaSRB6zLmZpmqXgy2tcYrR6zJr0I1O8D3lwU65dHPGwbnc Ag0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=poi8gC8t; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a170902d70100b001929550b3e4si594753ply.466.2023.03.16.16.01.37; Thu, 16 Mar 2023 16:02:14 -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=@google.com header.s=20210112 header.b=poi8gC8t; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbjCPWrZ (ORCPT + 99 others); Thu, 16 Mar 2023 18:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230098AbjCPWrX (ORCPT ); Thu, 16 Mar 2023 18:47:23 -0400 Received: from mail-ed1-x549.google.com (mail-ed1-x549.google.com [IPv6:2a00:1450:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B452E6FE0 for ; Thu, 16 Mar 2023 15:47:19 -0700 (PDT) Received: by mail-ed1-x549.google.com with SMTP id k12-20020a50c8cc000000b004accf30f6d3so4986367edh.14 for ; Thu, 16 Mar 2023 15:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679006838; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DKOoaD6Ra29v+G2EYQelA/9U1zSfLrdqKtsejRDWzBc=; b=poi8gC8t1L69qGbvV3ks4+AtYYPqxKPowF0x6sr1KaWiMUjsX4yJbWzHEuFQwMGTCC a7vDGOPF9ZmWUYAEKqcXuGg3TH0I0ByS3it3T8iCMelyOoIoUHvnsD37tuy/eN/f8fgZ MOhWLEZtd3O1iIO5liKIZl+rOd00DGKRWzqCFt9cb4FP0WauXq3RGlanbszWSkS7PIsn 3nqOmi6gnlGBIz02VEBhfzUlvZI0++Z2V19sIEMasWeBhM3fLZntPYAgfU5woXjA+hM0 rBDgBHTT1bwY8Y8QQDo0Lj2HKJM539d9cPt6XQANsVd4KS01FOSCOJtESH1ZAHER6eb1 CyLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679006838; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DKOoaD6Ra29v+G2EYQelA/9U1zSfLrdqKtsejRDWzBc=; b=4hhEMepwyXTmGDl5BscUVEh3TZgKTlpAyo5DuVNRGrj5bL63T42C2Dk6sB2ldyH6yh SzATUwmqugyA3R3M8dvJg8WG9OTcUbaAaduWyJwvx4yOg7NZdFbXCs1wBXvCJwFKdb3f jO9ga46f3Eqsw5tlZubQEMSBTPLnUyWavee/HJEApIZd94U73CghvzK0ttQhViV1Q0Nk QpGlqQOUNuWRMsjI6seVuyBf0u/NaAhaEzx4yHvxg0uMx6gDrB6bNXiBak+JYWnksg2p sPmLp6clrkgbeUU52OnmLqZr7XC6YiW6AVI2/4FjYyVw5MhKZgkA4O8mx+IxqtapnVAG zLUw== X-Gm-Message-State: AO0yUKU/izNPNttNH033GjxQsIfhvVt2SxMN8+nuoxPDGy/r+yNLw5jl uyZv6CPf2hUB4o3yRYQ/sFtnFwEVqQ== X-Received: from elver.muc.corp.google.com ([2a00:79e0:9c:201:f359:6b95:96e:1317]) (user=elver job=sendgmr) by 2002:a17:907:7284:b0:931:6f5b:d27d with SMTP id dt4-20020a170907728400b009316f5bd27dmr669131ejc.0.1679006838228; Thu, 16 Mar 2023 15:47:18 -0700 (PDT) Date: Thu, 16 Mar 2023 23:47:05 +0100 In-Reply-To: <20230316224705.709984-1-elver@google.com> Mime-Version: 1.0 References: <20230316224705.709984-1-elver@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230316224705.709984-2-elver@google.com> Subject: [PATCH 2/2] kcsan: avoid passing -g for test From: Marco Elver To: elver@google.com, Andrew Morton Cc: Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Nathan Chancellor X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760567214155697325?= X-GMAIL-MSGID: =?utf-8?q?1760567214155697325?= Nathan reported that when building with GNU as and a version of clang that defaults to DWARF5, the assembler will complain with: Error: non-constant .uleb128 is not supported This is because `-g` defaults to the compiler debug info default. If the assembler does not support some of the directives used, the above errors occur. To fix, remove the explicit passing of `-g`. All the test wants is that stack traces print valid function names, and debug info is not required for that. (I currently cannot recall why I added the explicit `-g`.) Fixes: 1fe84fd4a402 ("kcsan: Add test suite") Reported-by: Nathan Chancellor Signed-off-by: Marco Elver --- kernel/kcsan/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kcsan/Makefile b/kernel/kcsan/Makefile index 8cf70f068d92..a45f3dfc8d14 100644 --- a/kernel/kcsan/Makefile +++ b/kernel/kcsan/Makefile @@ -16,6 +16,6 @@ obj-y := core.o debugfs.o report.o KCSAN_INSTRUMENT_BARRIERS_selftest.o := y obj-$(CONFIG_KCSAN_SELFTEST) += selftest.o -CFLAGS_kcsan_test.o := $(CFLAGS_KCSAN) -g -fno-omit-frame-pointer +CFLAGS_kcsan_test.o := $(CFLAGS_KCSAN) -fno-omit-frame-pointer CFLAGS_kcsan_test.o += $(DISABLE_STRUCTLEAK_PLUGIN) obj-$(CONFIG_KCSAN_KUNIT_TEST) += kcsan_test.o