[PATCH 7/7] arm64: hugetlb: Add break-before-make logic for contiguous entries

Punit Agrawal punit.agrawal at arm.com
Wed Mar 22 11:14:44 PDT 2017



On 22/03/17 14:38, Mark Rutland wrote:
> On Tue, Mar 21, 2017 at 06:04:21PM +0000, Punit Agrawal wrote:
>> From: Steve Capper <steve.capper at arm.com>
>>
>> It has become apparent that one has to take special care when modifying
>> attributes of memory mappings that employ the contiguous bit.
>>
>> Both the requirement and the architecturally correct "Break-Before-Make"
>> technique of updating contiguous entries can be found described in:
>> ARM DDI 0487A.k_iss10775, "Misprogramming of the Contiguous bit",
>> page D4-1762.
>>
>> The huge pte accessors currently replace the attributes of contiguous
>> pte entries in place thus can, on certain platforms, lead to TLB
>> conflict aborts or even erroneous results returned from TLB lookups.
>>
>> This patch adds a helper function get_clear_flush(.) that clears a
>> contiguous entry and returns the head pte (whilst taking care to
>> retain dirty bit information that could have been modified by DBM).
>> A tlb invalidate is performed to then ensure that there is no
>> possibility of multiple tlb entries being present for the same
>> region.
>
> Since its evidently easy to miss, can we please add a comment above
> get_clear_flush() regarding the BBM requirement, e.g.
>
> /*
>  * Changing some bits of contiguous entries requires us to follow a
>  * Break-Before-Make approach, breaking the whole contiguous set before
>  * we can change any entries. See ARM DDI 0487A.k_iss10775,
>  * "Misprogramming of the Contiguous bit", page D4-1762.
>  *
>  * This helper performs the break step.
>  */
>
> Otherwise, this looks good to me, and to the best of my knowledge avoids
> the issue described above.
>
> FWIW:
>
> Reviewed-by: Mark Rutland <mark.rutland at arm.com>

Hi Mark,

Thanks for reviewing the patches. I'll address your comments and post a
new version in a day or two.

Thanks,
Punit

>
> Mark.
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.



More information about the linux-arm-kernel mailing list