* Re: [linux-next:master] [init] b8de39bd1b: BUG:kernel_failed_in_early-boot_stage,last_printk:early_console_in_setup_code
[not found] <202404221524.4954a009-oliver.sang@intel.com>
@ 2024-04-22 8:29 ` Nam Cao
2024-04-22 9:18 ` Mike Rapoport
0 siblings, 1 reply; 3+ messages in thread
From: Nam Cao @ 2024-04-22 8:29 UTC (permalink / raw)
To: kernel test robot
Cc: oe-lkp, lkp, Linux Memory Management List, Andrew Morton,
Björn Töpel, Mike Rapoport, Andreas Dilger,
Arnd Bergmann, Changbin Du, Christophe Leroy, Geert Uytterhoeven,
Ingo Molnar, Krister Johansen, Luis Chamberlain,
Nick Desaulniers, Stephen Rothwell, Tejun Heo, Thomas Gleixner,
linux-kernel
On Mon, Apr 22, 2024 at 03:45:00PM +0800, kernel test robot wrote:
> kernel test robot noticed "BUG:kernel_failed_in_early-boot_stage,last_printk:early_console_in_setup_code" on:
>
> commit: b8de39bd1b76faffe7cd91e148a6d7d9bf4e38f7 ("init: fix allocated page overlapping with PTR_ERR")
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
I can reproduce the problem. I rebased this commit onto v6.8.7, I can still
observe the problem.
No immediate idea what is the problem. Backtrace from gdb goes crazy:
(gdb) bt
#0 0xffffffffb2074ded in ?? ()
#1 0x00000000000000a1 in ?? ()
#2 0x00000000000000a1 in ?? ()
#3 0x000000007ffff000 in ?? ()
#4 0x00000000543ff000 in ?? ()
#5 0x0000000000000000 in ?? ()
@akpm: drop this commit until this is figured out?
Best regards,
Nam
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-next:master] [init] b8de39bd1b: BUG:kernel_failed_in_early-boot_stage,last_printk:early_console_in_setup_code
2024-04-22 8:29 ` [linux-next:master] [init] b8de39bd1b: BUG:kernel_failed_in_early-boot_stage,last_printk:early_console_in_setup_code Nam Cao
@ 2024-04-22 9:18 ` Mike Rapoport
2024-04-22 10:18 ` Nam Cao
0 siblings, 1 reply; 3+ messages in thread
From: Mike Rapoport @ 2024-04-22 9:18 UTC (permalink / raw)
To: Nam Cao
Cc: kernel test robot, oe-lkp, lkp, Linux Memory Management List,
Andrew Morton, Björn Töpel, Andreas Dilger,
Arnd Bergmann, Changbin Du, Christophe Leroy, Geert Uytterhoeven,
Ingo Molnar, Krister Johansen, Luis Chamberlain,
Nick Desaulniers, Stephen Rothwell, Tejun Heo, Thomas Gleixner,
linux-kernel
On Mon, Apr 22, 2024 at 10:29:42AM +0200, Nam Cao wrote:
> On Mon, Apr 22, 2024 at 03:45:00PM +0800, kernel test robot wrote:
> > kernel test robot noticed "BUG:kernel_failed_in_early-boot_stage,last_printk:early_console_in_setup_code" on:
> >
> > commit: b8de39bd1b76faffe7cd91e148a6d7d9bf4e38f7 ("init: fix allocated page overlapping with PTR_ERR")
> > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
>
> I can reproduce the problem. I rebased this commit onto v6.8.7, I can still
> observe the problem.
>
> No immediate idea what is the problem. Backtrace from gdb goes crazy:
>
> (gdb) bt
> #0 0xffffffffb2074ded in ?? ()
> #1 0x00000000000000a1 in ?? ()
> #2 0x00000000000000a1 in ?? ()
> #3 0x000000007ffff000 in ?? ()
> #4 0x00000000543ff000 in ?? ()
> #5 0x0000000000000000 in ?? ()
The kernel config here has CONFIG_DEBUG_VIRTUAL=y, so __pa translates to
__phys_addr() in arch/x86/mm/physaddr.c and __pa(-PAGE_SIZE) triggers
VIRTUAL_BUG_ON(y >= KERNEL_IMAGE_SIZE);
x86 has __pa_nodebug() that does not do bounds check, but it cannot be used
in generic code because no other arch except s390 define it.
For now I don't have ideas how to make this work in the general case, so
probably we should only fix riscv for now.
> @akpm: drop this commit until this is figured out?
>
> Best regards,
> Nam
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-next:master] [init] b8de39bd1b: BUG:kernel_failed_in_early-boot_stage,last_printk:early_console_in_setup_code
2024-04-22 9:18 ` Mike Rapoport
@ 2024-04-22 10:18 ` Nam Cao
0 siblings, 0 replies; 3+ messages in thread
From: Nam Cao @ 2024-04-22 10:18 UTC (permalink / raw)
To: Mike Rapoport
Cc: kernel test robot, oe-lkp, lkp, Linux Memory Management List,
Andrew Morton, Björn Töpel, Andreas Dilger,
Arnd Bergmann, Changbin Du, Christophe Leroy, Geert Uytterhoeven,
Ingo Molnar, Krister Johansen, Luis Chamberlain,
Nick Desaulniers, Stephen Rothwell, Tejun Heo, Thomas Gleixner,
linux-kernel
On Mon, Apr 22, 2024 at 12:18:46PM +0300, Mike Rapoport wrote:
> The kernel config here has CONFIG_DEBUG_VIRTUAL=y, so __pa translates to
> __phys_addr() in arch/x86/mm/physaddr.c and __pa(-PAGE_SIZE) triggers
>
> VIRTUAL_BUG_ON(y >= KERNEL_IMAGE_SIZE);
RISCV also has a similar thing when CONFIG_DEBUG_VIRTUAL=y
>
> x86 has __pa_nodebug() that does not do bounds check, but it cannot be used
> in generic code because no other arch except s390 define it.
>
> For now I don't have ideas how to make this work in the general case, so
> probably we should only fix riscv for now.
Agree, let's just fix riscv for now. This time I will cook up something
safer, no more __pa() on a potentially invalid address.
Best regards,
Nam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-22 10:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <202404221524.4954a009-oliver.sang@intel.com>
2024-04-22 8:29 ` [linux-next:master] [init] b8de39bd1b: BUG:kernel_failed_in_early-boot_stage,last_printk:early_console_in_setup_code Nam Cao
2024-04-22 9:18 ` Mike Rapoport
2024-04-22 10:18 ` Nam Cao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox