Skip to contentSkip to conversation

kvm tools: Speed up PS/2 mouse detection

PATCH In review Sasha Levin 2 participants 4 messages Aug 11, 2011 – Aug 12, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 kvm tools: Speed up PS/2 mouse detection

This patch speeds up PS/2 mouse detection by switching to the fastest probing method compatible with kvm tools i8042 emulation.

The result is detection taking < 0.5 sec instead of >5 sec.

---
 tools/kvm/builtin-run.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/kvm/builtin-run.c +1 -1
index be61304..2816774 100644
@@ -587,7 +587,7 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
 		vidmode = 0;
 
 	memset(real_cmdline, 0, sizeof(real_cmdline));
-	strcpy(real_cmdline, "notsc noapic noacpi pci=conf1 reboot=k panic=1");
+	strcpy(real_cmdline, "notsc noapic noacpi pci=conf1 reboot=k panic=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1");
 	if (vnc || sdl) {
 		strcat(real_cmdline, " video=vesafb console=tty0");
 	} else
Signature · 1 line
1.7.6
#1 lore raw

PATCH 2/2 kvm tools: Use correct offset for virtio-net config space

This patch fixes the read action of virtio-net config by not handling reads to the start of the space as MSI related operations.

This fixes the MAC configuration of the device and makes uip network work again.

---
 tools/kvm/virtio/net.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
tools/kvm/virtio/net.c +0 -6
index 35d4997..a74f1e7 100644
@@ -221,12 +221,6 @@ static bool virtio_net_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 por
 		kvm__irq_line(kvm, pci_header.irq_line, VIRTIO_IRQ_LOW);
 		ndev.isr = VIRTIO_IRQ_LOW;
 		break;
-	case VIRTIO_MSI_CONFIG_VECTOR:
-		ioport__write16(data, ndev.config_vector);
-		break;
-	case VIRTIO_MSI_QUEUE_VECTOR:
-		ioport__write16(data, ndev.vq_vector[ndev.queue_selector]);
-		break;
 	default:
 		ret = virtio_net_pci_io_device_specific_in(data, offset, size, count);
 	};
Signature · 1 line
1.7.6
#2 lore raw

Re: [PATCH 2/2] kvm tools: Use correct offset for virtio-net config space

Quoted 8 lines · Sasha Levin

This patch fixes the read action of virtio-net config by not handling reads to the start of the space as MSI related operations.

This fixes the MAC configuration of the device and makes uip network work again.

Which commit broke it?

Quoted 21 lines
---
 tools/kvm/virtio/net.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
tools/kvm/virtio/net.c +0 -6
index 35d4997..a74f1e7 100644
@@ -221,12 +221,6 @@ static bool virtio_net_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 por
 		kvm__irq_line(kvm, pci_header.irq_line, VIRTIO_IRQ_LOW);
 		ndev.isr = VIRTIO_IRQ_LOW;
 		break;
-	case VIRTIO_MSI_CONFIG_VECTOR:
-		ioport__write16(data, ndev.config_vector);
-		break;
-	case VIRTIO_MSI_QUEUE_VECTOR:
-		ioport__write16(data, ndev.vq_vector[ndev.queue_selector]);
-		break;
 	default:
 		ret = virtio_net_pci_io_device_specific_in(data, offset, size, count);
 	};
#3 lore raw

Re: [PATCH 2/2] kvm tools: Use correct offset for virtio-net config space

Quoted 5 lines · Pekka Enberg
Quoted 4 lines · Sasha Levin

This patch fixes the read action of virtio-net config by not handling reads to the start of the space as MSI related operations.

Quoted 7 lines
Quoted 4 lines

This fixes the MAC configuration of the device and makes uip network work again.

Which commit broke it?

The MSI-X one. I wasn't aware that pings always work in uip so I assumed it was working when I sent that patch.

Quoted 23 lines
Quoted 21 lines
---
 tools/kvm/virtio/net.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
tools/kvm/virtio/net.c +0 -6
index 35d4997..a74f1e7 100644
@@ -221,12 +221,6 @@ static bool virtio_net_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 por
 		kvm__irq_line(kvm, pci_header.irq_line, VIRTIO_IRQ_LOW);
 		ndev.isr = VIRTIO_IRQ_LOW;
 		break;
-	case VIRTIO_MSI_CONFIG_VECTOR:
-		ioport__write16(data, ndev.config_vector);
-		break;
-	case VIRTIO_MSI_QUEUE_VECTOR:
-		ioport__write16(data, ndev.vq_vector[ndev.queue_selector]);
-		break;
 	default:
 		ret = virtio_net_pci_io_device_specific_in(data, offset, size, count);
 	};
Signature · 1 line
Sasha.