Re: [RFC PATCH 06/14] khwasan: enable top byte ignore for the kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 02, 2018 at 08:44:25PM +0100, Andrey Konovalov wrote:
> +#ifdef CONFIG_KASAN_TAGS
> +#define TCR_TBI_FLAGS (TCR_TBI0 | TCR_TBI1)
> +#else
> +#define TCR_TBI_FLAGS TCR_TBI0
> +#endif

Rather than pulling TBI0 into this, I think it'd make more sense to
have:

#ifdef CONFIG_KASAN_TAGS
#define KASAN_TCR_FLAGS	TCR_TBI1
#else
#define KASAN_TCR_FLAGS
#endif

> +
>  #define MAIR(attr, mt)	((attr) << ((mt) * 8))
>  
>  /*
> @@ -432,7 +438,7 @@ ENTRY(__cpu_setup)
>  	 * both user and kernel.
>  	 */
>  	ldr	x10, =TCR_TxSZ(VA_BITS) | TCR_CACHE_FLAGS | TCR_SMP_FLAGS | \
> -			TCR_TG_FLAGS | TCR_ASID16 | TCR_TBI0 | TCR_A1
> +			TCR_TG_FLAGS | TCR_ASID16 | TCR_TBI_FLAGS | TCR_A1

... and just append KASAN_TCR_FLAGS to the flags here.

That's roughtly what we do with ENDIAN_SET_EL1 for SCTLR_EL1.

Thanks,
Mark.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux