mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Daniel Palmer <daniel@thingy.jp>
Cc: Greg Ungerer <gerg@kernel.org>,
	geert@linux-m68k.org, linux-m68k@lists.linux-m68k.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] m68k: Implement kernel memory protection
Date: Tue, 18 Nov 2025 12:14:12 +1300	[thread overview]
Message-ID: <292be779-a36b-49b5-a9b0-9a5aa222fd0c@gmail.com> (raw)
In-Reply-To: <CAFr9PXkF4CUYUNaYQGuadAm5fCn65hMJDdGo=zwcPDaq4zOxSQ@mail.gmail.com>

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@gmail.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

  reply	other threads:[~2025-11-17 23:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-16 22:05 Daniel Palmer
2025-11-17  3:04 ` Greg Ungerer
2025-11-17  9:42   ` Daniel Palmer
2025-11-17 17:41     ` Michael Schmitz
2025-11-17 22:01       ` Daniel Palmer
2025-11-17 23:14         ` Michael Schmitz [this message]
2025-11-18 10:55           ` Daniel Palmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=292be779-a36b-49b5-a9b0-9a5aa222fd0c@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=daniel@thingy.jp \
    --cc=geert@linux-m68k.org \
    --cc=gerg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®