Oops decoding help request

2020-08-23 Thread Giuseppe Sacco
Hello,
I am not a kernel developer and I need much help in order to understand
a kernel Oops (the first of a series of three Oops). It is:

kernel tried to execute exec-protected page (f102) - exploit attempt? (uid: 
0)
BUG: Unable to handle kernel instruction fetch
Faulting instruction address: 0xf102
Oops: Kernel access of bad area, sig: 11 [#1]
BE PAGE_SIZE=4K MMU=Hash PowerMac
Modules linked in: crct10dif_generic (+) crct10dif_common 
drm_panel_orientation_quirks
CPU: 0 PID: 71 Comm: systemd-udevd Not tainted 5.9.0-rc1+ #298
NIP:  f102 LR: c00053a4 CTR: f102
REGS: c1c6dd50 TRAP: 0400   Not tainted  (5.9.0-rc1+)
MSR:  10009032   CR: 2284  XER: 

GPR00: c0005390 c1c6de08 c1c6b400  0cc0 0008 ef6db038 0001
GPR08: 002e    2284 00b6fb58  0005
GPR16: bff0d768 bff0d770   01032cc0  00b0b31f 01020960
GPR24:  00b70954 010206c0 ef39f4a0  00a28380 f102 f10193a0
NIP [f102] crct10dif_mod_init+0x0/0x60 [crct10dif_generic]
LR [c00053a4] do_one_initcall+0x50/0x1f4
Call Trace:
[c1c6de08] [c0005390] do_one_initcall+0x3c/0x1f4 (unreliable)
[c1c6de78] [c0102068] do_init_module+0x6c/0x27c
[c1c6dea8] [c01053cc] sys_finit_module+0xc0/0x12c
[c1c6df38] [c001c11c] ret_from_syscall+0x0/0x34
--- interrupt: c01 at 0x7a7780
LR = 0xa1bf64
Instruction dump:
       
    <7c0802a6> 90010004 6000 9421fff0
---[ end trace 257a4bbda691894e ]---

>From what I understand, this is a problem in the init function of
module crct10dif_generic jumping at address f102.

I think I understand that f102 is an address for data and not for
code. In fact it belongs to "vmalloc & ioremap" area of the virtual
memory layout:
  * 0xffbee000..0xf000  : fixmap
  * 0xff40..0xff80  : highmem PTEs
  * 0xfda27000..0xff40  : early ioremap
  * 0xf100..0xfda27000  : vmalloc & ioremap

The init function is:

 :
   0:   7c 08 02 a6 mflrr0
   4:   90 01 00 04 stw r0,4(r1)
   8:   48 00 00 01 bl  8 
   c:   94 21 ff f0 stwur1,-16(r1)
  10:   7c 08 02 a6 mflrr0
  14:   3c 60 00 00 lis r3,0
  18:   90 01 00 14 stw r0,20(r1)
  1c:   38 63 00 00 addir3,r3,0
  20:   80 01 00 14 lwz r0,20(r1)
  24:   38 21 00 10 addir1,r1,16
  28:   7c 08 03 a6 mtlrr0
  2c:   48 00 00 00 b   2c 

and its source code is:

static int __init crct10dif_mod_init(void)
{
return crypto_register_shash();
}

This is what I am not understanding. The error message seems to imply
that code jumps to an invalid address, so the problem would be that
address of function crypto_register_shash is calculated wrongly.

About stack addresses, please note that CONFIG_VMAP_STACK is not set.

Is this a correct reasoning?

Thank you very much,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-08-24 Thread Giuseppe Sacco
Hello Christophe,

Il giorno lun, 24/08/2020 alle 07.17 +0200, Christophe Leroy ha
scritto:
> Hello Giuseppe,
[...]
> The Oopses in the video are fixed in 5.9-rc2, see my response to your 
> other mail.

Right, I just updated from git and rebuilt the kernel whith
CONFIG_VMAP_STACK not set and the machine boots correctly.

> So now we know that your kernel doesn't boot when CONFIG_VMAP_STACK is set.
> Can you remind the exact problem ?

latest kernel with CONFIG_VMAP_STACK set stops after writing:
pmac32_cpufreq: registering PowerMac CPU frequency driver
pmac32_cpufreq: Low: 667 MHz, High: 867 Mhz, Boot: 667 MHz

> One common problem with CONFIG_VMAP_STACK is when some drivers are 
> invalidly using buffers in stack for DMA.
> 
> Couldn't try with CONFIG_DEBUG_VIRTUAL (without CONFIG_VMAP_STACK) and 
> see if it triggers some warnings ?

I've just tried: it boots without any special warning. What should I
look for? This is an excerpt of dmesg output about the line it would
otherwise stop:

[...]
[6.566984] PowerMac i2c bus pmu 2 registered
[6.574879] PowerMac i2c bus pmu 1 registered
[6.582634] PowerMac i2c bus mac-io 0 registered
[6.590323] i2c i2c-2: No i2c address for 
/pci@f200/mac-io@17/i2c@18000/i2c-modem
[6.598290] PowerMac i2c bus uni-n 1 registered
[6.606196] i2c i2c-3: i2c-powermac: modalias failure on 
/uni-n@f800/i2c@f8001000/cereal@1c0
[6.614320] PowerMac i2c bus uni-n 0 registered
[6.622501] pmac32_cpufreq: Registering PowerMac CPU frequency driver
[6.630580] pmac32_cpufreq: Low: 667 Mhz, High: 867 Mhz, Boot: 667 Mhz
[6.639518] ledtrig-cpu: registered to indicate activity on CPUs
[6.647894] NET: Registered protocol family 10
[6.656492] Segment Routing with IPv6
[6.664490] mip6: Mobile IPv6
[6.672337] NET: Registered protocol family 17
[6.680213] mpls_gso: MPLS GSO support
[...]

Bye,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-08-21 Thread Giuseppe Sacco
Hello,

Il giorno ven, 21/08/2020 alle 16.03 +0200, Christophe Leroy ha
scritto:
[...]
> Thanks.
> 
> The Oops in the video shows that the issue is at 0x1bcac and msr
> value 
> shows that Instruction MMU is disabled. So this corresponds to
> address 
> 0xc001bcac. In the vmlinux you sent me this address is in 
> power_save_ppc32_restore()
> 
> This issue is fixed by 
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/7bce32ccbab3ba3e3e0f27da6961bf6313df97ed.1581663140.git.christophe.le...@c-s.fr/
> 
> 
> You also said in a previous mail that your original issue also
> happens 
> when CONFIG_VMAP_STACK is not selected. The above bug being linked
> to 
> CONFIG_VMAP_STACK, maybe it would be easier to bisect with 
> CONFIG_VMAP_STACK unselected.

I rebuilt the same kernel that I would otherwise have skipped because
of the other bug, and it worked, indeed.
I will continue my "bisect quest" unselecting VMAP_STACK in order to
speed up the bisecting.

Thank you very much,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-08-21 Thread Giuseppe Sacco
Hello Cristophe,

Il giorno ven, 21/08/2020 alle 08.55 +0200, Christophe Leroy ha
scritto:
> Hi Giuseppe,
> 
> Le 08/07/2020 à 20:44, Christophe Leroy a écrit :
> > 
> > Le 08/07/2020 à 19:36, Giuseppe Sacco a écrit :
> > > Hi Cristophe,
> > > 
> > > Il giorno mer, 08/07/2020 alle 19.09 +0200, Christophe Leroy ha
> > > scritto:
[...]
> > > > What's the result with:
> > > > 
> > > > LANG=C make ARCH=powerpc CROSS_COMPILE=powerpc-linux- vmlinux
> > > 
> > > $ LANG=C make ARCH=powerpc CROSS_COMPILE=powerpc-linux- vmlinux
> > >CALLscripts/checksyscalls.sh
> > >CALLscripts/atomic/check-atomics.sh
> > >CHK include/generated/compile.h
> > >CC  kernel/module.o
> > > kernel/module.c: In function 'do_init_module':
> > > kernel/module.c:3593:2: error: implicit declaration of function
> > > 'module_enable_ro'; did you mean 'module_enable_x'? [-Werror=implicit-
> > > function-declaration]
> > >   3593 |  module_enable_ro(mod, true);
> > >|  ^~~~
> > >|  module_enable_x
> > > cc1: some warnings being treated as errors
> > > make[1]: *** [scripts/Makefile.build:267: kernel/module.o] Error 1
> > > make: *** [Makefile:1735: kernel] Error 2
> > > 
> > > So, should I 'git bisect skip'?
> > 
> > Ah yes, I had the exact same problem last time I bisected.
> > 
> > So yes do 'git bisect skip'. You'll probably hit this problem half a 
> > dozen of times, but at the end you should get a usefull bisect anyway.
> > 
> 
> Were you able to progress ?

Very slowly. I am still working on it, currently at recompile #276.
git-bisect states that I have still about 700 commits to check, but the
real problem is that more than 60% of built kernels crash even before
displaying the cpu_freq message (probably another long lasting bug
hides the one I am looking for). All these skipped kernels make
bisecting very very slow.

A short video about the problem I face when I skip the build is here:
https://eppesuigoccas.homedns.org/~giuseppe/bug%20avvio%20powerbook%20g4.mp4

Bye,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-08-22 Thread Giuseppe Sacco
Hello Christophe,

Il giorno ven, 21/08/2020 alle 16.03 +0200, Christophe Leroy ha
scritto:
[...]
> Thanks.
> 
> The Oops in the video shows that the issue is at 0x1bcac and msr
> value 
> shows that Instruction MMU is disabled. So this corresponds to
> address 
> 0xc001bcac. In the vmlinux you sent me this address is in 
> power_save_ppc32_restore()
> 
> This issue is fixed by 
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/7bce32ccbab3ba3e3e0f27da6961bf6313df97ed.1581663140.git.christophe.le...@c-s.fr/
> 
> 
> You also said in a previous mail that your original issue also
> happens 
> when CONFIG_VMAP_STACK is not selected. The above bug being linked
> to 
> CONFIG_VMAP_STACK, maybe it would be easier to bisect with 
> CONFIG_VMAP_STACK unselected.

I was wrong. Disabling CONFIG_VMAP_STACK led me to all "good" compile
and bisect ended without finding the culprit commit.

So, I started from scratch: I rebuilt HEAD and found that it does show
the original problem I am facing, then I rebuilt it without
CONFIG_VMAP_STACK and found that it does pass (fix?) the problem, since
kernel continue booting, but then it stops with three Oops related to
command systemd-udevd.

You may find a video that displays the complete boot, vmlinux, config,
and system.map files here:

https://eppesuigoccas.homedns.org/~giuseppe/powerpc32/config-5.9.0-rc1+
https://eppesuigoccas.homedns.org/~giuseppe/powerpc32/System.map
https://eppesuigoccas.homedns.org/~giuseppe/powerpc32/VID_20200822_095621.mp4
https://eppesuigoccas.homedns.org/~giuseppe/powerpc32/vmlinux.strip.gz

Bye,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-08-27 Thread Giuseppe Sacco
Il giorno gio, 27/08/2020 alle 09.46 +0200, Giuseppe Sacco ha scritto:
> Il giorno gio, 27/08/2020 alle 00.28 +0200, Giuseppe Sacco ha scritto:
> > Hello Christophe,
> > 
> > Il giorno mer, 26/08/2020 alle 15.53 +0200, Christophe Leroy ha
> > scritto:
> > [...]
> > > If there is no warning, then the issue is something else, bad luck.
> > > 
> > > Could you increase the loglevel and try again both with and without 
> > > VMAP_STACK ? Maybe we'll get more information on where it stops.
> > 
> > The problem is related to the CPU frequency changes. This is where the
> > system stop: cpufreq get the CPU frequency limits and then start the
> > default governor (performance) and then calls function
> > cpufreq_gov_performance_limits() that never returns.
> > 
> > Rebuilding after enabling pr_debug for cpufreq.c, I've got some more
> > lines of output:
> > 
> > cpufreq: setting new policy for CPU 0: 667000 - 867000 kHz
> > cpufreq: new min and max freqs are 667000 - 867000 kHz
> > cpufreq: governor switch
> > cpufreq: cpufreq_init_governor: for CPU 0
> > cpufreq: cpufreq_start_governor: for CPU 0
> > cpufreq: target for CPU 0: 867000 kHz, relation 1, requested 867000 kHz
> > cpufreq: __target_index: cpu: 0, oldfreq: 667000, new freq: 867000
> > cpufreq: notification 0 of frequency transition to 867000 kHz
> > cpufreq: saving 133328 as reference value for loops_per_jiffy; freq is 
> > 667000 kHz
> > 
> > no more lines are printed. I think this output only refers to the
> > notification sent prior to the frequency change.
> > 
> > I was thinking that selecting a governor that would run at 667mHz would
> > probably skip the problem. I added cpufreq.default_governor=powersave
> > to the command line parameters but it did not work: the selected
> > governor was still performance and the system crashed.
> 
> I kept following the thread and found that CPU frequency is changed in
> function pmu_set_cpu_speed() in file drivers/cpufreq/pmac32-cpufreq.c.
> As first thing, the function calls the macro preempt_disable() and this
> is where it stops.

Sorry, I made a mistake. The real problem is down, on the same
function, when it calls low_sleep_handler(). This is where the problem
probably is.

Bye,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-08-26 Thread Giuseppe Sacco
Hello Christophe,

Il giorno mer, 26/08/2020 alle 15.53 +0200, Christophe Leroy ha
scritto:
[...]
> If there is no warning, then the issue is something else, bad luck.
> 
> Could you increase the loglevel and try again both with and without 
> VMAP_STACK ? Maybe we'll get more information on where it stops.

The problem is related to the CPU frequency changes. This is where the
system stop: cpufreq get the CPU frequency limits and then start the
default governor (performance) and then calls function
cpufreq_gov_performance_limits() that never returns.

Rebuilding after enabling pr_debug for cpufreq.c, I've got some more
lines of output:

cpufreq: setting new policy for CPU 0: 667000 - 867000 kHz
cpufreq: new min and max freqs are 667000 - 867000 kHz
cpufreq: governor switch
cpufreq: cpufreq_init_governor: for CPU 0
cpufreq: cpufreq_start_governor: for CPU 0
cpufreq: target for CPU 0: 867000 kHz, relation 1, requested 867000 kHz
cpufreq: __target_index: cpu: 0, oldfreq: 667000, new freq: 867000
cpufreq: notification 0 of frequency transition to 867000 kHz
cpufreq: saving 133328 as reference value for loops_per_jiffy; freq is 667000 
kHz

no more lines are printed. I think this output only refers to the
notification sent prior to the frequency change.

I was thinking that selecting a governor that would run at 667mHz would
probably skip the problem. I added cpufreq.default_governor=powersave
to the command line parameters but it did not work: the selected
governor was still performance and the system crashed.

Bye,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-08-27 Thread Giuseppe Sacco
Il giorno gio, 27/08/2020 alle 00.28 +0200, Giuseppe Sacco ha scritto:
> Hello Christophe,
> 
> Il giorno mer, 26/08/2020 alle 15.53 +0200, Christophe Leroy ha
> scritto:
> [...]
> > If there is no warning, then the issue is something else, bad luck.
> > 
> > Could you increase the loglevel and try again both with and without 
> > VMAP_STACK ? Maybe we'll get more information on where it stops.
> 
> The problem is related to the CPU frequency changes. This is where the
> system stop: cpufreq get the CPU frequency limits and then start the
> default governor (performance) and then calls function
> cpufreq_gov_performance_limits() that never returns.
> 
> Rebuilding after enabling pr_debug for cpufreq.c, I've got some more
> lines of output:
> 
> cpufreq: setting new policy for CPU 0: 667000 - 867000 kHz
> cpufreq: new min and max freqs are 667000 - 867000 kHz
> cpufreq: governor switch
> cpufreq: cpufreq_init_governor: for CPU 0
> cpufreq: cpufreq_start_governor: for CPU 0
> cpufreq: target for CPU 0: 867000 kHz, relation 1, requested 867000 kHz
> cpufreq: __target_index: cpu: 0, oldfreq: 667000, new freq: 867000
> cpufreq: notification 0 of frequency transition to 867000 kHz
> cpufreq: saving 133328 as reference value for loops_per_jiffy; freq is 667000 
> kHz
> 
> no more lines are printed. I think this output only refers to the
> notification sent prior to the frequency change.
> 
> I was thinking that selecting a governor that would run at 667mHz would
> probably skip the problem. I added cpufreq.default_governor=powersave
> to the command line parameters but it did not work: the selected
> governor was still performance and the system crashed.

I kept following the thread and found that CPU frequency is changed in
function pmu_set_cpu_speed() in file drivers/cpufreq/pmac32-cpufreq.c.
As first thing, the function calls the macro preempt_disable() and this
is where it stops.

Bye,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-08-27 Thread Giuseppe Sacco
Il giorno gio, 27/08/2020 alle 12.39 +0200, Christophe Leroy ha
scritto:
> Hi,
> 
> Le 27/08/2020 à 10:28, Giuseppe Sacco a écrit :
[...]
> > Sorry, I made a mistake. The real problem is down, on the same
> > function, when it calls low_sleep_handler(). This is where the problem
> > probably is.
> 
> Great, you spotted the problem.
> 
> I see what it is, it is in low_sleep_handler() in 
> arch/powerpc/platforms/powermac/sleep.S
> 
> All critical registers are saved on the stack. At restore, they are 
> restore BEFORE re-enabling MMU (because they are needed for that). But 
> when we have VMAP_STACK, the stack can hardly be accessed without the 
> MMU enabled. tophys() doesn't work for virtual stack addresses.
> 
> Therefore, the low_sleep_handler() has to be reworked for using an area 
> in the linear mem instead of the stack.

I am sorry, but I don't know how to fix it. Should I open a bug for
tracking this problem?

Thank you,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-08 Thread Giuseppe Sacco
Salut Cristophe,

Il giorno mer, 08/07/2020 alle 10.38 +0200, Christophe Leroy ha
scritto:
> Hi Giuseppe,
> 
> Le 08/07/2020 à 09:59, Giuseppe Sacco a écrit :
> > Hello Cristophe,
> > 
> > Il giorno mar, 07/07/2020 alle 17.34 +0200, Giuseppe Sacco ha
> > scritto:
[...]
> > > > And can you try without CONFIG_VMAP_STACK on 5.6.19
> > > 
> > > Sure, I'll let you know.
> > 
> > No, this change did not make the kernel boot. I only changed the
> > option
> > you proposed:
> > 
> > $ grep VMAP .config
> > CONFIG_HAVE_ARCH_VMAP_STACK=y
> > # CONFIG_VMAP_STACK is not set
> > 
> 
> Ok, at least it is not that. I wanted to be sure because this is a
> huge 
> change added recently that is selected by default.
> 
> I tried on QEMU with your config, it boots properly.
> 
> So I think the only way now will be to bisect. Hope you were able to 
> setup a cross compiler on a speedy machine.

thank you for your time; indeed I may now crosscompile the kernel in 15
minutes instead of about 390... I hope to have a final result in a
couple of days.

Bye,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-08 Thread Giuseppe Sacco
Hello Cristophe,

Il giorno mar, 07/07/2020 alle 17.34 +0200, Giuseppe Sacco ha scritto:
> Il giorno mar, 07/07/2020 alle 16.52 +0200, Christophe Leroy ha
> scritto:
> > Le 07/07/2020 à 16:03, Giuseppe Sacco a écrit :
> > > Hello Cristophe,
> > > 
> > > > Can you tell which defconfig you use or provide your .config
> > > 
> > > You may get the standard one from debian or a reduced one that I
> > > made on purpose. The latter is here:
> > > https://eppesuigoccas.homedns.org/~giuseppe/config-5.4.50.gz
> > > 
> > >  (boot)
> > > https://eppesuigoccas.homedns.org/~giuseppe/config-5.6.19.gz
> > > 
> > >  (no boot)
> > 
> > Thanks
> > 
> > Can you provide the complete output when it works, so that I can
> > see 
> > what is after the place it stops when it fails.
> 
> Here it is:
> https://eppesuigoccas.homedns.org/~giuseppe/dmesg-5.4.40-minimo.gz
> 
> 
> > And can you try without CONFIG_VMAP_STACK on 5.6.19
> 
> Sure, I'll let you know.

No, this change did not make the kernel boot. I only changed the option
you proposed:

$ grep VMAP .config 
CONFIG_HAVE_ARCH_VMAP_STACK=y
# CONFIG_VMAP_STACK is not set

Thanks,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-08 Thread Giuseppe Sacco
Hello,
while trying to debug a problem using git bisect, I am now at a point
where I cannot build the kernel at all. This is the error message I
get:

$ LANG=C make ARCH=powerpc \
 CROSS_COMPILE=powerpc-linux- \
 CONFIG_MODULE_COMPRESS_GZIP=true \
 INSTALL_MOD_STRIP=1 CONFIG_MODULE_COMPRESS=1 \
 -j4 INSTALL_MOD_PATH=$BOOT INSTALL_PATH=$BOOT \
 CONFIG_DEBUG_INFO_COMPRESSED=1 \
 install modules_install
make[2]: *** No rule to make target 'vmlinux', needed by
'arch/powerpc/boot/zImage.pmac'.  Stop.
make[1]: *** [arch/powerpc/Makefile:407: install] Error 2
make: *** [Makefile:328: __build_one_by_one] Error 2

How can I continue?

Thank you,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-08 Thread Giuseppe Sacco
Hi Cristophe,

Il giorno mer, 08/07/2020 alle 19.09 +0200, Christophe Leroy ha
scritto:
> Hi
> 
> Le 08/07/2020 à 19:00, Giuseppe Sacco a écrit :
> > Hello,
> > while trying to debug a problem using git bisect, I am now at a point
> > where I cannot build the kernel at all. This is the error message I
> > get:
> > 
> > $ LANG=C make ARCH=powerpc \
> >   CROSS_COMPILE=powerpc-linux- \
> >   CONFIG_MODULE_COMPRESS_GZIP=true \
> >   INSTALL_MOD_STRIP=1 CONFIG_MODULE_COMPRESS=1 \
> >   -j4 INSTALL_MOD_PATH=$BOOT INSTALL_PATH=$BOOT \
> >   CONFIG_DEBUG_INFO_COMPRESSED=1 \
> >   install modules_install
> > make[2]: *** No rule to make target 'vmlinux', needed by
> 
> Surprising.
> 
> Did you make any change to Makefiles ?

No

> Are you in the middle of a bisect ? If so, if the previous builds 
> worked, I'd do 'git bisect skip'

Yes, the previous one worked.

> What's the result with:
> 
> LANG=C make ARCH=powerpc CROSS_COMPILE=powerpc-linux- vmlinux

$ LANG=C make ARCH=powerpc CROSS_COMPILE=powerpc-linux- vmlinux
  CALLscripts/checksyscalls.sh
  CALLscripts/atomic/check-atomics.sh
  CHK include/generated/compile.h
  CC  kernel/module.o
kernel/module.c: In function 'do_init_module':
kernel/module.c:3593:2: error: implicit declaration of function
'module_enable_ro'; did you mean 'module_enable_x'? [-Werror=implicit-
function-declaration]
 3593 |  module_enable_ro(mod, true);
  |  ^~~~
  |  module_enable_x
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:267: kernel/module.o] Error 1
make: *** [Makefile:1735: kernel] Error 2

