[PATCH 1/2] hw/intc/arm_gicv3_its_common: Increase DeviceID to 32 bits

Nabih Estefan posted 2 patches 9 months, 1 week ago
Maintainers: Peter Maydell <peter.maydell@linaro.org>
[PATCH 1/2] hw/intc/arm_gicv3_its_common: Increase DeviceID to 32 bits
Posted by Nabih Estefan 9 months, 1 week ago
From: Roque Arcudia Hernandez <roqueh@google.com>

According to the “GICv3 and GICv4 Software Overview” the DeviceID is
IMPLEMENTATION DEFINED. This patch increases the DeviceID in send_msi virtual
function to 32 bits to allow the possibility of a redefinition of it with a
bigger DeviceID.

Signed-off-by: Roque Arcudia Hernandez <roqueh@google.com>
Signed-off-by: Nabih Estefan <nabihestefan@google.com>
---
 hw/intc/arm_gicv3_its_kvm.c            | 2 +-
 include/hw/intc/arm_gicv3_its_common.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c
index 3befc960db..4eaf1cfcad 100644
--- a/hw/intc/arm_gicv3_its_kvm.c
+++ b/hw/intc/arm_gicv3_its_kvm.c
@@ -42,7 +42,7 @@ struct KVMARMITSClass {
 };
 
 
-static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t devid)
+static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint32_t devid)
 {
     struct kvm_msi msi;
 
diff --git a/include/hw/intc/arm_gicv3_its_common.h b/include/hw/intc/arm_gicv3_its_common.h
index 7dc712b38d..e072c36cca 100644
--- a/include/hw/intc/arm_gicv3_its_common.h
+++ b/include/hw/intc/arm_gicv3_its_common.h
@@ -117,7 +117,7 @@ struct GICv3ITSCommonClass {
     SysBusDeviceClass parent_class;
     /*< public >*/
 
-    int (*send_msi)(GICv3ITSState *s, uint32_t data, uint16_t devid);
+    int (*send_msi)(GICv3ITSState *s, uint32_t data, uint32_t devid);
     void (*pre_save)(GICv3ITSState *s);
     void (*post_load)(GICv3ITSState *s);
 };
-- 
2.44.0.rc0.258.g7320e95886-goog
Re: [PATCH 1/2] hw/intc/arm_gicv3_its_common: Increase DeviceID to 32 bits
Posted by Peter Maydell 9 months ago
On Wed, 21 Feb 2024 at 17:33, Nabih Estefan <nabihestefan@google.com> wrote:
>
> From: Roque Arcudia Hernandez <roqueh@google.com>
>
> According to the “GICv3 and GICv4 Software Overview” the DeviceID is
> IMPLEMENTATION DEFINED. This patch increases the DeviceID in send_msi virtual
> function to 32 bits to allow the possibility of a redefinition of it with a
> bigger DeviceID.

It's IMPLEMENTATION DEFINED, and our implementation defines it
to be 16 bits (see the ITS_DEVBITS #define). So uint16_t is fine.

Again, this change is missing any context that would motivate it,
and needs to be upstreamed along with whatever the actual code
is that needs it, not as a single thing on its own.

thanks
-- PMM