[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <292be779-a36b-49b5-a9b0-9a5aa222fd0c@gmail.com>
Date: Tue, 18 Nov 2025 12:14:12 +1300
From: Michael Schmitz <schmitzmic@...il.com>
To: Daniel Palmer <daniel@...ngy.jp>
Cc: Greg Ungerer <gerg@...nel.org>, geert@...ux-m68k.org,
linux-m68k@...ts.linux-m68k.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] m68k: Implement kernel memory protection
Daniel,
it might be possible to fix up the last (partially used) descriptor from
C code, if there's a limit field. I find the head.S assembly too much of
a headache to change, but that would certainly be safer.
Wasting up to 256 kB is a pain on 030. Maybe rather skip protecting the
last section?
(* ducks ... *)
Cheers,
Michael
On 18/11/25 11:01, Daniel Palmer wrote:
> Hi Michael,
>
> On Tue, 18 Nov 2025 at 02:41, Michael Schmitz <schmitzmic@...il.com> wrote:
>> Daniel,
>>
>> take a look at arch/m68k/kernel/head.S - 030 MMU setup uses early
>> termination descriptors for kernel memory, _not_ regular page tables.
> Yeah, so when setting write protect on the last bit of either the text
> or the rodata the end is getting rounded up to the next 256KB and
> write protecting too much.
> I worked that out and adding some alignment in the linker script so
> that everything after the places getting write protected is pushed off
> to the next 256KB does fix it but wastes some memory.
> Looking at the manual for the 68030 it seems like early termination
> descriptors can have a limit so I could set the alignment, fix up the
> limit and then give the wasted memory back. But we are using the short
> format that doesn't have the limit field.
>
> Cheers,
>
> Daniel
Powered by blists - more mailing lists