So, should I 'git bisect skip'?

Thank you,
Giuseppe



kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-07 Thread Giuseppe Sacco
Hello,
I am testing linux on a quite old hardware, an Apple PowerBook G4
"Titanium IV". I used to run Debian on this machine, so I upgraded the
old operating system to the latest software and found that new kernels
do not boot.
I rebuilt natively (on the powerbook) a few kernels and found that
5.4.50 still works fine, while 5.6.19 and 5.7.7 stop after printing:

pmac32_cpufreq: registering PowerMac CPU frequency driver
pmac32_cpufreq: Low: 667 MHz, High: 867 Mhz, Boot: 667 MHz

no more output is printed. I waited 5 minutes and then powered off the
machine using the power button. Rebooting with old kernel works.

So, I am looking for help. How may I better investigate the problem?
How may I crossbuild the kernel on a faster machine (amd64) in order to
try git-bisect without waiting ages?

Thank you,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-07 Thread Giuseppe Sacco
Hello Cristophe,

Il giorno mar, 07/07/2020 alle 15.35 +0200, Christophe Leroy ha
scritto:
> Hi,
> Le 07/07/2020 à 14:58, Giuseppe Sacco a écrit :
[...]
> > So, I am looking for help. How may I better investigate the
> > problem?
> > How may I crossbuild the kernel on a faster machine (amd64) in
> > order to
> > try git-bisect without waiting ages?
> 
> To crossbuild, use cross tools at 
> https://mirrors.edge.kernel.org/pub/tools/crosstool/

