Message ID | 9a8862c380805ac6c2fc137e8edb1d2e70ee2812.1743772053.git.maciej.wieczor-retman@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FC62C36010 for <linux-mm@archiver.kernel.org>; Fri, 4 Apr 2025 13:17:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B308280010; Fri, 4 Apr 2025 09:17:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 588C1280001; Fri, 4 Apr 2025 09:17:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4020F280010; Fri, 4 Apr 2025 09:17:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 201FE280001 for <linux-mm@kvack.org>; Fri, 4 Apr 2025 09:17:50 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8A65BC0175 for <linux-mm@kvack.org>; Fri, 4 Apr 2025 13:17:51 +0000 (UTC) X-FDA: 83296413942.30.B6BEF5D Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by imf11.hostedemail.com (Postfix) with ESMTP id 4EDD24000C for <linux-mm@kvack.org>; Fri, 4 Apr 2025 13:17:49 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=g7MFaeJ6; spf=pass (imf11.hostedemail.com: domain of maciej.wieczor-retman@intel.com designates 198.175.65.11 as permitted sender) smtp.mailfrom=maciej.wieczor-retman@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743772669; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=VZk6z45/TieMCWLPI8iFY06hsd50xsb22xpBUNnECFQ=; b=f7Se5Ss63KHDPuYO3zFq2gZDK4gjLTPS4aDyNN7a90yQ3Fp3lYTq6nQsXr6PV4Rqv4tiGy AAPP2M3qoVranqCH+EG2fBLqQ4lMuKD+qdEK1y3BW66TAHkdskMMjTfV6y4xmJFpx7sb8K pS7O/EFvzWthkbaeKIoWkFFgRNbpvI0= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=g7MFaeJ6; spf=pass (imf11.hostedemail.com: domain of maciej.wieczor-retman@intel.com designates 198.175.65.11 as permitted sender) smtp.mailfrom=maciej.wieczor-retman@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743772669; a=rsa-sha256; cv=none; b=5daEwXeMb8UObxm0lIQ2jv99HstV/vgLx8o/tbtyTKAJhCivTmtMtd4C7lD4WoZ/b8+PrQ nRPxcN66BFr3cm6lwYfRbqHAAwlKzFw/0jNGBxzSlyTFyV1mYjTa3ZHLk5q6mRck8zNIKu xpJ4PazbKtKSjyNF1+afgIWen78LH+8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1743772670; x=1775308670; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kLMkp6bZDxIMJX1kOLifwD1KQicNBp9kwQEWVdEeDAs=; b=g7MFaeJ6mRnmNEk22CUmDGasQ6luFYetfs5qEUlkRVoZqUfCbhC9hfzi +ikENt0V+gGQwl6kAqGnL4rHouOQpSgb0L7SfpqJg399+zaUHjlpZQafL LDPI4tupgkGfrs3PW58zO48N6er+NmXhItO6/2G75+nJcK4zUaPGu163O AZbstDbvxH3Q1EXu5Cy+II7h+4LWhefq0TbHA/5Sj4DAVO778MWCtDfoU wpAjm681y9gRuSuU4PiyB3k91+84SLPSPf9o2r2ic3dzxU+3NIZdyTqDx Jnd8dNa2MCRccSdvu8y/V0VHzePKaM+O//ZvlFBHcXfwnzbHX/hhDVpSm g==; X-CSE-ConnectionGUID: gkGHLUDMQPK7FeMcf2xfRg== X-CSE-MsgGUID: fzkMA0v+R+etPVpGzQED8A== X-IronPort-AV: E=McAfee;i="6700,10204,11394"; a="55402028" X-IronPort-AV: E=Sophos;i="6.15,188,1739865600"; d="scan'208";a="55402028" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2025 06:17:48 -0700 X-CSE-ConnectionGUID: /KZBOILGRPaVrrMli4Itpg== X-CSE-MsgGUID: T+1IKqSwRheE1ok0gd7jhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,188,1739865600"; d="scan'208";a="128157374" Received: from opintica-mobl1 (HELO wieczorr-mobl1.intel.com) ([10.245.245.50]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2025 06:17:33 -0700 From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> To: hpa@zytor.com, hch@infradead.org, nick.desaulniers+lkml@gmail.com, kuan-ying.lee@canonical.com, masahiroy@kernel.org, samuel.holland@sifive.com, mingo@redhat.com, corbet@lwn.net, ryabinin.a.a@gmail.com, guoweikang.kernel@gmail.com, jpoimboe@kernel.org, ardb@kernel.org, vincenzo.frascino@arm.com, glider@google.com, kirill.shutemov@linux.intel.com, apopple@nvidia.com, samitolvanen@google.com, maciej.wieczor-retman@intel.com, kaleshsingh@google.com, jgross@suse.com, andreyknvl@gmail.com, scott@os.amperecomputing.com, tony.luck@intel.com, dvyukov@google.com, pasha.tatashin@soleen.com, ziy@nvidia.com, broonie@kernel.org, gatlin.newhouse@gmail.com, jackmanb@google.com, wangkefeng.wang@huawei.com, thiago.bauermann@linaro.org, tglx@linutronix.de, kees@kernel.org, akpm@linux-foundation.org, jason.andryuk@amd.com, snovitoll@gmail.com, xin@zytor.com, jan.kiszka@siemens.com, bp@alien8.de, rppt@kernel.org, peterz@infradead.org, pankaj.gupta@amd.com, thuth@redhat.com, andriy.shevchenko@linux.intel.com, joel.granados@kernel.org, kbingham@kernel.org, nicolas@fjasle.eu, mark.rutland@arm.com, surenb@google.com, catalin.marinas@arm.com, morbo@google.com, justinstitt@google.com, ubizjak@gmail.com, jhubbard@nvidia.com, urezki@gmail.com, dave.hansen@linux.intel.com, bhe@redhat.com, luto@kernel.org, baohua@kernel.org, nathan@kernel.org, will@kernel.org, brgerst@gmail.com Cc: llvm@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, x86@kernel.org Subject: [PATCH v3 12/14] kasan: Fix inline mode for x86 tag-based mode Date: Fri, 4 Apr 2025 15:14:16 +0200 Message-ID: <9a8862c380805ac6c2fc137e8edb1d2e70ee2812.1743772053.git.maciej.wieczor-retman@intel.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <cover.1743772053.git.maciej.wieczor-retman@intel.com> References: <cover.1743772053.git.maciej.wieczor-retman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EDD24000C X-Rspamd-Server: rspam05 X-Rspam-User: X-Stat-Signature: w6zzmzid5pkid4itkitxufayaifen1pw X-HE-Tag: 1743772669-26513 X-HE-Meta: U2FsdGVkX1+lyw0/SAib2iVJqSR6hApSNMo9zYjYTTu4e8Pax+8LzuZ8RCf6x74SJdHA3+rYVEkFcbG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/kICgEV7kaA6XfNHCihmLx90VjWTvUhR63NiTHezBokU94G6c3rvuCMzeEx+Yy6iQoVjD4BfWfObI95uZucnJVAm0+ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
[v3,01/14] kasan: sw_tags: Use arithmetic shift for shadow computation
|
expand
|
diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index 693dbbebebba..2c7be96727ac 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -76,8 +76,11 @@ CFLAGS_KASAN := -fsanitize=kernel-hwaddress RUSTFLAGS_KASAN := -Zsanitizer=kernel-hwaddress \ -Zsanitizer-recover=kernel-hwaddress +# LLVM sets hwasan-instrument-with-calls to 1 on x86 by default. Set it to 0 +# when inline mode is enabled. ifdef CONFIG_KASAN_INLINE kasan_params += hwasan-mapping-offset=$(KASAN_SHADOW_OFFSET) + kasan_params += hwasan-instrument-with-calls=0 else kasan_params += hwasan-instrument-with-calls=1 endif
The LLVM compiler uses hwasan-instrument-with-calls parameter to setup inline or outline mode in tag-based KASAN. If zeroed, it means the instrumentation implementation will be copied into each relevant location along with appropriate constants during compilation. If set to one, all function instrumentation will be done with function calls instead. The default hwasan-instrument-with-calls value for the x86 architecture in the compiler is "1", which is not true for other architectures. Because of this enabling inline mode in software tag-based KASAN doesn't work on x86 as the kernel script doesn't zero out the parameter. Explicitly zero out hwasan-instrument-with-calls when enabling inline mode in tag-based KASAN. Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> --- Changelog v3: - Add this patch to the series. scripts/Makefile.kasan | 3 +++ 1 file changed, 3 insertions(+)