Re: [PATCH v14 5/8] arm64: mte: Enable TCO in functions that can read beyond buffer limits
From: Vincenzo Frascino <vincenzo.frascino@arm.com>
Date: 2021-03-09 10:23:08
Also in:
lkml
From: Vincenzo Frascino <vincenzo.frascino@arm.com>
Date: 2021-03-09 10:23:08
Also in:
lkml
On 3/8/21 6:09 PM, Mark Rutland wrote:
quoted
+DECLARE_STATIC_KEY_FALSE(mte_async_mode);Can we please hide this behind something like: static inline bool system_uses_mte_async_mode(void) { return IS_ENABLED(CONFIG_KASAN_HW_TAGS) && static_branch_unlikely(&mte_async_mode); } ... like we do for system_uses_ttbr0_pan()?
I agree, it is a cleaner solution. I will add it to v15.
That way the callers are easier to read, and kernels built without CONFIG_KASAN_HW_TAGS don't have the static branch at all. I reckon you can put that in one of hte mte headers and include it where needed.
-- Regards, Vincenzo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel