ucb-bar / chipyard

An Agile RISC-V SoC Design Framework with in-order cores, out-of-order cores, accelerators, and more
https://chipyard.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
1.62k stars 638 forks source link

Building Linux with FireMarshal: invalid password for 'root' on 'console' #1656

Open luming-xyz opened 11 months ago

luming-xyz commented 11 months ago

Background Work

Chipyard Version and Hash

Release: 1.10.0 Hash: b7644b2455cc4bae190e811a5d8085f3aad85b87

OS Setup

when building linux with FIreMarshal, Some errors occurred while signing in as' root 'with password' FPGA '.

  1. Setup FireMarshal cd software/fireMarshal ./init-submodules.sh
  2. echo "board-dir : 'boards/prototype'" > $PATH_TO_FIREMARSHAL/marshal-config.yaml
  3. ./marshal -v -d build br-base.json # here the -d indicates --nodisk or initramfs
  4. ./marshal -v -d install -t prototype br-base.json
  5. spike images/prototype/br-base/br-base-bin-nodisk

Other Setup

No response

Current Behavior

OpenSBI v1.2-78-g5ccebf0


/ \ / __ _ _ __ (___ _) ' \ / \ '_ \ ___ \ _ < __ _) __/ ____) _) _ ____/ ./ _ _ _ _____/ _/___
_

Platform Name : ucbbar,spike-bare Platform Features : medeleg Platform HART Count : 1 Platform IPI Device : aclint-mswi Platform Timer Device : aclint-mtimer @ 10000000Hz Platform Console Device : uart8250 Platform HSM Device : --- Platform PMU Device : --- Platform Reboot Device : htif Platform Shutdown Device : htif Platform Suspend Device : --- Firmware Base : 0x80000000 Firmware Size : 232 KB Firmware RW Offset : 0x20000 Runtime SBI Version : 1.0

Domain0 Name : root Domain0 Boot HART : 0 Domain0 HARTs : 0* Domain0 Region00 : 0x0000000080000000-0x000000008001ffff M: (R,X) S/U: () Domain0 Region01 : 0x0000000080020000-0x000000008003ffff M: (R,W) S/U: () Domain0 Region02 : 0x0000000002080000-0x00000000020bffff M: (I,R,W) S/U: () Domain0 Region03 : 0x0000000002000000-0x000000000207ffff M: (I,R,W) S/U: () Domain0 Region04 : 0x0000000000000000-0xffffffffffffffff M: (R,W,X) S/U: (R,W,X) Domain0 Next Address : 0x0000000080200000 Domain0 Next Arg1 : 0x0000000081800000 Domain0 Next Mode : S-mode Domain0 SysReset : yes Domain0 SysSuspend : yes

