Re: [OE-Core][PATCH 3/3] qemuppc64: set the qemuppc64 nfs r/wsize mount options to 524288

2023-01-16 Thread Khem Raj
On Mon, Jan 16, 2023 at 6:05 PM Xiangyu Chen
 wrote:
>
> From: Xiangyu Chen 
>
> On master oe, build a qemuppc64 with systemd as default init, when we
> use nfs bootup, the kernel might panic due to missing symbol in dynamic
> libraries as below:
>
>   hid-generic 0003:0627:0001.0003: input: USB HID v0.01 Mouse [QEMU QEMU USB 
> Tablet] on usb-:00:01.0-3/input0
>   /sbin/init: /lib64/libm.so.6: version `XZ_5.0' not found (required by 
> /usr/lib64/libkmod.so.2)
>   Kernel panic - not syncing: Attempted to kill init! exitcode=0x7f00
>   CPU: 0 PID: 1 Comm: init Not tainted 5.15.78-yocto-standard #1
>   Call Trace:
>   [c7443ba0] [c09538d0] dump_stack_lvl+0x74/0xa8 (unreliable)
>   [c7443be0] [c0103524] panic+0x170/0x3cc
>   [c7443c80] [c010cf64] do_exit+0xb44/0xb50
>   [c7443d50] [c010d040] do_group_exit+0x60/0xd0
>   [c7443d90] [c010d0d4] sys_exit_group+0x24/0x30
>   [c7443db0] [c002cfd4] system_call_exception+0x194/0x2f0
>   [c7443e10] [c000c2cc] system_call_common+0xec/0x250
>   --- interrupt: c00 at 0x7fff9ed9e840
>   NIP:  7fff9ed9e840 LR: 7fff9ed7da20 CTR: 
>   REGS: c7443e80 TRAP: 0c00   Not tainted (5.15.78-yocto-standard)
>   MSR:  8280f033   CR: 24022442  
> XER: 
>
> One or more of the libraries systemd depends on failed to load due to
> unresolved symbols/functions.  This was intermittent - with a failure
> rate estimated between 5% and 30%.
>
> After checking the code, this issue happens on gcc 12, kirkstone is using
> gcc 11 works well, with both using the exact same v5.15.84 kernel commit.
>
> There is a kernel fix from upstream [1], they changed the rsize / wsize
> to a multiple of PAGE_SIZE, when we applied this patch, the qemuppc64's
> default r/wsize went from 4096 to 524288.But the qemuppc64 doesn't have
> its own linux-yocto kernel branch, so apply this change might cause
> regression with other platforms which share branch with qemuppc64.
>
> So, we added an extra option for nfs rootfs, and set the qemuppc64 default
> r/w size to 524288 to line up with the kernel fix[1].
>
> Yocto did a similar thing in the distant past[2] - prior to boot-arg
> adjustments existing - by allowing a Kconfig to set the defaults on
> nfsboot, in order to work around hardware limitations.
>
> Reference:
> [1] 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=940261a195080cf
> [2] 
> https://git.yoctoproject.org/linux-yocto-4.1/commit/?h=standard/base=a96cfd98add95
>
> Signed-off-by: Xiangyu Chen 
> ---
>  meta/conf/machine/qemuppc64.conf | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/conf/machine/qemuppc64.conf 
> b/meta/conf/machine/qemuppc64.conf
> index 304f06a30d..7709339313 100644
> --- a/meta/conf/machine/qemuppc64.conf
> +++ b/meta/conf/machine/qemuppc64.conf
> @@ -15,6 +15,7 @@ QB_MACHINE = "-machine pseries"
>  QB_CPU = "-cpu POWER9"
>  QB_SMP = "-smp 2"
>
> +QB_NFSROOTFS_EXTRA_OPT = "wsize=524288,rsize=524288"

lgtm

>  QB_KERNEL_CMDLINE_APPEND = "console=hvc0 nohugevmalloc"
>  #QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd"
>  QB_OPT_APPEND = "-usb -device usb-tablet"
> --
> 2.34.1
>
>
> 
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#176026): 
https://lists.openembedded.org/g/openembedded-core/message/176026
Mute This Topic: https://lists.openembedded.org/mt/96322356/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-Core][PATCH 3/3] qemuppc64: set the qemuppc64 nfs r/wsize mount options to 524288

2023-01-16 Thread Xiangyu Chen
From: Xiangyu Chen 

On master oe, build a qemuppc64 with systemd as default init, when we
use nfs bootup, the kernel might panic due to missing symbol in dynamic
libraries as below:

  hid-generic 0003:0627:0001.0003: input: USB HID v0.01 Mouse [QEMU QEMU USB 
Tablet] on usb-:00:01.0-3/input0
  /sbin/init: /lib64/libm.so.6: version `XZ_5.0' not found (required by 
