From patchwork Fri Mar 10 23:43:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 13170461 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FEB9C6FD19 for ; Fri, 10 Mar 2023 23:43:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1382D6B0081; Fri, 10 Mar 2023 18:43:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B6116B0080; Fri, 10 Mar 2023 18:43:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E987F6B007E; Fri, 10 Mar 2023 18:43:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D6ABD6B007B for ; Fri, 10 Mar 2023 18:43:40 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 940C91405B6 for ; Fri, 10 Mar 2023 23:43:40 +0000 (UTC) X-FDA: 80554618200.15.D27BAB6 Received: from out-14.mta1.migadu.com (out-14.mta1.migadu.com [95.215.58.14]) by imf14.hostedemail.com (Postfix) with ESMTP id DB9DA10000D for ; Fri, 10 Mar 2023 23:43:38 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=UcgdJ+DJ; spf=pass (imf14.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.14 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678491819; 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:references:dkim-signature; bh=z4DPZvfjlbyZR04Gs5VqWFFoeLvvcar/vhfVx7MEdnM=; b=q8rpT0qy7t6Lncn6IVBB8WRsQ/WeGSkgJ3FY0UrahkOayYwLO1v4hy/HRLg+Vhac/1VvvU DOAkOdHBXlgf58JWY7m7AwN6mikZmN4HWBi1Dt2LXnVVdg2Do3gNHo9Do4zkcSlL5dOqPj cXRQ2jjKopIa2xGtyEArhGDTvBYorsA= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=UcgdJ+DJ; spf=pass (imf14.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.14 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678491819; a=rsa-sha256; cv=none; b=A5+wY8qOKd3t7RVXwRJ5X6IU602PiF+nsu+2/qXx55usRoMbRZiuVERnfWEi7BlDN2S+uI 8XIovtPvDVlO+rsSVtOuGTET9PsyGgf1Nnb0BeRpEDkdAavRD9c0fDo+3+kaTYK3RZChWI UnJOrtgFYDtPWrXQhHW7ggiZh5x7D9I= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1678491816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=z4DPZvfjlbyZR04Gs5VqWFFoeLvvcar/vhfVx7MEdnM=; b=UcgdJ+DJVo9GF+Ix3wnxINMhtX483ckxS9anY1bHh8fL0eGkNMCuKJlKj1RTT3X1QfHe15 dJeb+N+1TAdv+RZ72TIMdS+If3df0G/LVbGfso6arBItfon0IiusknaIiSUQ4M11FCoxJ8 yjSINLfD2aKPSvaVR6zUm3NXPTT/r9E= From: andrey.konovalov@linux.dev To: Marco Elver , Catalin Marinas Cc: Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Vincenzo Frascino , Will Deacon , linux-arm-kernel@lists.infradead.org, Peter Collingbourne , Evgenii Stepanov , Andrew Morton , linux-mm@kvack.org, Weizhao Ouyang , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH 1/5] kasan: drop empty tagging-related defines Date: Sat, 11 Mar 2023 00:43:29 +0100 Message-Id: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DB9DA10000D X-Stat-Signature: 5op333qso8ezg9coh5qdrpxq9yu4nosw X-HE-Tag: 1678491818-175391 X-HE-Meta: U2FsdGVkX1/JJ6Bs1rPtLpfQpld0J1NlLBxWFTpUAyQW8hqQ+nJ3IWobEcAKmNHUr59G38N0PP5PSh7wRFxh+/Uc4nE2bcue9AAPRFHp9y4AaVMKOfZpZUhusRnTb/uWk8uKtBh7Khf1Q4/OgqAAaFVKwwaFIjAT2eLravdKINa1Z2nlzVtdxs788Q+ejQmGA7CK3s0clEFJn2oKPsFUnHjm+/3UkTyWIDvGhN+JbbW42NaM9A7qdNSnhPVjWmQu8+kKcL4/gaQ0dqOuckBSyRH1YODYISBhItGivzjiySyEBK/LCcoiglTFPBEqmO9SdaocV222sr1it7ZCxcYVQhdzBTJQqFIW7Ogl9pmSQ8MzcBz3bTyEA5UEqkqHU1ZsAkMCCUwnTlCCym4XoNvxjfDSC2LALLG4fvGVX2KOwszhjXPL0YjXANNoaMtyGDIoHQRH1UAdr9rsODPsbxObFEOU32OAoIsrA6nB/14I9XuofUXBbWax5W/304HUP7qtVgKlAhJVA+SvgATP4WApgaPKeSWQ0FNDN0R12MHQSPbFKY1IMBJwHJ9D70QJluT6aLx1LNaa7c/3E7CRt8cB53waKzgEKzqcCfBWTChefpTb3odlw5aN9cchx429D6TptPhirZ4BuMEyt4vy6vTuoxCJ6cY8cpwsL5ZJ/c1VPsOv3PWRlFVrFL8UsUZkWYYQfJ7nxepPf8TnMyinHZRx83N4bR9VA1HNv4B2yZ0OrXsLXbK2sFLA2eQCOcb1wEYDMASBXXzG5LdvIdJWK7XMLbMYBoSklJZtLeksRHuLyjILyIw6lLVCdYDpbq/TBkVv1MAgJPHnVIzXwiwEMDNNJFq4rPGtqGk6DTZuN5BkkiBWm5bmVB1Bfp3G1+j83G7M1lwhh/tjFC0Mh9cBPMjTWqdGfeUSfkdab+GkoYoR4BeDbqWuaZXbA/auRR2gOY54np8oJ/MvU9KzMUBhIVn hi1oSx5K NuvhMYrHRsn9hYHZIMiMwkeAVcxPth2bU47jr0ElSl4yYlhy9SuT7erIM9RM234Hh8MZz6KxIiT1O83QDSv4MQaY8GiWbiTk6T2gnngRa397obDeI2OOfFt7twSpdadjiYBDVoQxMthUCpQkKb46sSAVn5dNmXON6p24fywsH/p4exvIwVYW9tcx8vg3RTiAIRoMd 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: From: Andrey Konovalov mm/kasan/kasan.h provides a number of empty defines for a few arch-specific tagging-related routines, in case the architecture code didn't define them. The original idea was to simplify integration in case another architecture starts supporting memory tagging. However, right now, if any of those routines are not provided by an architecture, Hardware Tag-Based KASAN won't work. Drop the empty defines, as it would be better to get compiler errors rather than runtime crashes when adding support for a new architecture. Also drop empty hw_enable_tagging_sync/async/asymm defines for !CONFIG_KASAN_HW_TAGS case, as those are only used in mm/kasan/hw_tags.c. Signed-off-by: Andrey Konovalov --- mm/kasan/kasan.h | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index a61eeee3095a..b1895526d02f 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -395,28 +395,6 @@ static inline const void *arch_kasan_set_tag(const void *addr, u8 tag) #ifdef CONFIG_KASAN_HW_TAGS -#ifndef arch_enable_tagging_sync -#define arch_enable_tagging_sync() -#endif -#ifndef arch_enable_tagging_async -#define arch_enable_tagging_async() -#endif -#ifndef arch_enable_tagging_asymm -#define arch_enable_tagging_asymm() -#endif -#ifndef arch_force_async_tag_fault -#define arch_force_async_tag_fault() -#endif -#ifndef arch_get_random_tag -#define arch_get_random_tag() (0xFF) -#endif -#ifndef arch_get_mem_tag -#define arch_get_mem_tag(addr) (0xFF) -#endif -#ifndef arch_set_mem_tag_range -#define arch_set_mem_tag_range(addr, size, tag, init) ((void *)(addr)) -#endif - #define hw_enable_tagging_sync() arch_enable_tagging_sync() #define hw_enable_tagging_async() arch_enable_tagging_async() #define hw_enable_tagging_asymm() arch_enable_tagging_asymm() @@ -430,10 +408,6 @@ void kasan_enable_tagging(void); #else /* CONFIG_KASAN_HW_TAGS */ -#define hw_enable_tagging_sync() -#define hw_enable_tagging_async() -#define hw_enable_tagging_asymm() - static inline void kasan_enable_tagging(void) { } #endif /* CONFIG_KASAN_HW_TAGS */