Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1035224rwl; Wed, 29 Mar 2023 11:38:52 -0700 (PDT) X-Google-Smtp-Source: AKy350ZvBbUapt1smnXxSHx/zw40U7hmzU9SJ7oLdiO/0rK+gNAKnN9eMaQg77PixQ7R6LJ/cMWP X-Received: by 2002:a17:906:1e89:b0:91d:9745:407a with SMTP id e9-20020a1709061e8900b0091d9745407amr3284095ejj.14.1680115132354; Wed, 29 Mar 2023 11:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680115132; cv=none; d=google.com; s=arc-20160816; b=SjgbuhLCgDLsflhFzoYnOwRjJZ+FcUUmRiCEy6e8hq5KrjL+dRLbNbTAxOpz3v0O/Q mzerCFAcoFkcn3p1qjap0qw4ms/QYbkhmhvZ+Fu7/NKYpOlOtmRQxIhJQSPaYq3L5qs5 n+g3kICyRQlH1k72cR93bzVwCbM2gAX1MBpdnjY2twx9Emnpd1xsGM4XxFmytXV5p/vf 5hGHWfeh8VMO1JJf7q5xdVflFw5079vt0/5M/18Kcr4MfPGs1Izn97qus5hsPeqEnkBv CcAG3vPIHGFgFZrRsOsp9hXQtcMt+s+jd4tkiDp4ckiFVFVUuaKp58IhC5hHvAsCbHer xiWQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg39-20020a170907a42700b009334edaed9asi29443819ejc.976.2023.03.29.11.38.28; Wed, 29 Mar 2023 11:38:52 -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 S229570AbjC2SiK (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 Content-Transfer-Encoding: 8bit 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 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 */ -- 2.25.1