From: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>
To: Michael Schmitz <schmitzmic@gmail.com>,
linux-m68k@lists.linux-m68k.org, linux-mm@kvack.org,
linux-mtd@lists.infradead.org
Cc: Greg Ungerer <gerg@linux-m68k.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Christoph Hellwig <hch@infradead.org>,
wbx@openadk.org
Subject: Re: m68k 54418 fails to execute user space
Date: Wed, 26 Jun 2024 09:01:48 +0200 [thread overview]
Message-ID: <d1536f25-6c4a-4696-974e-1119cf2a6da3@yoseli.org> (raw)
In-Reply-To: <7fb2988d-ab89-405f-8cf1-edcdd2196376@gmail.com>
Michael,
On 26/06/2024 03:56, Michael Schmitz wrote:
> Jean-Michel,
>
> On 24/06/24 20:56, Jean-Michel Hautbois wrote:
>>
>> When I printk the do_page_fault first debug, I get for the first call
>> to ls:
>> bash-5.2# ls
>> [ 14.700000] do page fault:
>> [ 14.700000] regs->sr=0x0, regs->pc=0x70069ee6, address=0x70069ee6,
>> 0, (ptrval)
>
> Page not present, read fault. Please disable obfuscation of kernel
> pointer addresses by printk. Maybe also disable address space
> randomization while debugging this.
>
>> This call works almost fine (I still have the assert failed:
>> folio->private != NULL issue).
>>
>> And when I call it a second time, I get:
>> bash-5.2# ls
>> [ 19.820000] do page fault:
>> [ 19.820000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700e2004,
>> 2, (ptrval)
>
> Page not present, write fault.
>
> It would be helpful if you could get a dump of /proc/1/maps before the
> execve() syscall in your helloworld init replacement. That might confirm
> all these addresses are legit (assuming mappings survive across
> execve(), that is), and what they correspond to.
I changed the code a bit, and display an error only when error_code is
not 0. The result is for the bash launch:
[ 3.864000] Run /bin/bash as init process
[ 3.865000] with arguments:
[ 3.866000] /bin/bash
[ 3.868000] with environment:
[ 3.869000] HOME=/
[ 3.871000] TERM=linux
[ 4.250000] do page fault:
[ 4.250000] regs->sr=0x2000, regs->pc=0x41366984, address=0x700b3364,
2, 41fb0000
[ 4.258000] do page fault:
[ 4.258000] regs->sr=0x2000, regs->pc=0x41366984, address=0x6002140c,
2, 41fb0000
[ 4.273000] do page fault:
[ 4.273000] regs->sr=0x0, regs->pc=0x60011996, address=0x6001ff74, 3,
41fb0000
[ 4.332000] do page fault:
[ 4.332000] regs->sr=0x10, regs->pc=0x60012bf4, address=0x700adf44,
3, 41fb0000
[ 4.497000] do page fault:
[ 4.497000] regs->sr=0x0, regs->pc=0x60016344, address=0x600592d0, 2,
41fb0000
[ 4.505000] do page fault:
[ 4.505000] regs->sr=0x10, regs->pc=0x60007320, address=0x60055f54,
3, 41fb0000
[ 4.533000] do page fault:
[ 4.533000] regs->sr=0x0, regs->pc=0x60016344, address=0x60066244, 2,
41fb0000
[ 4.539000] do page fault:
[ 4.539000] regs->sr=0x10, regs->pc=0x60007320, address=0x60065f54,
3, 41fb0000
[ 4.635000] do page fault:
[ 4.635000] regs->sr=0x0, regs->pc=0x600098d2, address=0x60068014, 2,
41fb0000
[ 4.637000] do page fault:
[ 4.637000] regs->sr=0x0, regs->pc=0x60016344, address=0x600a2d1c, 2,
41fb0000
[ 4.647000] do page fault:
[ 4.647000] regs->sr=0x10, regs->pc=0x60007320, address=0x600a1f54,
3, 41fb0000
[ 5.163000] do page fault:
[ 5.163000] regs->sr=0x0, regs->pc=0x60016344, address=0x601d1d28, 2,
41fb0000
[ 5.175000] do page fault:
[ 5.175000] regs->sr=0x10, regs->pc=0x60007320, address=0x601cdf44,
3, 41fb0000
[ 5.212000] do page fault:
[ 5.212000] regs->sr=0x14, regs->pc=0x6000b04a, address=0x601ce004,
2, 41fb0000
[ 5.373000] do page fault:
[ 5.373000] regs->sr=0x14, regs->pc=0x6000b04a, address=0x60056004,
2, 41fb0000
[ 5.396000] random: crng init done
[ 5.401000] do page fault:
[ 5.401000] regs->sr=0x14, regs->pc=0x6000b04a, address=0x700ae004,
2, 41fb0000
[ 5.414000] do page fault:
[ 5.414000] regs->sr=0x0, regs->pc=0x6000b42a, address=0x700b0000, 2,
41fb0000
[ 5.487000] do page fault:
[ 5.487000] regs->sr=0x0, regs->pc=0x6019cbf0, address=0x601d5010, 2,
41fb0000
[ 5.488000] do page fault:
[ 5.488000] regs->sr=0x0, regs->pc=0x6019cbf6, address=0x601db288, 2,
41fb0000
[ 5.552000] do page fault:
[ 5.552000] regs->sr=0x0, regs->pc=0x600e1032, address=0x601d21d4, 3,
41fb0000
[ 5.569000] do page fault:
[ 5.569000] regs->sr=0x0, regs->pc=0x600df938, address=0x700ba8e4, 2,
41fb0000
[ 5.580000] do page fault:
[ 5.580000] regs->sr=0x8, regs->pc=0x70038476, address=0x700b4890, 2,
41fb0000
[ 5.634000] do page fault:
[ 5.634000] regs->sr=0x0, regs->pc=0x6011cbf2, address=0x700be004, 2,
41fb0000
[ 5.677000] do page fault:
[ 5.677000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700c71b4, 2,
41fb0000
[ 5.684000] do page fault:
[ 5.684000] regs->sr=0x2004, regs->pc=0x410a724a, address=0x700c0000,
2, 41fb0000
[ 5.686000] do page fault:
[ 5.686000] regs->sr=0x2004, regs->pc=0x410a724a, address=0x700c2000,
2, 41fb0000
[ 6.058000] do page fault:
[ 6.058000] regs->sr=0x10, regs->pc=0x7004b63c, address=0x700b8d2a,
3, 41fb0000
[ 6.206000] do page fault:
[ 6.206000] regs->sr=0x0, regs->pc=0x700365d2, address=0x6005a468, 2,
41fb0000
[ 6.231000] do page fault:
[ 6.231000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700c483c, 2,
41fb0000
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
[ 6.327000] do page fault:
[ 6.327000] regs->sr=0x4, regs->pc=0x70092344, address=0x700bc410, 3,
41fb0000
[ 6.349000] do page fault:
[ 6.349000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700c80f4, 2,
41fb0000
[ 6.438000] do page fault:
[ 6.438000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700ca114, 2,
41fb0000
[ 6.452000] do page fault:
[ 6.452000] regs->sr=0x8, regs->pc=0x600f28d0, address=0xbffcfd4c, 2,
41fb0000
[ 6.481000] do page fault:
[ 6.481000] regs->sr=0x0, regs->pc=0x6008b6a8, address=0xbffcd1a0, 2,
41fb0000
[ 6.493000] do page fault:
[ 6.493000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700cc474, 2,
41fb0000
[ 6.516000] do page fault:
[ 6.516000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700ce1bc, 2,
41fb0000
[ 6.517000] do page fault:
[ 6.517000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700d000c, 2,
41fb0000
[ 6.519000] do page fault:
[ 6.519000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700d246c, 2,
41fb0000
[ 6.520000] do page fault:
[ 6.520000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700d42bc, 2,
41fb0000
[ 6.528000] do page fault:
[ 6.528000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700d6004, 2,
41fb0000
[ 6.543000] do page fault:
[ 6.543000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700d8584, 2,
41fb0000
[ 6.544000] do page fault:
[ 6.544000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700da3d4, 2,
41fb0000
[ 6.546000] do page fault:
[ 6.546000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700dc224, 2,
41fb0000
[ 6.547000] do page fault:
[ 6.547000] regs->sr=0x0, regs->pc=0x6011d65a, address=0x700de074, 2,
41fb0000
[ 6.576000] do page fault:
[ 6.576000] regs->sr=0x0, regs->pc=0x6011ca12, address=0x700e02c4, 2,
41fb0000
bash-5.2#
My kernel is loaded at 0x41000000.
JM
next prev parent reply other threads:[~2024-06-26 7:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 12:29 Jean-Michel Hautbois
2024-06-24 8:56 ` Jean-Michel Hautbois
2024-06-26 1:56 ` Michael Schmitz
2024-06-26 5:35 ` Jean-Michel Hautbois
2024-06-26 7:01 ` Jean-Michel Hautbois [this message]
2024-06-26 13:28 ` Jean-Michel Hautbois
2024-06-26 19:36 ` Michael Schmitz
2024-06-26 20:29 ` Jean-Michel Hautbois
2024-06-27 12:36 ` Jean-Michel Hautbois
2024-06-27 14:46 ` Greg Ungerer
2024-06-27 14:52 ` Jean-Michel Hautbois
2024-06-27 23:58 ` Michael Schmitz
2024-06-28 7:24 ` Jean-Michel Hautbois
2024-06-28 7:48 ` Michael Schmitz
2024-06-28 8:02 ` Jean-Michel Hautbois
2024-06-28 11:25 ` Jean-Michel Hautbois
2024-06-29 3:41 ` Michael Schmitz
2024-06-29 7:57 ` Jean-Michel Hautbois
[not found] ` <87msn4z15c.fsf@linux-m68k.org>
2024-06-29 8:01 ` Michael Schmitz
2024-06-30 22:35 ` Greg Ungerer
2024-07-01 5:47 ` Jean-Michel Hautbois
2024-07-01 8:01 ` Andreas Schwab
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=d1536f25-6c4a-4696-974e-1119cf2a6da3@yoseli.org \
--to=jeanmichel.hautbois@yoseli.org \
--cc=geert@linux-m68k.org \
--cc=gerg@linux-m68k.org \
--cc=hch@infradead.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mm@kvack.org \
--cc=linux-mtd@lists.infradead.org \
--cc=schmitzmic@gmail.com \
--cc=wbx@openadk.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