thank you, I'll have a look at it.

> Can you tell which defconfig you use or provide your .config

You may get the standard one from debian or a reduced one that I made
on purpose. The latter is here:
https://eppesuigoccas.homedns.org/~giuseppe/config-5.4.50.gz (boot)
https://eppesuigoccas.homedns.org/~giuseppe/config-5.6.19.gz (no boot)

Bye,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-07 Thread Giuseppe Sacco
Il giorno mar, 07/07/2020 alle 16.52 +0200, Christophe Leroy ha
scritto:
> 
> Le 07/07/2020 à 16:03, Giuseppe Sacco a écrit :
> > Hello Cristophe,
> > 
> > > Can you tell which defconfig you use or provide your .config
> > 
> > You may get the standard one from debian or a reduced one that I
> > made on purpose. The latter is here:
> > https://eppesuigoccas.homedns.org/~giuseppe/config-5.4.50.gz
> >  (boot)
> > https://eppesuigoccas.homedns.org/~giuseppe/config-5.6.19.gz
> >  (no boot)
> 
> Thanks
> 
> Can you provide the complete output when it works, so that I can see 
> what is after the place it stops when it fails.

Here it is:
https://eppesuigoccas.homedns.org/~giuseppe/dmesg-5.4.40-minimo.gz

> And can you try without CONFIG_VMAP_STACK on 5.6.19

