Re: [PATCH v6 13/15] sh: cast away constness from the zero page when flushing it from the cache

From: Ard Biesheuvel

Date: Thu May 28 2026 - 02:17:59 EST


Hi Mike,

On Thu, 28 May 2026, at 07:46, Mike Rapoport wrote:
> On Tue, May 26, 2026 at 07:59:00PM +0200, Ard Biesheuvel wrote:
>> From: Ard Biesheuvel <ardb@xxxxxxxxxx>
>>
>> SH performs cache maintenance on the zero page during boot, presumably
>> to ensure that any clearing of BSS that has occurred at startup is
>> visible to other CPUs and DMA devices.
>
> It flushes the cache there because before 6215d9f4470f ("arch, mm:
> consolidate empty_zero_page") empty_zero_page used was for boot parameters
> at the very early boot.
>
> I removed memset(empty_zero_page, 0, PAGE_SIZE) that was a line above but
> missed the cache flush.
>
> This whole "clear zero-page" can be removed IMO.
>

Good point.