Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

clh: Set serial to "null" #2437

Closed
sboeuf opened this issue Feb 4, 2020 · 4 comments · Fixed by #2436
Closed

clh: Set serial to "null" #2437

sboeuf opened this issue Feb 4, 2020 · 4 comments · Fixed by #2436
Labels
bug Incorrect behaviour needs-review Needs to be assessed by the team.

Comments

@sboeuf
Copy link

sboeuf commented Feb 4, 2020

If we want to avoid any potential weird behavior regarding the boot of the guest kernel, it's better to provide an emulated serial port. Because we don't care about getting the logs from this port, we simply need to set it to "null" so that these logs get discarded.

@sboeuf sboeuf added bug Incorrect behaviour needs-review Needs to be assessed by the team. labels Feb 4, 2020
sboeuf pushed a commit to sboeuf/runtime-1 that referenced this issue Feb 4, 2020
The guest Linux kernel might try to access the serial port, and in case
the serial is "off", this might cause some slowness because the port is
not emulated at all. Problem is, when the port is not emulated, the
default value when reading the I/O port will be 0, which has a special
meaning in case of the serial port. It means there is some data ready
to be read, which the kernel might try to read for some time, causing
global system slowness.

That's why it's safer to use "null" by default as this means the serial
port will be emulated but anything written to it will be redirected to
/dev/null.

Fixes kata-containers#2437

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
@grahamwhaley
Copy link
Contributor

@sboeuf - I presume there is some way to debug kernel boot fails - to get the bootlog (other than dmesg from userland once it has booted) ?
Just for that time when we cannot boot a kernel and want to figure out why...

@sboeuf
Copy link
Author

sboeuf commented Feb 4, 2020

@grahamwhaley problem is, it might not prevent the kernel from booting, but just causing the kernel to boot slow. The kernel might be trying to read from the serial (because the I/O port 0x3f8 returns 0 when it should really return 0x60 to say the serial is idle) when there's nothing to read, but it would boot eventually.

@grahamwhaley
Copy link
Contributor

@sboeuf - sure. I meant more, is there some method to get the kernel boot messages - the boot log - out of clh, if we need to debug a bust boot? So, not 100% related to this Issue, but close :-).
I don't mind if it is something you have to enable in a config or command line somewhere, but ideally we'd not have to re-build the hypervisor iyswim.

@sboeuf
Copy link
Author

sboeuf commented Feb 4, 2020

@grahamwhaley oh yes the best way to get the kernel logs from CH is to run it with --serial tty and make sure you have console=ttyS0 as part of your kernel command line.

jcvenegas pushed a commit to jcvenegas/runtime that referenced this issue Feb 5, 2020
The guest Linux kernel might try to access the serial port, and in case
the serial is "off", this might cause some slowness because the port is
not emulated at all. Problem is, when the port is not emulated, the
default value when reading the I/O port will be 0, which has a special
meaning in case of the serial port. It means there is some data ready
to be read, which the kernel might try to read for some time, causing
global system slowness.

That's why it's safer to use "null" by default as this means the serial
port will be emulated but anything written to it will be redirected to
/dev/null.

Fixes kata-containers#2437

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
dong-liuliu pushed a commit to dong-liuliu/runtime that referenced this issue Feb 8, 2020
The guest Linux kernel might try to access the serial port, and in case
the serial is "off", this might cause some slowness because the port is
not emulated at all. Problem is, when the port is not emulated, the
default value when reading the I/O port will be 0, which has a special
meaning in case of the serial port. It means there is some data ready
to be read, which the kernel might try to read for some time, causing
global system slowness.

That's why it's safer to use "null" by default as this means the serial
port will be emulated but anything written to it will be redirected to
/dev/null.

Fixes kata-containers#2437

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
evanfoster pushed a commit to evanfoster/runtime that referenced this issue Mar 9, 2020
The guest Linux kernel might try to access the serial port, and in case
the serial is "off", this might cause some slowness because the port is
not emulated at all. Problem is, when the port is not emulated, the
default value when reading the I/O port will be 0, which has a special
meaning in case of the serial port. It means there is some data ready
to be read, which the kernel might try to read for some time, causing
global system slowness.

That's why it's safer to use "null" by default as this means the serial
port will be emulated but anything written to it will be redirected to
/dev/null.

Fixes kata-containers#2437

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Incorrect behaviour needs-review Needs to be assessed by the team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants