Michael, here are two virtio/s390 patches for 4.8. First, Jing Liu noticed that she could trigger panics while playing around with hvc0 as preferred console but no virtio console: This can be fixed by not discarding our early_put_chars after init (as the minimal fix). This made us wonder why we still have that code around when no current host code supports the old transport: We have no idea whether this still works, and it's probably a good idea to put a deprecation message in there to check whether anyone screams. Patches are against your vhost branch. Christian Borntraeger (1): virtio/s390: keep early_put_chars Cornelia Huck (1): virtio/s390: deprecate old transport arch/s390/Kconfig | 13 +++++++++++++ drivers/s390/virtio/Makefile | 6 +++++- drivers/s390/virtio/kvm_virtio.c | 4 +++- 3 files changed, 21 insertions(+), 2 deletions(-) -- 2.6.6
From: Christian Borntraeger <borntraeger at de.ibm.com> In case the registration of the hvc tty never happens AND the kernel thinks that hvc0 is the preferred console we should keep the early printk function to avoid a kernel panic due to code being removed. Signed-off-by: Christian Borntraeger <borntraeger at de.ibm.com> Signed-off-by: Jing Liu <liujbjl at linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck at de.ibm.com> --- drivers/s390/virtio/kvm_virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/virtio/kvm_virtio.c b/drivers/s390/virtio/kvm_virtio.c index 1d060fd..b0a849f 100644 --- a/drivers/s390/virtio/kvm_virtio.c +++ b/drivers/s390/virtio/kvm_virtio.c @@ -482,7 +482,7 @@ static int __init kvm_devices_init(void) } /* code for early console output with virtio_console */ -static __init int early_put_chars(u32 vtermno, const char *buf, int count) +static int early_put_chars(u32 vtermno, const char *buf, int count) { char scratch[17]; unsigned int len = count; -- 2.6.6
There only ever have been two host implementations of the old s390-virtio (pre-ccw) transport: the experimental kuli userspace, and qemu. As qemu switched its default to ccw with 2.4 (with most users having used ccw well before that) and removed the old transport entirely in 2.6, s390-virtio probably hasn't been in active use for quite some time and is therefore likely to bitrot. Let's start the slow march towards removing the code by deprecating it. Note that this also deprecates the early virtio console code, which has been causing trouble in the guest without being wired up in any relevant hypervisor code. Acked-by: Christian Borntraeger <borntraeger at de.ibm.com> Reviewed-by: Dong Jia Shi <bjsdjshi at linux.vnet.ibm.com> Reviewed-by: Sascha Silbe <silbe at linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck at de.ibm.com> --- arch/s390/Kconfig | 13 +++++++++++++ drivers/s390/virtio/Makefile | 6 +++++- drivers/s390/virtio/kvm_virtio.c | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index a8c2590..80fffc2 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -875,4 +875,17 @@ config S390_GUEST Select this option if you want to run the kernel as a guest under the KVM hypervisor. +config S390_GUEST_OLD_TRANSPORT + def_bool y + prompt "Guest support for old s390 virtio transport (DEPRECATED)" + depends on S390_GUEST + help + Enable this option to add support for the old s390-virtio + transport (i.e. virtio devices NOT based on virtio-ccw). This + type of virtio devices is only available on the experimental + kuli userspace or with old (< 2.6) qemu. If you are running + with a modern version of qemu (which supports virtio-ccw since + 1.4 and uses it by default since version 2.4), you probably won't + need this. + endmenu diff --git a/drivers/s390/virtio/Makefile b/drivers/s390/virtio/Makefile index 241891a..df40692 100644 --- a/drivers/s390/virtio/Makefile +++ b/drivers/s390/virtio/Makefile @@ -6,4 +6,8 @@ # it under the terms of the GNU General Public License (version 2 only) # as published by the Free Software Foundation. -obj-$(CONFIG_S390_GUEST) += kvm_virtio.o virtio_ccw.o +s390-virtio-objs := virtio_ccw.o +ifdef CONFIG_S390_GUEST_OLD_TRANSPORT +s390-virtio-objs += kvm_virtio.o +endif +obj-$(CONFIG_S390_GUEST) += $(s390-virtio-objs) diff --git a/drivers/s390/virtio/kvm_virtio.c b/drivers/s390/virtio/kvm_virtio.c index b0a849f..5e5c11f 100644 --- a/drivers/s390/virtio/kvm_virtio.c +++ b/drivers/s390/virtio/kvm_virtio.c @@ -458,6 +458,8 @@ static int __init kvm_devices_init(void) if (test_devices_support(total_memory_size) < 0) return -ENODEV; + pr_warn("The s390-virtio transport is deprecated. Please switch to a modern host providing virtio-ccw.\n"); + rc = vmem_add_mapping(total_memory_size, PAGE_SIZE); if (rc) return rc; -- 2.6.6
On Thu, Jul 07, 2016 at 05:07:55PM +0200, Cornelia Huck wrote:> Michael, > > here are two virtio/s390 patches for 4.8. > > First, Jing Liu noticed that she could trigger panics while playing > around with hvc0 as preferred console but no virtio console: This > can be fixed by not discarding our early_put_chars after init (as > the minimal fix). > > This made us wonder why we still have that code around when no current > host code supports the old transport: We have no idea whether this > still works, and it's probably a good idea to put a deprecation > message in there to check whether anyone screams. > > Patches are against your vhost branch.thanks!> Christian Borntraeger (1): > virtio/s390: keep early_put_chars > > Cornelia Huck (1): > virtio/s390: deprecate old transport > > arch/s390/Kconfig | 13 +++++++++++++ > drivers/s390/virtio/Makefile | 6 +++++- > drivers/s390/virtio/kvm_virtio.c | 4 +++- > 3 files changed, 21 insertions(+), 2 deletions(-) > > -- > 2.6.6
On Thu, 7 Jul 2016 19:42:52 +0300 "Michael S. Tsirkin" <mst at redhat.com> wrote:> On Thu, Jul 07, 2016 at 05:07:55PM +0200, Cornelia Huck wrote: > > Michael, > > > > here are two virtio/s390 patches for 4.8. > > > > First, Jing Liu noticed that she could trigger panics while playing > > around with hvc0 as preferred console but no virtio console: This > > can be fixed by not discarding our early_put_chars after init (as > > the minimal fix). > > > > This made us wonder why we still have that code around when no current > > host code supports the old transport: We have no idea whether this > > still works, and it's probably a good idea to put a deprecation > > message in there to check whether anyone screams. > > > > Patches are against your vhost branch. > > thanks!Hm, don't see these in 4.8-rc1...> > > Christian Borntraeger (1): > > virtio/s390: keep early_put_chars > > > > Cornelia Huck (1): > > virtio/s390: deprecate old transport > > > > arch/s390/Kconfig | 13 +++++++++++++ > > drivers/s390/virtio/Makefile | 6 +++++- > > drivers/s390/virtio/kvm_virtio.c | 4 +++- > > 3 files changed, 21 insertions(+), 2 deletions(-) > > > > -- > > 2.6.6 >