Skip to contentSkip to conversation

hw/arm/sbsa-ref : small fixes to smmuv3 initialisation

PATCH Applied Graeme Gregory 3 participants 9 messages Oct 7, 2020 – Oct 8, 2020

lore
Share & tools
lore
#0 lore raw

v2 cover hw/arm/sbsa-ref : small fixes to smmuv3 initialisation

Fix two issues with the smmuv3 initialisation, first where a previous patch had transposed an i to a 1. The second an assumption that the IRQs allocated were meant to be unique and not 0 based.

v1->v2
- split into two patches
- previously sent as v1 post split by accident, resending for clarity
- added Reviewed-by

Graeme Gregory (2):
hw/arm/sbsa-ref : Fix SMMUv3 Initialisation
hw/arm/sbsa-ref : allocate IRQs for SMMUv3

 hw/arm/sbsa-ref.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
2.25.1

#1 lore raw

PATCH v2 1/2 hw/arm/sbsa-ref : Fix SMMUv3 Initialisation

SMMUv3 has an error in a previous patch where an i was transposed to a 1 meaning interrupts would not have been correctly assigned to the SMMUv3 instance.

Fixes 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state")
---
 hw/arm/sbsa-ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/sbsa-ref.c +1 -1
index 9c3a893bed..65e64883b5 100644
@@ -525,7 +525,7 @@ static void create_smmu(const SBSAMachineState *sms, PCIBus *bus)
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
     for (i = 0; i < NUM_SMMU_IRQS; i++) {
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i,
-                           qdev_get_gpio_in(sms->gic, irq + 1));
+                           qdev_get_gpio_in(sms->gic, irq + i));
     }
 }
 
Signature · 1 line
2.25.1
Reviewed-by Reviewed-by Eric Auger on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] hw/arm/sbsa-ref : Fix SMMUv3 Initialisation

Quoted 6 lines · Graeme Gregory

SMMUv3 has an error in a previous patch where an i was transposed to a 1 meaning interrupts would not have been correctly assigned to the SMMUv3 instance.

Fixes 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state")

Again, this fix is already in Peter's queue:
https://www.mail-archive.com/[email protected]/msg732819.html

But if you repost, please collect the reviewer tags, so we don't have to review it again. This one has:

Thanks,

Phil.

Quoted 18 lines
---
 hw/arm/sbsa-ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/sbsa-ref.c +1 -1
index 9c3a893bed..65e64883b5 100644
@@ -525,7 +525,7 @@ static void create_smmu(const SBSAMachineState *sms, PCIBus *bus)
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
     for (i = 0; i < NUM_SMMU_IRQS; i++) {
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i,
-                           qdev_get_gpio_in(sms->gic, irq + 1));
+                           qdev_get_gpio_in(sms->gic, irq + i));
     }
 }
 
#3 lore raw

Re: [PATCH v2 1/2] hw/arm/sbsa-ref : Fix SMMUv3 Initialisation

Quoted 8 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Graeme Gregory

SMMUv3 has an error in a previous patch where an i was transposed to a 1 meaning interrupts would not have been correctly assigned to the SMMUv3 instance.

Fixes 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state")
Quoted 8 lines

Again, this fix is already in Peter's queue:
https://www.mail-archive.com/[email protected]/msg732819.html

But if you repost, please collect the reviewer tags, so we don't have to review it again. This one has:

Ah I thought splitting the patch invalidated Eric's reviewed by?

This is a different fix to the one you are referring to, previous one was in PCIe.

Apologies if I have missed an email from you but I have not received a Reviewed by from you for the SMMUv3 IRQ fix.

Thanks

Graeme

Quoted 22 lines

Thanks,

Phil.

Quoted 18 lines
---
 hw/arm/sbsa-ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/sbsa-ref.c +1 -1
index 9c3a893bed..65e64883b5 100644
@@ -525,7 +525,7 @@ static void create_smmu(const SBSAMachineState *sms, PCIBus *bus)
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
     for (i = 0; i < NUM_SMMU_IRQS; i++) {
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i,
-                           qdev_get_gpio_in(sms->gic, irq + 1));
+                           qdev_get_gpio_in(sms->gic, irq + i));
     }
 }
 
#4 lore raw

Re: [PATCH v2 1/2] hw/arm/sbsa-ref : Fix SMMUv3 Initialisation

Quoted 18 lines · Graeme Gregory
Quoted 8 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Graeme Gregory

SMMUv3 has an error in a previous patch where an i was transposed to a 1 meaning interrupts would not have been correctly assigned to the SMMUv3 instance.

Fixes 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state")
Quoted 8 lines

Again, this fix is already in Peter's queue:
https://www.mail-archive.com/[email protected]/msg732819.html

But if you repost, please collect the reviewer tags, so we don't have to review it again. This one has:

Quoted 7 lines

Ah I thought splitting the patch invalidated Eric's reviewed by?

This is a different fix to the one you are referring to, previous one was in PCIe.

Apologies if I have missed an email from you but I have not received a Reviewed by from you for the SMMUv3 IRQ fix.

Oops sorry my bad, I thought this was a repost of the PCIe fix.

So:

Looking at 48ba18e6d3f3 I messed create_smmu() and create_pcie() but you now fixed both cases.

And you are right, this patch isn't reviewed by Eric.

