Skip to contentSkip to conversation

linux-next: rr tree build failure

DISCUSSION Applied Stephen Rothwell 3 participants 4 messages Nov 25, 2008 – Nov 27, 2008

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi Rusty,

Today's linux-next build (powerpc ppc64_defconfig) failed like this:

arch/powerpc/sysdev/mpic.c:809: error: conflicting types for 'mpic_set_affinity' arch/powerpc/sysdev/mpic.h:39: error: previous declaration of 'mpic_set_affinity' was here

The declaration in the header file was missed.

Also, the x86_64 allmodconfig build failed like this:

ERROR: "hvc_resize" [drivers/char/virtio_console.ko] undefined!

hvc_resize is currently not exported to modules.

I have dropped the rr tree again.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#1 lore raw
Quoted 7 lines · On Tuesday 25 November 2008 17:15:54 Stephen Rothwell wrote:

Hi Rusty,

Today's linux-next build (powerpc ppc64_defconfig) failed like this:

arch/powerpc/sysdev/mpic.c:809: error: conflicting types for 'mpic_set_affinity' arch/powerpc/sysdev/mpic.h:39: error: previous declaration of 'mpic_set_affinity' was here

Thanks, fixed. Grepping found some more sparc ones, too.

Quoted 9 lines

The declaration in the header file was missed.

Also, the x86_64 allmodconfig build failed like this:

ERROR: "hvc_resize" [drivers/char/virtio_console.ko] undefined!

hvc_resize is currently not exported to modules.

I have dropped the rr tree again.

OK, I've dropped Christian's patch for the moment until he fixes this. I'm travelling to Sydney for the day so I won't get a chance to fix this if it breaks tomorrow :(

Rusty.

#2 lore raw

Am Dienstag, 25. November 2008 schrieb Rusty Russell:

Quoted 11 lines
Quoted 7 lines

Also, the x86_64 allmodconfig build failed like this:

ERROR: "hvc_resize" [drivers/char/virtio_console.ko] undefined!

hvc_resize is currently not exported to modules.

I have dropped the rr tree again.

OK, I've dropped Christian's patch for the moment until he fixes this. I'm travelling to Sydney for the day so I won't get a chance to fix this if it breaks tomorrow :(

Ok. Sorry about that. allmodconfig on s390 and i386 select VIRTIO_CONSOLE as
(y) and not as (m), therefore my tests did not trigger this problem. I will try to get an x86_64 box to test on in the future.

This version of the patch adds an EXPORT_SYMBOL_GPL. Feel free to add it whenever it fits your schedule.

[PATCH 1/2]: virtio_console: support console resizing

From: Christian Borntraeger <[email protected]>

this patch uses the new hvc callback hvc_resize to set the window site which allows to change the tty size of hvc_console via a hvc_resize function.

I have added a new feature bit VIRTIO_CONSOLE_F_SIZE. The driver will change the window size on tty open and via the config_changed callback of the transport. Currently lguest and kvm_s390 have not implemented this callback, but the callback can be implemented at a later point in time.

---
 drivers/char/hvc_console.c     |    1 +
 drivers/char/virtio_console.c  |   30 +++++++++++++++++++++++++++++-
 include/linux/virtio_console.h |   11 +++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)
drivers/char/hvc_console.c +1 -0
Index: kvm/drivers/char/hvc_console.c
===================================================================
@@ -694,6 +694,7 @@ void hvc_resize(struct hvc_struct *hp, s
 		schedule_work(&hp->tty_resize);
 	}
 }
+EXPORT_SYMBOL_GPL(hvc_resize);
 
 /*
  * This kthread is either polling or interrupt driven.  This is determined by
drivers/char/virtio_console.c +29 -1
Index: kvm/drivers/char/virtio_console.c
===================================================================
@@ -138,12 +138,33 @@ int __init virtio_cons_early_init(int (*
 }
 
 /*
+ * virtio console configuration. This supports:
+ * - console resize
+ */
+static void virtcons_apply_config(struct virtio_device *dev)
+{
+	struct winsize ws;
+
+	if (virtio_has_feature(dev, VIRTIO_CONSOLE_F_SIZE)) {
+		dev->config->get(dev,
+				 offsetof(struct virtio_console_config, cols),
+				 &ws.ws_col, sizeof(u16));
+		dev->config->get(dev,
+				 offsetof(struct virtio_console_config, rows),
+				 &ws.ws_row, sizeof(u16));
+		hvc_resize(hvc, ws);
+	}
+}
+
+/*
  * we support only one console, the hvc struct is a global var
- * There is no need to do anything
+ * We set the configuration at this point, since we now have a tty
  */
 static int notifier_add_vio(struct hvc_struct *hp, int data)
 {
 	hp->irq_requested = 1;
+	virtcons_apply_config(vdev);
+
 	return 0;
 }
 
@@ -234,11 +255,18 @@ static struct virtio_device_id id_table[
 	{ 0 },
 };
 
+static unsigned int features[] = {
+	VIRTIO_CONSOLE_F_SIZE,
+};
+
 static struct virtio_driver virtio_console = {
+	.feature_table = features,
+	.feature_table_size = ARRAY_SIZE(features),
 	.driver.name =	KBUILD_MODNAME,
 	.driver.owner =	THIS_MODULE,
 	.id_table =	id_table,
 	.probe =	virtcons_probe,
+	.config_changed = virtcons_apply_config,
 };
 
 static int __init init(void)
include/linux/virtio_console.h +11 -0
Index: kvm/include/linux/virtio_console.h
===================================================================
@@ -7,6 +7,17 @@
 /* The ID for virtio console */
 #define VIRTIO_ID_CONSOLE	3
 
+/* Feature bits */
+#define VIRTIO_CONSOLE_F_SIZE	0	/* Does host provide console size? */
+
+struct virtio_console_config {
+	/* colums of the screens */
+	__u16 cols;
+	/* rows of the screens */
+	__u16 rows;
+} __attribute__((packed));
+
+
 #ifdef __KERNEL__
 int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int));
 #endif /* __KERNEL__ */
#3 lore raw
Quoted 9 lines · On Tuesday 25 November 2008 23:06:26 Christian Borntraeger wrote:

Am Dienstag, 25. November 2008 schrieb Rusty Russell:

Quoted 8 lines
Quoted 7 lines

Also, the x86_64 allmodconfig build failed like this:

ERROR: "hvc_resize" [drivers/char/virtio_console.ko] undefined!

hvc_resize is currently not exported to modules.

I have dropped the rr tree again.

Quoted 7 lines
Quoted 3 lines

OK, I've dropped Christian's patch for the moment until he fixes this. I'm travelling to Sydney for the day so I won't get a chance to fix this if it breaks tomorrow :(

Ok. Sorry about that. allmodconfig on s390 and i386 select VIRTIO_CONSOLE as (y) and not as (m), therefore my tests did not trigger this problem. I will try to get an x86_64 box to test on in the future.

Thanks, applied.

For future reference I've taken to preferring fixup patches, which I can fold later.

Cheers,
Rusty.