* [PATCH] kvm tools: Fix IRQ mapping
@ 2011-08-11 9:04 Sasha Levin
2011-08-11 9:04 ` [PATCH] kvm tools: Use correct size for VESA memory bar Sasha Levin
2011-08-11 9:17 ` [PATCH] kvm tools: Fix IRQ mapping Pekka Enberg
0 siblings, 2 replies; 7+ messages in thread
From: Sasha Levin @ 2011-08-11 9:04 UTC (permalink / raw)
To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, Sasha Levin
This thread fixes two issues:
- Slave IRQCHIP was mapped wrong, this caused all IRQs which belong
to it to be ignored (breaking such things as the mouse).
- Line 2 was being mapped, since it's the link between slave and master
IRQCHIPs it shouldn't be.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
tools/kvm/irq.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/kvm/irq.c b/tools/kvm/irq.c
index 85e2238..e35bf18 100644
--- a/tools/kvm/irq.c
+++ b/tools/kvm/irq.c
@@ -147,17 +147,18 @@ void irq__init(struct kvm *kvm)
/* Hook first 8 GSIs to master IRQCHIP */
for (i = 0; i < 8; i++)
- irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_MASTER, i);
+ if (i != 2)
+ irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_MASTER, i);
/* Hook next 8 GSIs to slave IRQCHIP */
for (i = 8; i < 16; i++)
- irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_SLAVE, 8-i);
+ irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_SLAVE, i - 8);
/* Last but not least, IOAPIC */
for (i = 0; i < 24; i++) {
if (i == 0)
irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_IOAPIC, 2);
- else
+ else if (i != 2)
irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_IOAPIC, i);
}
--
1.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] kvm tools: Use correct size for VESA memory bar
2011-08-11 9:04 [PATCH] kvm tools: Fix IRQ mapping Sasha Levin
@ 2011-08-11 9:04 ` Sasha Levin
2011-08-11 9:49 ` walimis
2011-08-11 9:17 ` [PATCH] kvm tools: Fix IRQ mapping Pekka Enberg
1 sibling, 1 reply; 7+ messages in thread
From: Sasha Levin @ 2011-08-11 9:04 UTC (permalink / raw)
To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, Sasha Levin
This patch makes BAR 1 16k, instead of BAR0 - which is the PIO bar.
This fixes wrong output on lspci command and ioremap warnings during boot.
Reported-by: David Evensky <evensky@dancer.ca.sandia.gov>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
tools/kvm/hw/serial.c | 2 +-
tools/kvm/hw/vesa.c | 2 +-
tools/kvm/pci.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/kvm/hw/serial.c b/tools/kvm/hw/serial.c
index 1199264..0393d3d 100644
--- a/tools/kvm/hw/serial.c
+++ b/tools/kvm/hw/serial.c
@@ -213,7 +213,7 @@ static bool serial8250_out(struct ioport *ioport, struct kvm *kvm, u16 port, voi
case UART_TX: {
char *addr = data;
- if (!(dev->mcr & UART_MCR_LOOP))
+ if (!(dev->mcr & (UART_MCR_LOOP | UART_MCR_OUT2)))
term_putc(CONSOLE_8250, addr, size * count);
dev->iir = UART_IIR_NO_INT;
diff --git a/tools/kvm/hw/vesa.c b/tools/kvm/hw/vesa.c
index 2af08df..9caa6c4 100644
--- a/tools/kvm/hw/vesa.c
+++ b/tools/kvm/hw/vesa.c
@@ -39,6 +39,7 @@ static struct pci_device_header vesa_pci_device = {
.subsys_vendor_id = PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET,
.subsys_id = PCI_SUBSYSTEM_ID_VESA,
.bar[1] = VESA_MEM_ADDR | PCI_BASE_ADDRESS_SPACE_MEMORY,
+ .bar_size[1] = VESA_MEM_SIZE,
};
static struct framebuffer vesafb;
@@ -56,7 +57,6 @@ struct framebuffer *vesa__init(struct kvm *kvm)
vesa_pci_device.irq_line = line;
vesa_base_addr = ioport__register(IOPORT_EMPTY, &vesa_io_ops, IOPORT_SIZE, NULL);
vesa_pci_device.bar[0] = vesa_base_addr | PCI_BASE_ADDRESS_SPACE_IO;
- vesa_pci_device.bar_size[0] = VESA_MEM_SIZE;
pci__register(&vesa_pci_device, dev);
mem = mmap(NULL, VESA_MEM_SIZE, PROT_RW, MAP_ANON_NORESERVE, -1, 0);
diff --git a/tools/kvm/pci.c b/tools/kvm/pci.c
index fd19b73..0449aca 100644
--- a/tools/kvm/pci.c
+++ b/tools/kvm/pci.c
@@ -95,7 +95,7 @@ static bool pci_config_data_out(struct ioport *ioport, struct kvm *kvm, u16 port
offset = start + (pci_config_address.register_number << 2);
if (offset < sizeof(struct pci_device_header)) {
void *p = pci_devices[dev_num];
- u8 bar = offset - PCI_BAR_OFFSET(0);
+ u8 bar = offset - PCI_BAR_OFFSET(0) / (sizeof(u32));
u32 sz = PCI_IO_SIZE;
if (bar < 6 && pci_devices[dev_num]->bar_size[bar])
--
1.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] kvm tools: Fix IRQ mapping
2011-08-11 9:04 [PATCH] kvm tools: Fix IRQ mapping Sasha Levin
2011-08-11 9:04 ` [PATCH] kvm tools: Use correct size for VESA memory bar Sasha Levin
@ 2011-08-11 9:17 ` Pekka Enberg
2011-08-11 13:54 ` Asias He
1 sibling, 1 reply; 7+ messages in thread
From: Pekka Enberg @ 2011-08-11 9:17 UTC (permalink / raw)
To: Sasha Levin; +Cc: kvm, mingo, asias.hejun, gorcunov
On 8/11/11 12:04 PM, Sasha Levin wrote:
> This thread fixes two issues:
> - Slave IRQCHIP was mapped wrong, this caused all IRQs which belong
> to it to be ignored (breaking such things as the mouse).
> - Line 2 was being mapped, since it's the link between slave and master
> IRQCHIPs it shouldn't be.
>
> Signed-off-by: Sasha Levin<levinsasha928@gmail.com>
Asias, does this fix the VNC mouse problem for you?
> ---
> tools/kvm/irq.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tools/kvm/irq.c b/tools/kvm/irq.c
> index 85e2238..e35bf18 100644
> --- a/tools/kvm/irq.c
> +++ b/tools/kvm/irq.c
> @@ -147,17 +147,18 @@ void irq__init(struct kvm *kvm)
>
> /* Hook first 8 GSIs to master IRQCHIP */
> for (i = 0; i< 8; i++)
> - irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_MASTER, i);
> + if (i != 2)
> + irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_MASTER, i);
>
> /* Hook next 8 GSIs to slave IRQCHIP */
> for (i = 8; i< 16; i++)
> - irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_SLAVE, 8-i);
> + irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_SLAVE, i - 8);
>
> /* Last but not least, IOAPIC */
> for (i = 0; i< 24; i++) {
> if (i == 0)
> irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_IOAPIC, 2);
> - else
> + else if (i != 2)
> irq__add_routing(i, KVM_IRQ_ROUTING_IRQCHIP, IRQCHIP_IOAPIC, i);
> }
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] kvm tools: Use correct size for VESA memory bar
2011-08-11 9:04 ` [PATCH] kvm tools: Use correct size for VESA memory bar Sasha Levin
@ 2011-08-11 9:49 ` walimis
2011-08-11 11:55 ` Sasha Levin
0 siblings, 1 reply; 7+ messages in thread
From: walimis @ 2011-08-11 9:49 UTC (permalink / raw)
To: Sasha Levin; +Cc: penberg, kvm, mingo, asias.hejun, gorcunov
On Thu, Aug 11, 2011 at 12:04:08PM +0300, Sasha Levin wrote:
>This patch makes BAR 1 16k, instead of BAR0 - which is the PIO bar.
>
>This fixes wrong output on lspci command and ioremap warnings during boot.
>
>Reported-by: David Evensky <evensky@dancer.ca.sandia.gov>
>Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
>---
> tools/kvm/hw/serial.c | 2 +-
> tools/kvm/hw/vesa.c | 2 +-
> tools/kvm/pci.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/tools/kvm/hw/serial.c b/tools/kvm/hw/serial.c
>index 1199264..0393d3d 100644
>--- a/tools/kvm/hw/serial.c
>+++ b/tools/kvm/hw/serial.c
>@@ -213,7 +213,7 @@ static bool serial8250_out(struct ioport *ioport, struct kvm *kvm, u16 port, voi
> case UART_TX: {
> char *addr = data;
>
>- if (!(dev->mcr & UART_MCR_LOOP))
>+ if (!(dev->mcr & (UART_MCR_LOOP | UART_MCR_OUT2)))
I assume it was your mistake to include this part?
walimis
> term_putc(CONSOLE_8250, addr, size * count);
>
> dev->iir = UART_IIR_NO_INT;
>diff --git a/tools/kvm/hw/vesa.c b/tools/kvm/hw/vesa.c
>index 2af08df..9caa6c4 100644
>--- a/tools/kvm/hw/vesa.c
>+++ b/tools/kvm/hw/vesa.c
>@@ -39,6 +39,7 @@ static struct pci_device_header vesa_pci_device = {
> .subsys_vendor_id = PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET,
> .subsys_id = PCI_SUBSYSTEM_ID_VESA,
> .bar[1] = VESA_MEM_ADDR | PCI_BASE_ADDRESS_SPACE_MEMORY,
>+ .bar_size[1] = VESA_MEM_SIZE,
> };
>
> static struct framebuffer vesafb;
>@@ -56,7 +57,6 @@ struct framebuffer *vesa__init(struct kvm *kvm)
> vesa_pci_device.irq_line = line;
> vesa_base_addr = ioport__register(IOPORT_EMPTY, &vesa_io_ops, IOPORT_SIZE, NULL);
> vesa_pci_device.bar[0] = vesa_base_addr | PCI_BASE_ADDRESS_SPACE_IO;
>- vesa_pci_device.bar_size[0] = VESA_MEM_SIZE;
> pci__register(&vesa_pci_device, dev);
>
> mem = mmap(NULL, VESA_MEM_SIZE, PROT_RW, MAP_ANON_NORESERVE, -1, 0);
>diff --git a/tools/kvm/pci.c b/tools/kvm/pci.c
>index fd19b73..0449aca 100644
>--- a/tools/kvm/pci.c
>+++ b/tools/kvm/pci.c
>@@ -95,7 +95,7 @@ static bool pci_config_data_out(struct ioport *ioport, struct kvm *kvm, u16 port
> offset = start + (pci_config_address.register_number << 2);
> if (offset < sizeof(struct pci_device_header)) {
> void *p = pci_devices[dev_num];
>- u8 bar = offset - PCI_BAR_OFFSET(0);
>+ u8 bar = offset - PCI_BAR_OFFSET(0) / (sizeof(u32));
> u32 sz = PCI_IO_SIZE;
>
> if (bar < 6 && pci_devices[dev_num]->bar_size[bar])
>--
>1.7.6
>
>--
>To unsubscribe from this list: send the line "unsubscribe kvm" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] kvm tools: Use correct size for VESA memory bar
2011-08-11 9:49 ` walimis
@ 2011-08-11 11:55 ` Sasha Levin
0 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2011-08-11 11:55 UTC (permalink / raw)
To: walimis; +Cc: penberg, kvm, mingo, asias.hejun, gorcunov
On Thu, 2011-08-11 at 17:49 +0800, walimis wrote:
> On Thu, Aug 11, 2011 at 12:04:08PM +0300, Sasha Levin wrote:
> >This patch makes BAR 1 16k, instead of BAR0 - which is the PIO bar.
> >
> >This fixes wrong output on lspci command and ioremap warnings during boot.
> >
> >Reported-by: David Evensky <evensky@dancer.ca.sandia.gov>
> >Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> >---
> > tools/kvm/hw/serial.c | 2 +-
> > tools/kvm/hw/vesa.c | 2 +-
> > tools/kvm/pci.c | 2 +-
> > 3 files changed, 3 insertions(+), 3 deletions(-)
> >
> >diff --git a/tools/kvm/hw/serial.c b/tools/kvm/hw/serial.c
> >index 1199264..0393d3d 100644
> >--- a/tools/kvm/hw/serial.c
> >+++ b/tools/kvm/hw/serial.c
> >@@ -213,7 +213,7 @@ static bool serial8250_out(struct ioport *ioport, struct kvm *kvm, u16 port, voi
> > case UART_TX: {
> > char *addr = data;
> >
> >- if (!(dev->mcr & UART_MCR_LOOP))
> >+ if (!(dev->mcr & (UART_MCR_LOOP | UART_MCR_OUT2)))
> I assume it was your mistake to include this part?
>
> walimis
Heh... yes it was. Thanks :)
--
Sasha.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] kvm tools: Fix IRQ mapping
2011-08-11 13:54 ` Asias He
@ 2011-08-11 13:42 ` walimis
0 siblings, 0 replies; 7+ messages in thread
From: walimis @ 2011-08-11 13:42 UTC (permalink / raw)
To: Asias He; +Cc: Pekka Enberg, Sasha Levin, kvm, mingo, gorcunov
On Thu, Aug 11, 2011 at 09:54:26PM +0800, Asias He wrote:
>On 08/11/2011 05:17 PM, Pekka Enberg wrote:
>> On 8/11/11 12:04 PM, Sasha Levin wrote:
>>> This thread fixes two issues:
>>> - Slave IRQCHIP was mapped wrong, this caused all IRQs which belong
>>> to it to be ignored (breaking such things as the mouse).
>>> - Line 2 was being mapped, since it's the link between slave and master
>>> IRQCHIPs it shouldn't be.
>>>
>>> Signed-off-by: Sasha Levin<levinsasha928@gmail.com>
>>
>> Asias, does this fix the VNC mouse problem for you?
>
>Yup. But gpm still can not work, it complains can not open /dev/psaux.
Do you enable mouse/ps2 option in the kernel?
walimis
>
>
>--
>Best Regards,
>Asias He
>--
>To unsubscribe from this list: send the line "unsubscribe kvm" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] kvm tools: Fix IRQ mapping
2011-08-11 9:17 ` [PATCH] kvm tools: Fix IRQ mapping Pekka Enberg
@ 2011-08-11 13:54 ` Asias He
2011-08-11 13:42 ` walimis
0 siblings, 1 reply; 7+ messages in thread
From: Asias He @ 2011-08-11 13:54 UTC (permalink / raw)
To: Pekka Enberg; +Cc: Sasha Levin, kvm, mingo, gorcunov
On 08/11/2011 05:17 PM, Pekka Enberg wrote:
> On 8/11/11 12:04 PM, Sasha Levin wrote:
>> This thread fixes two issues:
>> - Slave IRQCHIP was mapped wrong, this caused all IRQs which belong
>> to it to be ignored (breaking such things as the mouse).
>> - Line 2 was being mapped, since it's the link between slave and master
>> IRQCHIPs it shouldn't be.
>>
>> Signed-off-by: Sasha Levin<levinsasha928@gmail.com>
>
> Asias, does this fix the VNC mouse problem for you?
Yup. But gpm still can not work, it complains can not open /dev/psaux.
--
Best Regards,
Asias He
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-08-11 13:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11 9:04 [PATCH] kvm tools: Fix IRQ mapping Sasha Levin
2011-08-11 9:04 ` [PATCH] kvm tools: Use correct size for VESA memory bar Sasha Levin
2011-08-11 9:49 ` walimis
2011-08-11 11:55 ` Sasha Levin
2011-08-11 9:17 ` [PATCH] kvm tools: Fix IRQ mapping Pekka Enberg
2011-08-11 13:54 ` Asias He
2011-08-11 13:42 ` walimis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox