qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/i386/kvm/ioapic: Replace magic '24' value by proper definition
@ 2024-02-09 19:01 Philippe Mathieu-Daudé
  2024-02-10  8:54 ` Michael Tokarev
  2024-02-14 12:40 ` Michael Tokarev
  0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-09 19:01 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Marcel Apfelbaum,
	Richard Henderson, Eduardo Habkost, Paolo Bonzini,
	Philippe Mathieu-Daudé

Replace '24' -> KVM_IOAPIC_NUM_PINS.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/i386/kvm/ioapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
index 409d0c8c76..b96fe84eed 100644
--- a/hw/i386/kvm/ioapic.c
+++ b/hw/i386/kvm/ioapic.c
@@ -35,7 +35,7 @@ void kvm_pc_setup_irq_routing(bool pci_enabled)
         kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8);
     }
     if (pci_enabled) {
-        for (i = 0; i < 24; ++i) {
+        for (i = 0; i < KVM_IOAPIC_NUM_PINS; ++i) {
             if (i == 0) {
                 kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2);
             } else if (i != 2) {
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/i386/kvm/ioapic: Replace magic '24' value by proper definition
  2024-02-09 19:01 [PATCH] hw/i386/kvm/ioapic: Replace magic '24' value by proper definition Philippe Mathieu-Daudé
@ 2024-02-10  8:54 ` Michael Tokarev
  2024-02-12  7:48   ` Philippe Mathieu-Daudé
  2024-02-14 12:40 ` Michael Tokarev
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Tokarev @ 2024-02-10  8:54 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Marcel Apfelbaum,
	Richard Henderson, Eduardo Habkost, Paolo Bonzini

09.02.2024 22:01, Philippe Mathieu-Daudé:
> Replace '24' -> KVM_IOAPIC_NUM_PINS.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/i386/kvm/ioapic.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
> index 409d0c8c76..b96fe84eed 100644
> --- a/hw/i386/kvm/ioapic.c
> +++ b/hw/i386/kvm/ioapic.c
> @@ -35,7 +35,7 @@ void kvm_pc_setup_irq_routing(bool pci_enabled)
>           kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8);
>       }
>       if (pci_enabled) {
> -        for (i = 0; i < 24; ++i) {
> +        for (i = 0; i < KVM_IOAPIC_NUM_PINS; ++i) {
>               if (i == 0) {
>                   kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2);
>               } else if (i != 2) {

There seems to be some confusion here about
KVM_IOAPIC_NUM_PINS vs IOAPIC_NUM_PINS (and
vs ICH9_LPC_IOAPIC_NUM_PINS).

FWIW.

/mjt


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/i386/kvm/ioapic: Replace magic '24' value by proper definition
  2024-02-10  8:54 ` Michael Tokarev
@ 2024-02-12  7:48   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-12  7:48 UTC (permalink / raw)
  To: Michael Tokarev, qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Marcel Apfelbaum,
	Richard Henderson, Eduardo Habkost, Paolo Bonzini,
	Bernhard Beschow

On 10/2/24 09:54, Michael Tokarev wrote:
> 09.02.2024 22:01, Philippe Mathieu-Daudé:
>> Replace '24' -> KVM_IOAPIC_NUM_PINS.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   hw/i386/kvm/ioapic.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
>> index 409d0c8c76..b96fe84eed 100644
>> --- a/hw/i386/kvm/ioapic.c
>> +++ b/hw/i386/kvm/ioapic.c
>> @@ -35,7 +35,7 @@ void kvm_pc_setup_irq_routing(bool pci_enabled)
>>           kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8);
>>       }
>>       if (pci_enabled) {
>> -        for (i = 0; i < 24; ++i) {
>> +        for (i = 0; i < KVM_IOAPIC_NUM_PINS; ++i) {
>>               if (i == 0) {
>>                   kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2);
>>               } else if (i != 2) {
> 
> There seems to be some confusion here about
> KVM_IOAPIC_NUM_PINS vs IOAPIC_NUM_PINS (and
> vs ICH9_LPC_IOAPIC_NUM_PINS).

Well this is what I'm trying to clear, isn't it?

KVM irqchip has a hard limit. ICH9_LPC_IOAPIC_NUM_PINS is
specified in the ICH9 datasheet. It is unclear to me what
IOAPIC_NUM_PINS represents, I suppose it emerged from the
evolution of the Frankenstein PC machine to Q35.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/i386/kvm/ioapic: Replace magic '24' value by proper definition
  2024-02-09 19:01 [PATCH] hw/i386/kvm/ioapic: Replace magic '24' value by proper definition Philippe Mathieu-Daudé
  2024-02-10  8:54 ` Michael Tokarev
@ 2024-02-14 12:40 ` Michael Tokarev
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Tokarev @ 2024-02-14 12:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Marcel Apfelbaum,
	Richard Henderson, Eduardo Habkost, Paolo Bonzini

09.02.2024 22:01, Philippe Mathieu-Daudé:
> Replace '24' -> KVM_IOAPIC_NUM_PINS.

Picked up for trivial-patches. Not exactly a trivial thing but heck :)

Thanks,

/mjt

> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/i386/kvm/ioapic.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
> index 409d0c8c76..b96fe84eed 100644
> --- a/hw/i386/kvm/ioapic.c
> +++ b/hw/i386/kvm/ioapic.c
> @@ -35,7 +35,7 @@ void kvm_pc_setup_irq_routing(bool pci_enabled)
>           kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8);
>       }
>       if (pci_enabled) {
> -        for (i = 0; i < 24; ++i) {
> +        for (i = 0; i < KVM_IOAPIC_NUM_PINS; ++i) {
>               if (i == 0) {
>                   kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2);
>               } else if (i != 2) {



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-14 12:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-09 19:01 [PATCH] hw/i386/kvm/ioapic: Replace magic '24' value by proper definition Philippe Mathieu-Daudé
2024-02-10  8:54 ` Michael Tokarev
2024-02-12  7:48   ` Philippe Mathieu-Daudé
2024-02-14 12:40 ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).