Quoted 28 lines

Thanks

Graeme

Quoted 22 lines

Thanks,

Phil.

Quoted 18 lines
---
 hw/arm/sbsa-ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/sbsa-ref.c +1 -1
index 9c3a893bed..65e64883b5 100644
@@ -525,7 +525,7 @@ static void create_smmu(const SBSAMachineState *sms, PCIBus *bus)
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
     for (i = 0; i < NUM_SMMU_IRQS; i++) {
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i,
-                           qdev_get_gpio_in(sms->gic, irq + 1));
+                           qdev_get_gpio_in(sms->gic, irq + i));
     }
 }
 
#5 lore raw

Re: [PATCH v2 1/2] hw/arm/sbsa-ref : Fix SMMUv3 Initialisation

Quoted 29 lines · Philippe Mathieu-Daudé
Quoted 18 lines · Graeme Gregory
Quoted 8 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Graeme Gregory

SMMUv3 has an error in a previous patch where an i was transposed to a 1 meaning interrupts would not have been correctly assigned to the SMMUv3 instance.

Fixes 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state")
Quoted 8 lines

Again, this fix is already in Peter's queue:
https://www.mail-archive.com/[email protected]/msg732819.html

But if you repost, please collect the reviewer tags, so we don't have to review it again. This one has:

Quoted 7 lines

Ah I thought splitting the patch invalidated Eric's reviewed by?

This is a different fix to the one you are referring to, previous one was in PCIe.

Apologies if I have missed an email from you but I have not received a Reviewed by from you for the SMMUv3 IRQ fix.

Oops sorry my bad, I thought this was a repost of the PCIe fix.

Quoted 8 lines

So:

Looking at 48ba18e6d3f3 I messed create_smmu() and create_pcie() but you now fixed both cases.

And you are right, this patch isn't reviewed by Eric.

Thanks, they are confusingly similar patches.

Graeme

Quoted 28 lines
Quoted 28 lines

Thanks

Graeme

Quoted 22 lines

Thanks,

Phil.

Quoted 18 lines
---
 hw/arm/sbsa-ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/sbsa-ref.c +1 -1
index 9c3a893bed..65e64883b5 100644
@@ -525,7 +525,7 @@ static void create_smmu(const SBSAMachineState *sms, PCIBus *bus)
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
     for (i = 0; i < NUM_SMMU_IRQS; i++) {
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i,
-                           qdev_get_gpio_in(sms->gic, irq + 1));
+                           qdev_get_gpio_in(sms->gic, irq + i));
     }
 }
 
#6 lore raw

PATCH v2 2/2 hw/arm/sbsa-ref : allocate IRQs for SMMUv3

In reply to Graeme Gregory

Original commit did not allocate IRQs for the SMMUv3 in the irqmap effectively using irq 0->3 (shared with other devices). Assuming original intent was to allocate unique IRQs then add an allocation to the irqmap.

Fixes e9fdf453240 ("hw/arm: Add arm SBSA reference machine, devices part")
---
 hw/arm/sbsa-ref.c | 1 +
 1 file changed, 1 insertion(+)
hw/arm/sbsa-ref.c +1 -0
index 65e64883b5..01863510d0 100644
@@ -133,6 +133,7 @@ static const int sbsa_ref_irqmap[] = {
     [SBSA_SECURE_UART_MM] = 9,
     [SBSA_AHCI] = 10,
     [SBSA_EHCI] = 11,
+    [SBSA_SMMU] = 12, /* ... to 15 */
 };
 
 static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)
Signature · 1 line
2.25.1
Reviewed-by Eric Auger on v2 2/2
#7 lore raw

Re: [PATCH v2 2/2] hw/arm/sbsa-ref : allocate IRQs for SMMUv3

Quoted 7 lines · Graeme Gregory

Original commit did not allocate IRQs for the SMMUv3 in the irqmap effectively using irq 0->3 (shared with other devices). Assuming original intent was to allocate unique IRQs then add an allocation to the irqmap.

Fixes e9fdf453240 ("hw/arm: Add arm SBSA reference machine, devices part")

Previous version also has:

Quoted 18 lines
---
 hw/arm/sbsa-ref.c | 1 +
 1 file changed, 1 insertion(+)
hw/arm/sbsa-ref.c +1 -0
index 65e64883b5..01863510d0 100644
@@ -133,6 +133,7 @@ static const int sbsa_ref_irqmap[] = {
     [SBSA_SECURE_UART_MM] = 9,
     [SBSA_AHCI] = 10,
     [SBSA_EHCI] = 11,
+    [SBSA_SMMU] = 12, /* ... to 15 */
 };
 
 static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)
#8 lore raw
In reply to Graeme Gregory
Quoted 10 lines · Graeme Gregory

Fix two issues with the smmuv3 initialisation, first where a previous patch had transposed an i to a 1. The second an assumption that the IRQs allocated were meant to be unique and not 0 based.

v1->v2
- split into two patches
- previously sent as v1 post split by accident, resending for clarity
- added Reviewed-by

Quoted 6 lines

Graeme Gregory (2):
hw/arm/sbsa-ref : Fix SMMUv3 Initialisation
hw/arm/sbsa-ref : allocate IRQs for SMMUv3

 hw/arm/sbsa-ref.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to target-arm.next, thanks.

-- PMM