From patchwork Wed Mar 29 18:37:44 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: 76764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp613450vqo; Wed, 29 Mar 2023 11:39:15 -0700 (PDT) X-Google-Smtp-Source: AKy350a11OVX2QINX6phwd2euFWrPCOQzz19fA36Rjp1RbFd7bTQy596z51tu2aiYnyq+kQ5tUME X-Received: by 2002:a17:907:7633:b0:91f:6679:5581 with SMTP id jy19-20020a170907763300b0091f66795581mr3383832ejc.21.1680115155373; Wed, 29 Mar 2023 11:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680115155; cv=none; d=google.com; s=arc-20160816; b=HLnKVj6n/FUzg+5RTgrCCRsbILUAWqx7li/DHuNQqrp2MIVLwrk4JqA211+kX4exir J/HB1WInN6qSnBVWCMX7eYJuVLKkMogLf5l78+VbPxnsh9kkg6tdQNg44qQrjQVY0M+4 s+n1i0oD+/8eyfirb84yRi5jhrViF6m7tBhTxUeUNC8Ej4CxA9DZORAwxC/MeZmivJKb VUdplNHI3oJC2HhgOvD5hNco/I6XMnCPfDfjDtaglXyWPd+6vjkJSCLI2TJRndCm76m4 EFjv6knI5DFCVtRt7JeE5Rrk3IxPqwJcnaXiDZ6pEsK/4LX+W+S8VuOGeyQ3nvcuwGoK alFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=z4DPZvfjlbyZR04Gs5VqWFFoeLvvcar/vhfVx7MEdnM=; b=YsC/Zyl76Ji02E36OQSGRIAGfM/gKdiRi6sIFp42qots7eh20Pdw7wDf+qTxvsAn8d MDZ79V2jqWHL9+M3Fj13AyjajRbVmtIzJ4t0YLF/EiQglRP6Vh17bIEX+LgZ3+dJlS8b UyqcI95MtdJekx4/5mRI89SxfqtN/UvLOYynvSkiFx+ZJGS1IPB8/DV+24ivDL7FjgFM +rPK2URep0BB/6QWjNwpVpUpInxlrGm6889Bw7i+6fLsAKV+yCevwTJkT7YcrziJRwri bQAkf/SWE60WoKj/X64aT7NEcnndmpvaMTCOYVTjOwtP2yfCKwtps3F4gXLP7Iiz0HwZ cAOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=tIO3PhiO; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020a17090634d100b008d89608d4a2si31682986ejb.204.2023.03.29.11.38.52; Wed, 29 Mar 2023 11:39:15 -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=@linux.dev header.s=key1 header.b=tIO3PhiO; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbjC2SiK (ORCPT + 99 others); Wed, 29 Mar 2023 14:38:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbjC2SiE (ORCPT ); Wed, 29 Mar 2023 14:38:04 -0400 Received: from out-57.mta1.migadu.com (out-57.mta1.migadu.com [95.215.58.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B04195FF5 for ; Wed, 29 Mar 2023 11:37:58 -0700 (PDT) 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=1680115076; 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=tIO3PhiOR2emercQwp44M6baOhhxEcQzHduTG2CPuKla6sVHmxWnHM9YWmEeKX28DgvZCV 9A+wF0Dv2nb8xskHclLbAXuQUuMRdY7xvjnkSyquQNWXMA6uaxWiNQqgVyLwJFW+XmE4Iy wvEeIkQDa8WA5AxpvHMez3p9xsgBnf0= 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 v2 1/5] kasan: drop empty tagging-related defines Date: Wed, 29 Mar 2023 20:37:44 +0200 Message-Id: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1761728428815738113?= X-GMAIL-MSGID: =?utf-8?q?1761728428815738113?= 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 */