Sure, I'll let you know.

Thank you,
Giuseppe



Re: [PATCH v2] powerpc/powermac: Fix low_sleep_handler with CONFIG_VMAP_STACK

2020-12-08 Thread Giuseppe Sacco
Hello Christophe,

Il giorno mar, 08/12/2020 alle 05.24 +, Christophe Leroy ha
scritto:
> low_sleep_handler() can't restore the context from standard
> stack because the stack can hardly be accessed with MMU OFF.
> 
> Store everything in a global storage area instead of storing
> a pointer to the stack in that global storage area.
> 
> To avoid a complete churn of the function, still use r1 as
> the pointer to the storage area during restore.
> 
> Reported-by: Giuseppe Sacco 
> Fixes: cd08f109e262 ("powerpc/32s: Enable CONFIG_VMAP_STACK")
> Signed-off-by: Christophe Leroy 
> ---
> This is only build tested. Giuseppe can you test it ? Thanks.
> 
> v2: Changed an erroneous 'addis' to 'addi' ; Using bss instead of
> data section
> Signed-off-by: Christophe Leroy 
> ---
>  arch/powerpc/platforms/Kconfig.cputype  |   2 +-
>  arch/powerpc/platforms/powermac/sleep.S | 132 +++---
> --
>  2 files changed, 60 insertions(+), 74 deletions(-)
[...]

I just tested the v2 patch against latest kernel. Please note that
yesterday patch was on a kernel named 5.10.0-rc6+, while today's patch
is on a kernel named 5.10.0-rc7+. Even with the latest kernel updates,
the patch apply correctly and machine boots normally, fixing the
problem.

$ uname -a
Linux titanium4 5.10.0-rc7+ #3 Tue Dec 8 09:11:20 CET 2020 ppc GNU/Linux
$ grep VMAP /boot/config-5.10.0-rc7+
CONFIG_HAVE_ARCH_VMAP_STACK=y
CONFIG_VMAP_STACK=y

Thank you again.

Bye,
Giuseppe