Boot HART ID : 0 Boot HART Domain : root Boot HART Priv Version : v1.12 Boot HART Base ISA : rv64imafdc Boot HART ISA Extensions : time Boot HART PMP Count : 16 Boot HART PMP Granularity : 4 Boot HART PMP Address Bits: 54 Boot HART MHPM Count : 0 Boot HART MIDELEG : 0x0000000000000222 Boot HART MEDELEG : 0x000000000000b109 [ 0.000000] Linux version 6.2.0-297960-g71bece669db2 (luming@ming.lu) (riscv64-unknown-linux-gnu-gcc (g2ee5e430018) 12.2.0, GNU ld (GNU Binutils) 2.39) #5 SMP Wed Nov 8 19:47:13 CST 2023 [ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000 [ 0.000000] Machine model: ucbbar,spike-bare [ 0.000000] Forcing kernel command line to: console=ttyS0 console=ttySIF0 earlycon [ 0.000000] earlycon: ns16550a0 at MMIO 0x0000000010000000 (options '') [ 0.000000] printk: bootconsole [ns16550a0] enabled [ 0.000000] efi: UEFI not found. [ 0.000000] Zone ranges: [ 0.000000] DMA32 [mem 0x0000000080200000-0x00000000ffffffff] [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000080200000-0x00000000ffffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x00000000ffffffff] [ 0.000000] On node 0, zone DMA32: 512 pages in unavailable ranges [ 0.000000] SBI specification v1.0 detected [ 0.000000] SBI implementation ID=0x1 Version=0x10002 [ 0.000000] SBI TIME extension detected [ 0.000000] SBI IPI extension detected [ 0.000000] SBI RFENCE extension detected [ 0.000000] SBI SRST extension detected [ 0.000000] SBI HSM extension detected [ 0.000000] riscv: base ISA extensions acdfim [ 0.000000] riscv: ELF capabilities acdfim [ 0.000000] percpu: Embedded 18 pages/cpu s33304 r8192 d32232 u73728 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 515592 [ 0.000000] Kernel command line: console=ttyS0 console=ttySIF0 earlycon [ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear) [ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off [ 0.000000] Virtual kernel memory layout: [ 0.000000] fixmap : 0xff1bfffffee00000 - 0xff1bffffff000000 (2048 kB) [ 0.000000] pci io : 0xff1bffffff000000 - 0xff1c000000000000 ( 16 MB) [ 0.000000] vmemmap : 0xff1c000000000000 - 0xff20000000000000 (1024 TB) [ 0.000000] vmalloc : 0xff20000000000000 - 0xff60000000000000 (16384 TB) [ 0.000000] modules : 0xffffffff0151d000 - 0xffffffff80000000 (2026 MB) [ 0.000000] lowmem : 0xff60000000000000 - 0xff6000007fe00000 (2046 MB) [ 0.000000] kernel : 0xffffffff80000000 - 0xffffffffffffffff (2047 MB) [ 0.000000] Memory: 2020152K/2095104K available (4032K kernel code, 3050K rwdata, 2048K rodata, 12062K init, 359K bss, 74952K reserved, 0K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] rcu: Hierarchical RCU implementation. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=32 to nr_cpu_ids=1. [ 0.000000] rcu: RCU debug extended QS entry/exit. [ 0.000000] Tracing variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1 [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] riscv-intc: 64 local interrupts mapped [ 0.000000] plic: plic@c000000: mapped 31 interrupts with 1 handlers for 2 contexts. [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. [ 0.000000] riscv-timer: riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0] [ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns [ 0.000000] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns [ 0.000115] Console: colour dummy device 80x25 [ 0.000140] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=40000) [ 0.000160] pid_max: default: 32768 minimum: 301 [ 0.000230] LSM: initializing lsm=capability,integrity [ 0.000280] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.000300] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.001305] cblist_init_generic: Setting adjustable number of callback queues. [ 0.001320] cblist_init_generic: Setting shift to 0 and lim to 1. [ 0.001390] riscv: ELF compat mode unsupported [ 0.001405] ASID allocator using 16 bits (65536 entries) [ 0.001485] rcu: Hierarchical SRCU implementation. [ 0.001495] rcu: Max phase no-delay instances is 1000. [ 0.001655] EFI services will not be available. [ 0.001795] smp: Bringing up secondary CPUs ... [ 0.001805] smp: Brought up 1 node, 1 CPU [ 0.002165] devtmpfs: initialized [ 0.002740] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.002760] futex hash table entries: 256 (order: 2, 16384 bytes, linear) [ 0.002845] pinctrl core: initialized pinctrl subsystem [ 0.003090] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations [ 0.003115] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.003295] cpuidle: using governor menu [ 0.004190] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages [ 0.004205] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page [ 0.004715] clocksource: Switched to clocksource riscv_clocksource [ 0.016760] workingset: timestamp_bits=46 max_order=19 bucket_order=0 [ 0.017135] io scheduler mq-deadline registered [ 0.017145] io scheduler kyber registered [ 0.067565] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled [ 0.069410] printk: console [ttyS0] disabled [ 0.069450] 10000000.ns16550: ttyS0 at MMIO 0x10000000 (irq = 1, base_baud = 625000) is a 16550A [ 0.069475] printk: console [ttyS0] enabled [ 0.000000] Linux version 6.2.0-297960-g71bece669db2 (luming@ming.lu) (riscv64-unknown-linux-gnu-gcc (g2ee5e430018) 12.2.0, GNU ld (GNU Binutils) 2.39) #5 SMP Wed Nov 8 19:47:13 CST 2023 [ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000 [ 0.000000] Machine model: ucbbar,spike-bare [ 0.000000] Forcing kernel command line to: console=ttyS0 console=ttySIF0 earlycon [ 0.000000] earlycon: ns16550a0 at MMIO 0x0000000010000000 (options '') [ 0.000000] printk: bootconsole [ns16550a0] enabled [ 0.000000] efi: UEFI not found. [ 0.000000] Zone ranges: [ 0.000000] DMA32 [mem 0x0000000080200000-0x00000000ffffffff] [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000080200000-0x00000000ffffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x00000000ffffffff] [ 0.000000] On node 0, zone DMA32: 512 pages in unavailable ranges [ 0.000000] SBI specification v1.0 detected [ 0.000000] SBI implementation ID=0x1 Version=0x10002 [ 0.000000] SBI TIME extension detected [ 0.000000] SBI IPI extension detected [ 0.000000] SBI RFENCE extension detected [ 0.000000] SBI SRST extension detected [ 0.000000] SBI HSM extension detected [ 0.000000] riscv: base ISA extensions acdfim [ 0.000000] riscv: ELF capabilities acdfim [ 0.000000] percpu: Embedded 18 pages/cpu s33304 r8192 d32232 u73728 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 515592 [ 0.000000] Kernel command line: console=ttyS0 console=ttySIF0 earlycon [ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear) [ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off [ 0.000000] Virtual kernel memory layout: [ 0.000000] fixmap : 0xff1bfffffee00000 - 0xff1bffffff000000 (2048 kB) [ 0.000000] pci io : 0xff1bffffff000000 - 0xff1c000000000000 ( 16 MB) [ 0.000000] vmemmap : 0xff1c000000000000 - 0xff20000000000000 (1024 TB) [ 0.000000] vmalloc : 0xff20000000000000 - 0xff60000000000000 (16384 TB) [ 0.000000] modules : 0xffffffff0151d000 - 0xffffffff80000000 (2026 MB) [ 0.000000] lowmem : 0xff60000000000000 - 0xff6000007fe00000 (2046 MB) [ 0.000000] kernel : 0xffffffff80000000 - 0xffffffffffffffff (2047 MB) [ 0.000000] Memory: 2020152K/2095104K available (4032K kernel code, 3050K rwdata, 2048K rodata, 12062K init, 359K bss, 74952K reserved, 0K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] rcu: Hierarchical RCU implementation. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=32 to nr_cpu_ids=1. [ 0.000000] rcu: RCU debug extended QS entry/exit. [ 0.000000] Tracing variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1 [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] riscv-intc: 64 local interrupts mapped [ 0.000000] plic: plic@c000000: mapped 31 interrupts with 1 handlers for 2 contexts. [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. [ 0.000000] riscv-timer: riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0] [ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns [ 0.000000] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns [ 0.000115] Console: colour dummy device 80x25 [ 0.000140] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=40000) [ 0.000160] pid_max: default: 32768 minimum: 301 [ 0.000230] LSM: initializing lsm=capability,integrity [ 0.000280] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.000300] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.001305] cblist_init_generic: Setting adjustable number of callback queues. [ 0.001320] cblist_init_generic: Setting shift to 0 and lim to 1. [ 0.001390] riscv: ELF compat mode unsupported [ 0.001405] ASID allocator using 16 bits (65536 entries) [ 0.001485] rcu: Hierarchical SRCU implementation. [ 0.001495] rcu: Max phase no-delay instances is 1000. [ 0.001655] EFI services will not be available. [ 0.001795] smp: Bringing up secondary CPUs ... [ 0.001805] smp: Brought up 1 node, 1 CPU [ 0.002165] devtmpfs: initialized [ 0.002740] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.002760] futex hash table entries: 256 (order: 2, 16384 bytes, linear) [ 0.002845] pinctrl core: initialized pinctrl subsystem [ 0.003090] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations [ 0.003115] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.003295] cpuidle: using governor menu [ 0.004190] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages [ 0.004205] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page [ 0.004715] clocksource: Switched to clocksource riscv_clocksource [ 0.016760] workingset: timestamp_bits=46 max_order=19 bucket_order=0 [ 0.017135] io scheduler mq-deadline registered [ 0.017145] io scheduler kyber registered [ 0.067565] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled [ 0.069410] printk: console [ttyS0] disabled [ 0.069450] 10000000.ns16550: ttyS0 at MMIO 0x10000000 (irq = 1, base_baud = 625000) is a 16550A [ 0.069475] printk: console [ttyS0] enabled [ 0.072825] SuperH (H)SCI(F) driver initialized [ 0.072825] SuperH (H)SCI(F) driver initialized [ 0.078725] loop: module loaded [ 0.078725] loop: module loaded [ 0.079080] riscv-pmu-sbi: SBI PMU extension is available [ 0.079080] riscv-pmu-sbi: SBI PMU extension is available [ 0.079200] riscv-pmu-sbi: 16 firmware and 2 hardware counters [ 0.079200] riscv-pmu-sbi: 16 firmware and 2 hardware counters [ 0.079220] riscv-pmu-sbi: Perf sampling/filtering is not supported as sscof extension is not available [ 0.079220] riscv-pmu-sbi: Perf sampling/filtering is not supported as sscof extension is not available [ 0.098065] debug_vm_pgtable: [debug_vm_pgtable ]: Validating architecture page table helpers [ 0.098065] debug_vm_pgtable: [debug_vm_pgtable ]: Validating architecture page table helpers [ 0.112265] Freeing unused kernel image (initmem) memory: 12060K [ 0.112265] Freeing unused kernel image (initmem) memory: 12060K [ 0.116740] Run /init as init process [ 0.116740] Run /init as init process Running FireMarshal nodisk init Loading FireMarshal platform drivers Calling distro init Starting syslogd: OK Starting klogd: OK Running sysctl: OK Starting mdev... OK Saving random seed: [ 0.518830] random: dd: uninitialized urandom read (32 bytes read) [ 0.518830] random: dd: uninitialized urandom read (32 bytes read) OK Starting network: ip: socket: Function not implemented ip: socket: Function not implemented FAIL launching firemarshal workload run/command firemarshal workload run/command done

Welcome to Buildroot buildroot login: root root Password: fpga

Login incorrect login[90]: invalid password for 'root' on 'console' buildroot login: root root Password: fpga

Login incorrect login[90]: invalid password for 'root' on 'console' buildroot login: Login timed out after 60 seconds

Welcome to Buildroot buildroot login:

Expected Behavior

The same problem occurred in#1558 .but the root cause was not found. Do you have any suggestions for this issue?thankyou :)

Other Information

No response

luming-xyz commented 11 months ago

I found a way to avoid it by modifying BR2_ TARGET_ GENERIC_ ROOT_ PASSWD=""(fireMarshal/prototype/base workloads/br base/buildroot-config) to clear the password. And passed the testing of spike and FPGA prototype.

But the root cause of the problem has not been found yet, is it due to coding issues or something else?

T-K-233 commented 9 months ago

Encountered same issue here. Setting the password to "" hack works.

jerryz123 commented 9 months ago

Can someone PR removing the password to Firemarshal?