/usr/lib64/libkmod.so.2)
  Kernel panic - not syncing: Attempted to kill init! exitcode=0x7f00
  CPU: 0 PID: 1 Comm: init Not tainted 5.15.78-yocto-standard #1
  Call Trace:
  [c7443ba0] [c09538d0] dump_stack_lvl+0x74/0xa8 (unreliable)
  [c7443be0] [c0103524] panic+0x170/0x3cc
  [c7443c80] [c010cf64] do_exit+0xb44/0xb50
  [c7443d50] [c010d040] do_group_exit+0x60/0xd0
  [c7443d90] [c010d0d4] sys_exit_group+0x24/0x30
  [c7443db0] [c002cfd4] system_call_exception+0x194/0x2f0
  [c7443e10] [c000c2cc] system_call_common+0xec/0x250
  --- interrupt: c00 at 0x7fff9ed9e840
  NIP:  7fff9ed9e840 LR: 7fff9ed7da20 CTR: 
  REGS: c7443e80 TRAP: 0c00   Not tainted (5.15.78-yocto-standard)
  MSR:  8280f033   CR: 24022442  
XER: 

One or more of the libraries systemd depends on failed to load due to
unresolved symbols/functions.  This was intermittent - with a failure
rate estimated between 5% and 30%.

After checking the code, this issue happens on gcc 12, kirkstone is using
gcc 11 works well, with both using the exact same v5.15.84 kernel commit.

There is a kernel fix from upstream [1], they changed the rsize / wsize
to a multiple of PAGE_SIZE, when we applied this patch, the qemuppc64's
default r/wsize went from 4096 to 524288.But the qemuppc64 doesn't have
its own linux-yocto kernel branch, so apply this change might cause
regression with other platforms which share branch with qemuppc64.

So, we added an extra option for nfs rootfs, and set the qemuppc64 default
r/w size to 524288 to line up with the kernel fix[1].

Yocto did a similar thing in the distant past[2] - prior to boot-arg
adjustments existing - by allowing a Kconfig to set the defaults on
nfsboot, in order to work around hardware limitations.

Reference:
[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=940261a195080cf
[2] 
https://git.yoctoproject.org/linux-yocto-4.1/commit/?h=standard/base=a96cfd98add95

Signed-off-by: Xiangyu Chen 
---
 meta/conf/machine/qemuppc64.conf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/conf/machine/qemuppc64.conf b/meta/conf/machine/qemuppc64.conf
index 304f06a30d..7709339313 100644
--- a/meta/conf/machine/qemuppc64.conf
+++ b/meta/conf/machine/qemuppc64.conf
@@ -15,6 +15,7 @@ QB_MACHINE = "-machine pseries"
 QB_CPU = "-cpu POWER9"
 QB_SMP = "-smp 2"
 
+QB_NFSROOTFS_EXTRA_OPT = "wsize=524288,rsize=524288"
 QB_KERNEL_CMDLINE_APPEND = "console=hvc0 nohugevmalloc"
 #QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd"
 QB_OPT_APPEND = "-usb -device usb-tablet"
-- 
2.34.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#176023): 
https://lists.openembedded.org/g/openembedded-core/message/176023
Mute This Topic: https://lists.openembedded.org/mt/96322356/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-