[PATCH v2] s390/sclp_vt220: Fix console name to match device

2021-04-27 Thread Valentin Vidic
Console name reported in /proc/consoles:

  ttyS1-W- (EC p  )4:65

does not match the char device name:

  crw--w1 root root4,  65 May 17 12:18 /dev/ttysclp0

so debian-installer inside a QEMU s390x instance gets confused and fails
to start with the following error:

  steal-ctty: No such file or directory

Signed-off-by: Valentin Vidic 
---
 v2: also update preferred console for VT220 case

 arch/s390/kernel/setup.c   | 2 +-
 drivers/s390/char/sclp_vt220.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 72134f9f6ff5..3ec6ca9c26c0 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -165,7 +165,7 @@ static void __init set_preferred_console(void)
else if (CONSOLE_IS_3270)
add_preferred_console("tty3270", 0, NULL);
else if (CONSOLE_IS_VT220)
-   add_preferred_console("ttyS", 1, NULL);
+   add_preferred_console("ttysclp", 0, NULL);
else if (CONSOLE_IS_HVC)
add_preferred_console("hvc", 0, NULL);
 }
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c
index 047f812d1a1c..71ed1bf15598 100644
--- a/drivers/s390/char/sclp_vt220.c
+++ b/drivers/s390/char/sclp_vt220.c
@@ -35,8 +35,8 @@
 #define SCLP_VT220_MINOR   65
 #define SCLP_VT220_DRIVER_NAME "sclp_vt220"
 #define SCLP_VT220_DEVICE_NAME "ttysclp"
-#define SCLP_VT220_CONSOLE_NAME"ttyS"
-#define SCLP_VT220_CONSOLE_INDEX   1   /* console=ttyS1 */
+#define SCLP_VT220_CONSOLE_NAME"ttysclp"
+#define SCLP_VT220_CONSOLE_INDEX   0   /* console=ttysclp0 */
 
 /* Representation of a single write request */
 struct sclp_vt220_request {
-- 
2.20.1



Re: Bester installation image missing virtio net Modulen

2021-04-27 Thread Valentin Vidic
On Tue, Apr 27, 2021 at 03:34:15PM +0200, Christian Borntraeger wrote:
> That is OK. I will try to test it then on LPAR and find someone that will test
> it on z/VM. Please remove the cc stable as I want to have this tested for
> a while. Hopefully it only affects the ttysclp0 console, which is not the
> default console for z/VM and LPAR. We would at least need to change the
> device driver and commands documentation. Anything else?

Ok, I was able to build a recent kernel with the patch. debian-installer
starts now and console info is as expected:

~ # uname -a
Linux (none) 5.12.0+ #21 SMP Tue Apr 27 17:26:32 CEST 2021 s390x GNU/Linux

~ # dmesg | grep console -i
[2.591718] Console: colour dummy device 80x25
[2.600725] printk: console [ttysclp0] enabled

~ # cat /proc/consoles 
ttysclp0 -W- (EC p  )4:65

~ # ls -l /dev/ttysclp0 
crw--w1 root root4,  65 Apr 27 16:30 /dev/ttysclp0

-- 
Valentin



Re: Bester installation image missing virtio net Modulen

2021-04-27 Thread Christian Borntraeger




On 27.04.21 14:40, Valentin Vidic wrote:

On Tue, Apr 27, 2021 at 12:08:01PM +0200, Christian Borntraeger wrote:

I think we did not tell him to go away. It was just that the patch itself
has some downsides in that it can break existing howtos (that do contain
console=tty0).

We could revisit the initial patch (I think we also need to change
arch/s390/kernel/setup.c set_preferred_console) and then
we would need to test all possible combinations on LPAR, KVM, z/VM
and see if we could fixup existing documentation.

Would Valentin be willing to provide a new version that also touches
setup.c?


Sure, I can try to update that patch, but would probably only be able to
test it with KVM.


That is OK. I will try to test it then on LPAR and find someone that will test
it on z/VM. Please remove the cc stable as I want to have this tested for
a while. Hopefully it only affects the ttysclp0 console, which is not the
default console for z/VM and LPAR. We would at least need to change the
device driver and commands documentation. Anything else?



Re: Bester installation image missing virtio net Modulen

2021-04-27 Thread Valentin Vidic
On Tue, Apr 27, 2021 at 12:08:01PM +0200, Christian Borntraeger wrote:
> I think we did not tell him to go away. It was just that the patch itself
> has some downsides in that it can break existing howtos (that do contain
> console=tty0).
> 
> We could revisit the initial patch (I think we also need to change
> arch/s390/kernel/setup.c set_preferred_console) and then
> we would need to test all possible combinations on LPAR, KVM, z/VM
> and see if we could fixup existing documentation.
> 
> Would Valentin be willing to provide a new version that also touches
> setup.c?

Sure, I can try to update that patch, but would probably only be able to
test it with KVM.

-- 
Valentin



Re: Bester installation image missing virtio net Modulen

2021-04-27 Thread Christian Borntraeger




On 27.04.21 09:22, Philipp Kern wrote:

On 26.04.21 10:52, Benjamin Zimmermann wrote:
  $ sudo virt-install [...] --extra-args 'console=ttysclp0 [...]


I do see the 'steal_ctty failure' otherwise.


I'd be cool if someone from IBM could actually go and fix [1] in some
form or another. Valentin tried[2] to do that in the kernel and got told
off. Maybe the answer is to bring this to linux-390 but I don't actually
know.


I think we did not tell him to go away. It was just that the patch itself
has some downsides in that it can break existing howtos (that do contain
console=tty0).

We could revisit the initial patch (I think we also need to change
arch/s390/kernel/setup.c set_preferred_console) and then
we would need to test all possible combinations on LPAR, KVM, z/VM
and see if we could fixup existing documentation.

Would Valentin be willing to provide a new version that also touches
setup.c?

Or, as an alternative we could revisit Valentins initial patch for the
installer.


I think technically what we want is "just" for /proc/consoles to do the
right thing or have a way to map console name to tty name.

Kind regards
Philipp Kern

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961056
[2] https://lkml.org/lkml/2020/5/19/854





Re: Bester installation image missing virtio net Modulen

2021-04-27 Thread Philipp Kern
On 26.04.21 10:52, Benjamin Zimmermann wrote:
 $ sudo virt-install [...] --extra-args 'console=ttysclp0 [...]
> 
> I do see the 'steal_ctty failure' otherwise.

I'd be cool if someone from IBM could actually go and fix [1] in some
form or another. Valentin tried[2] to do that in the kernel and got told
off. Maybe the answer is to bring this to linux-390 but I don't actually
know.

I think technically what we want is "just" for /proc/consoles to do the
right thing or have a way to map console name to tty name.

Kind regards
Philipp Kern

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961056
[2] https://lkml.org/lkml/2020/5/19/854