Closed aananthcn closed 3 years ago
Additional information: After 2 hours, when I get the hypervisor console prompt, I am able to attach to the guest by using tty attach vm0
command. But some of the commands such as ps
, top
, free
doesn't generate outputs.
minos # tty attach vm0
Attach tty: vm0 press any key to active the console
minos #
^C
pi@raspberrypi:~$ ps
^C
pi@raspberrypi:~$ ls /dev/
autofs initctl ram12 tty19 tty48 vcs1
block input ram13 tty2 tty49 vcs2
...
pi@raspberrypi:~$ ls
Bookshelf Documents minos Pictures Templates
Desktop Downloads Music Public Videos
pi@raspberrypi:~$ echo "Hi Aananth"
Hi Aananth
pi@raspberrypi:~$ top
^C
pi@raspberrypi:~$ free
^C
pi@raspberrypi:~$
I see so many ^C, have you type Ctrl-C ?
you mean you can not get the hypervisor console after system boot without waiting for system idle ?
Yes, for those few commands, I have to press Ctrl + c to get back to the command prompt. Otherwise, the system freezes for those commands. Please note that the commands top
, ps
and free
worked "as expected" before the system went to idle.
Yes for the 2nd question too. Unless the system goes to idle, I did not get the hypervisor control even after pressing Ctrl + d.
Could you help to fix this issue?
RP4 can works good, the Uart controller in rpi3b is same as RPI4. Currently I have no RPI3B board can use.
Yes I think, but help me how to proceed :-), Ctrl + d seems to be picked up by the Linux guest as 'logout' event. Are there any specific patch you added in RPi4 to pick up this event to switch console?
No specific patch for rpi4. The event handler code is in hypervisor under app/eh/shell. C
Sorry for the delay. In the code snippet below (drivers/serial/serial_bcm283x_mu.c), I don't see prints from line number 65 at all.
58 char bcm283x_mu_getc(void)
59 {
60 pr_notice("Debug-Aananth ~ %s() : %d\n", __func__, __LINE__);
61 if (!(ioread32(serial_base + AUX_MU_LSR) &
62 BCM283X_MU_LSR_RX_READY))
63 return 0;
64
65 pr_notice("Debug-Aananth ~ %s() : %d\n", __func__, __LINE__);
66 return ioread32(serial_base + AUX_MU_IO);
67 }
This means, the function call console_getc()
(apps/esh/shell.c) always gets 0 as return value and the for {}
loop in shell_task()
breaks at line 92. What could be the cause for ioread32() call in serial_bcm283x_mu.c:61 failing?
88 while (1) {
89 for (; ;) {
90 ch = console_getc();
91 if (ch <= 0)
92 break;
~~~~~~~~~~~~~~~~~~~~~~~~
110 }
111
112 msleep(10);
113 }
Is the address specified in the definition (shown below) in include/config/config.h correct?
#define CONFIG_UART_BASE 0x3f215040
In BCM2835 ARM Peripherals manual from Broadcom in page 8, I could see that the UART1 (the debug uart) base address as: 0x7E21 5040
Is the address specified in the definition (shown below) in include/config/config.h correct?
#define CONFIG_UART_BASE 0x3f215040
In BCM2835 ARM Peripherals manual from Broadcom in page 8, I could see that the UART1 (the debug uart) base address as: 0x7E21 5040
The address seems to be not a problem (I am not sure). But I suspect 2 other areas:
bcm283x_mu_init()
function, which may be the reason why the bcm283x_mu_getc()
always returns 0.shell.c::shell_task()
expects a tty=vm0 as boot argument, which I didn't had it before in u-boot. If this bootarg is not added, then open_tty()
is never called. I am still analysing the code and user manual of RPi3 chip.
👍🏻 the address is on. Now we are using polling mode, do not use interrupt.
1) If I delete the environment variable bootargs
in u-boot and start, then I get Press any key to stop vm startup:
prompt.
ps
, clear
. But command: tty attach vm0
results in freeze (this is expected as I stopped the VM from booting). And if I press ctrl + d, then the control fall back to hypervisor 👍 Debian GNU/Linux 10 pi3 ttyS0
and then goes back to login prompt in guest VM. I don't get hypervisor console at all.2) If I set bootargs="console=serial0,115200 console=tty1 tty=vm0"
, then I don't get any boot prompt! It directly goes to VM0 console (i.e, Linux guest).
If I press 'ctrl + d', from the Linux guest, then behaviour is same as 2nd bullet point above.
If I remove the console=ttyS0,115200
argument in cmdline =
variable in bcm2837-rpi-3-b-plus.dts file, then the switching between VM0 console and hypervisor with 'ctrl + d' was consistent, but the console was not responding to my keys (this is expected)
If I replace console=ttyS0,115200
with console=hvc0,115200
in bcm2837-rpi-3-b-plus.dts file, then the switching between VM0 console and hypervisor console using 'ctrl + d' was consistent. But I could see the dmesg logs when I made tty attach vm0
. The console was not interactive.
New suspect: 'console=ttyS0"
New suspect: 'console=ttyS0"
I think this is the point, We need use hvc0 not ttyS0. If use ttyS0 the VM0 will also read/write the uart. You can try remove the uart info in the DTS.
Hi LeMin, I replaced 'console=ttyS0' with 'console=hvc0', I could see the switch to hypervisor console happen if I press Ctrl+d. Also attach to VM0 console happens when I type "tty attach vm0" command from minos hypervisor console. But the guest console is not responsive to my inputs. The problem still persists.
Update: If I set 'console=hvc0' polling of input via console is not happening. If I set 'console=ttyS0' in bootargs, then polling of input is happening. That explains why the console is not responding with hvc0. Will deep dive further when I find time.
Good job👍
Update: suspecting that if I need s390-tools installed on my Linux guest to make the HVC0 to work with minos. I cross-compiled s390-tools/iucvterm and tried running icuvtty binary so that icuvtty could connect to the login program to minos, but I got error shown below:
iucvtty: The AF_IUCV address family is not available: Address family not supported by protocol
The above error means 2 things to me: 1) Linux kernel is not configured to support AF_IUCV sockets. 2) Point 1) indirectly means the approach I am taking to solve the non-responding terminal could be incorrect.
│ Symbol: HVC_CONSOLE [=n] │
│ Type : bool │
│ Prompt: pSeries Hypervisor Virtual Console support │
│ Location: │
│ -> Device Drivers │
│ (1) -> Character devices │
│ Defined at drivers/tty/hvc/Kconfig:14 │
│ Depends on: TTY [=y] && PPC_PSERIES │
│ Selects: HVC_DRIVER [=y] && HVC_IRQ [=y] │
Is HVC_CONSOLE=n (see above) is correct?
pSeries Hypervisor
yes it should be N, it is for pSeries Hypervisor
I followed the minos-hypervisor build instructions for Raspberry Pi 3B. I also followed the patches referred in https://github.com/minosproject/minos/issues/12.
I could not get the hypervisor console by pressing Ctrl + d. But if I leave the system idle for about 2 hours, I get this console. Let me know what additional information you need.