Re: [PATCH v3 24/39] arm64: mte: Add in-kernel MTE helpers

From: Vincenzo Frascino
Date: Fri Sep 25 2020 - 09:34:19 EST




On 9/25/20 1:50 PM, Catalin Marinas wrote:
>>>> + */
>>>> +SYM_FUNC_START(mte_assign_mem_tag_range)
>>>> + /* if (src == NULL) return; */
>>>> + cbz x0, 2f
>>>> + /* if (size == 0) return; */
>>>> + cbz x1, 2f
>>> I find these checks unnecessary, as I said a couple of times before,
>>> just document the function pre-conditions. They are also incomplete
>>> (i.e. you check for NULL but not alignment).
>>>
>> I thought we agreed to harden the code further, based on [1]. Maybe I
>> misunderstood. I am going to remove them and extend the comment in the next version.
>>
>> [1]
>> https://lore.kernel.org/linux-arm-kernel/921c4ed0-b5b5-bc01-5418-c52d80f1af59@xxxxxxx/
> Well, you concluded that but I haven't confirmed ;). Since it's called
> from a single place which does the checks already, I don't see the point
> in duplicating them. Documenting should be sufficient.

Have you ever heard about "tacit consent"? ;) Anw, fine by me, I will add a
comment here.

--
Regards,
Vincenzo