arm gicv3: minor bug fixes, ITS trace events
cover arm gicv3: minor bug fixes, ITS trace events
This series fixes a handful of small things I ran into while I've been working on adding GICv4 support:
* it adds trace events to the ITS for all the commands and in-guest-memory table acceses
* it fixes a couple of text errors in some log/trace strings
* an actual bugfix: it specifies .valid and .impl for the TCG GIC MemoryRegionOps so that we actually use the code we have for reading/writing 8-byte registers rather than letting the memory system split them into two 4-byte accesses (which is mostly unnoticeable to the guest)
thanks
-- PMM
Peter Maydell (5):
hw/intc/arm_gicv3_its: Add trace events for commands hw/intc/arm_gicv3_its: Add trace events for table reads and writes hw/intc/arm_gicv3: Specify valid and impl in MemoryRegionOps hw/intc/arm_gicv3: Fix missing spaces in error log messages hw/intc/arm_gicv3_cpuif: Fix register names in ICV_HPPIR read trace
event
hw/intc/arm_gicv3.c | 8 +++++ hw/intc/arm_gicv3_cpuif.c | 3 +- hw/intc/arm_gicv3_dist.c | 4 +-- hw/intc/arm_gicv3_its.c | 69 +++++++++++++++++++++++++++++++++------ hw/intc/trace-events | 21 ++++++++++++ 5 files changed, 92 insertions(+), 13 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/5 hw/intc/arm_gicv3_its: Add trace events for commands
When debugging code that's using the ITS, it's helpful to see tracing of the ITS commands that the guest executes. Add suitable trace events.
--- hw/intc/arm_gicv3_its.c | 28 ++++++++++++++++++++++++++-- hw/intc/trace-events | 12 ++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-)
hw/intc/arm_gicv3_its.c +26 -2
@@ -366,6 +366,19 @@ static ItsCmdResult process_its_cmd(GICv3ITSState *s, const uint64_t *cmdpkt, devid = (cmdpkt[0 ] &DEVID_MASK ) >>DEVID_SHIFT ; eventid = cmdpkt[1 ] &EVENTID_MASK ; +switch (cmd) { +case INTERRUPT : +trace_gicv3_its_cmd_int (devid, eventid); +break ; +case CLEAR : +trace_gicv3_its_cmd_clear (devid, eventid); +break ; +case DISCARD : +trace_gicv3_its_cmd_discard (devid, eventid); +break ; +default : +g_assert_not_reached (); + }return do_process_its_cmd (s, devid, eventid, cmd); }
@@ -382,15 +395,16 @@ static ItsCmdResult process_mapti(GICv3ITSState *s, const uint64_t *cmdpkt, devid = (cmdpkt[0 ] &DEVID_MASK ) >>DEVID_SHIFT ; eventid = cmdpkt[1 ] &EVENTID_MASK ; + icid = cmdpkt[2 ] &ICID_MASK ;if (ignore_pInt) { pIntid = eventid; +trace_gicv3_its_cmd_mapi (devid, eventid, icid); }else { pIntid = (cmdpkt[1 ] & pINTID_MASK) >> pINTID_SHIFT; +trace_gicv3_its_cmd_mapti (devid, eventid, icid, pIntid); } - icid = cmdpkt[2 ] &ICID_MASK ; -if (devid >= s->dt.num_entries) { qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid command attributes: devid %d>=%d",
@@ -484,6 +498,7 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, const uint64_t *cmdpkt) }else { cte.rdbase =0 ; } +trace_gicv3_its_cmd_mapc (icid, cte.rdbase, cte.valid);if (icid >= s->ct.num_entries) {qemu_log_mask (LOG_GUEST_ERROR ,"ITS MAPC: invalid ICID 0x%d" , icid);
@@ -539,6 +554,8 @@ static ItsCmdResult process_mapd(GICv3ITSState *s, const uint64_t *cmdpkt) dte.ittaddr = (cmdpkt[2 ] &ITTADDR_MASK ) >>ITTADDR_SHIFT ; dte.valid = cmdpkt[2 ] &CMD_FIELD_VALID_MASK ; +trace_gicv3_its_cmd_mapd (devid, dte.size, dte.ittaddr, dte.valid); +if (devid >= s->dt.num_entries) { qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPD: invalid device ID field 0x%x >= 0x%x\n",
@@ -562,6 +579,8 @@ static ItsCmdResult process_movall(GICv3ITSState *s, const uint64_t *cmdpkt) rd1 =FIELD_EX64 (cmdpkt[2 ],MOVALL_2 ,RDBASE1 ); rd2 =FIELD_EX64 (cmdpkt[3 ],MOVALL_3 ,RDBASE2 ); +trace_gicv3_its_cmd_movall (rd1, rd2); +if (rd1 >= s->gicv3->num_cpu) {qemu_log_mask (LOG_GUEST_ERROR , "%s: RDBASE1 %" PRId64
@@ -601,6 +620,8 @@ static ItsCmdResult process_movi(GICv3ITSState *s, const uint64_t *cmdpkt) eventid =FIELD_EX64 (cmdpkt[1 ],MOVI_1 ,EVENTID ); new_icid =FIELD_EX64 (cmdpkt[2 ],MOVI_2 ,ICID ); +trace_gicv3_its_cmd_movi (devid, eventid, new_icid); +if (devid >= s->dt.num_entries) { qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid command attributes: devid %d>=%d",
@@ -779,6 +800,7 @@ static void process_cmdq(GICv3ITSState *s)* is already consistent by the time SYNC command is executed. * Hence no further processing is required for SYNC command. */ +trace_gicv3_its_cmd_sync ();break ;case GITS_CMD_MAPD : result =process_mapd (s, cmdpkt);
@@ -803,6 +825,7 @@ static void process_cmdq(GICv3ITSState *s)* need to trigger lpi priority re-calculation to be in * sync with LPI config table or pending table changes. */ +trace_gicv3_its_cmd_inv ();for (i =0 ; i < s->gicv3->num_cpu; i++) {gicv3_redist_update_lpi (&s->gicv3->cpu[i]); }
@@ -814,6 +837,7 @@ static void process_cmdq(GICv3ITSState *s) result =process_movall (s, cmdpkt);break ;default : +trace_gicv3_its_cmd_unknown (cmd);break ; }if (result ==CMD_CONTINUE ) {
hw/intc/trace-events +12 -0
@@ -176,6 +176,18 @@ gicv3_its_write(uint64_t offset, uint64_t data, unsigned size) "GICv3 ITS write: gicv3_its_badwrite(uint64_t offset, uint64_t data, unsigned size) "GICv3 ITS write: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u: error" gicv3_its_translation_write(uint64_t offset, uint64_t data, unsigned size, uint32_t requester_id) "GICv3 ITS TRANSLATER write: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u requester_id 0x%x" gicv3_its_process_command(uint32_t rd_offset, uint8_t cmd) "GICv3 ITS: processing command at offset 0x%x: 0x%x" +gicv3_its_cmd_int(uint32_t devid, uint32_t eventid) "GICv3 ITS: command INT DeviceID 0x%x EventID 0x%x" +gicv3_its_cmd_clear(uint32_t devid, uint32_t eventid) "GICv3 ITS: command CLEAR DeviceID 0x%x EventID 0x%x" +gicv3_its_cmd_discard(uint32_t devid, uint32_t eventid) "GICv3 ITS: command DISCARD DeviceID 0x%x EventID 0x%x" +gicv3_its_cmd_sync(void) "GICv3 ITS: command SYNC" +gicv3_its_cmd_mapd(uint32_t devid, uint32_t size, uint64_t ittaddr, int valid) "GICv3 ITS: command MAPD DeviceID 0x%x Size 0x%x ITT_addr 0x%" PRIx64 " V %d" +gicv3_its_cmd_mapc(uint32_t icid, uint64_t rdbase, int valid) "GICv3 ITS: command MAPC ICID 0x%x RDbase 0x%" PRIx64 " V %d" +gicv3_its_cmd_mapi(uint32_t devid, uint32_t eventid, uint32_t icid) "GICv3 ITS: command MAPI DeviceID 0x%x EventID 0x%x ICID 0x%x" +gicv3_its_cmd_mapti(uint32_t devid, uint32_t eventid, uint32_t icid, uint32_t intid) "GICv3 ITS: command MAPTI DeviceID 0x%x EventID 0x%x ICID 0x%x pINTID 0x%x" +gicv3_its_cmd_inv(void) "GICv3 ITS: command INV or INVALL" +gicv3_its_cmd_movall(uint64_t rd1, uint64_t rd2) "GICv3 ITS: command MOVALL RDbase1 0x%" PRIx64 " RDbase2 0x%" PRIx64 +gicv3_its_cmd_movi(uint32_t devid, uint32_t eventid, uint32_t icid) "GICv3 ITS: command MOVI DeviceID 0x%x EventID 0x%x ICID 0x%x" +gicv3_its_cmd_unknown(unsigned cmd) "GICv3 ITS: unknown command 0x%x" # armv7m_nvic.c nvic_recompute_state(int vectpending, int vectpending_prio, int exception_prio) "NVIC state recomputed: vectpending %d vectpending_prio %d exception_prio %d"
Signature · 1 line
2.25.1
Re: [PATCH 1/5] hw/intc/arm_gicv3_its: Add trace events for commands
Quoted 9 lines · Peter Maydell
When debugging code that's using the ITS, it's helpful to see tracing of the ITS commands that the guest executes. Add suitable trace events.
Signed-off-by Peter Maydell<[email protected]>--- hw/intc/arm_gicv3_its.c | 28 ++++++++++++++++++++++++++-- hw/intc/trace-events | 12 ++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-)
r~
PATCH 2/5 hw/intc/arm_gicv3_its: Add trace events for table reads and writes
In reply to Peter MaydellFor debugging guest use of the ITS, it can be helpful to trace when the ITS reads and writes the in-memory tables.
--- hw/intc/arm_gicv3_its.c | 37 +++++++++++++++++++++++++++++++------ hw/intc/trace-events | 9 +++++++++ 2 files changed, 40 insertions(+), 6 deletions(-)
hw/intc/arm_gicv3_its.c +31 -6
@@ -161,16 +161,22 @@ static MemTxResult get_cte(GICv3ITSState *s, uint16_t icid, CTEntry *cte)if (entry_addr ==-1 ) {/* No L2 table entry, i.e. no valid CTE, or a memory error */ cte->valid = false; -return res; + goto out; } cteval =address_space_ldq_le (as, entry_addr,MEMTXATTRS_UNSPECIFIED , &res);if (res !=MEMTX_OK ) { -return res; + goto out; } cte->valid =FIELD_EX64 (cteval,CTE ,VALID ); cte->rdbase =FIELD_EX64 (cteval,CTE ,RDBASE ); -return MEMTX_OK ; +out: +if (res !=MEMTX_OK ) { +trace_gicv3_its_cte_read_fault (icid); + }else { +trace_gicv3_its_cte_read (icid, cte->valid, cte->rdbase); + } +return res; }/*
@@ -187,6 +193,10 @@ static bool update_ite(GICv3ITSState *s, uint32_t eventid, const DTEntry *dte,uint64_t itel =0 ;uint32_t iteh =0 ; +trace_gicv3_its_ite_write (dte->ittaddr, eventid, ite->valid, + ite->inttype, ite->intid, ite->icid, + ite->vpeid, ite->doorbell); +if (ite->valid) { itel =FIELD_DP64 (itel,ITE_L ,VALID ,1 ); itel =FIELD_DP64 (itel,ITE_L ,INTTYPE , ite->inttype);
@@ -221,11 +231,13 @@ static MemTxResult get_ite(GICv3ITSState *s, uint32_t eventid, itel =address_space_ldq_le (as, iteaddr,MEMTXATTRS_UNSPECIFIED , &res);if (res !=MEMTX_OK ) { +trace_gicv3_its_ite_read_fault (dte->ittaddr, eventid);return res; } iteh =address_space_ldl_le (as, iteaddr +8 ,MEMTXATTRS_UNSPECIFIED , &res);if (res !=MEMTX_OK ) { +trace_gicv3_its_ite_read_fault (dte->ittaddr, eventid);return res; }
@@ -235,6 +247,9 @@ static MemTxResult get_ite(GICv3ITSState *s, uint32_t eventid, ite->icid =FIELD_EX64 (itel,ITE_L ,ICID ); ite->vpeid =FIELD_EX64 (itel,ITE_L ,VPEID ); ite->doorbell =FIELD_EX64 (iteh,ITE_H ,DOORBELL ); +trace_gicv3_its_ite_read (dte->ittaddr, eventid, ite->valid, + ite->inttype, ite->intid, ite->icid, + ite->vpeid, ite->doorbell);return MEMTX_OK ; }
@@ -254,17 +269,23 @@ static MemTxResult get_dte(GICv3ITSState *s, uint32_t devid, DTEntry *dte)if (entry_addr ==-1 ) {/* No L2 table entry, i.e. no valid DTE, or a memory error */ dte->valid = false; -return res; + goto out; } dteval =address_space_ldq_le (as, entry_addr,MEMTXATTRS_UNSPECIFIED , &res);if (res !=MEMTX_OK ) { -return res; + goto out; } dte->valid =FIELD_EX64 (dteval,DTE ,VALID ); dte->size =FIELD_EX64 (dteval,DTE ,SIZE );/* DTE word field stores bits [51:8] of the ITT address */ dte->ittaddr =FIELD_EX64 (dteval,DTE ,ITTADDR ) <<ITTADDR_SHIFT ; -return MEMTX_OK ; +out: +if (res !=MEMTX_OK ) { +trace_gicv3_its_dte_read_fault (devid); + }else { +trace_gicv3_its_dte_read (devid, dte->valid, dte->size, dte->ittaddr); + } +return res; }/*
@@ -465,6 +486,8 @@ static bool update_cte(GICv3ITSState *s, uint16_t icid, const CTEntry *cte)uint64_t cteval =0 ;MemTxResult res =MEMTX_OK ; +trace_gicv3_its_cte_write (icid, cte->valid, cte->rdbase); +if (cte->valid) {/* add mapping entry to collection table */ cteval =FIELD_DP64 (cteval,CTE ,VALID ,1 );
@@ -524,6 +547,8 @@ static bool update_dte(GICv3ITSState *s, uint32_t devid, const DTEntry *dte)uint64_t dteval =0 ;MemTxResult res =MEMTX_OK ; +trace_gicv3_its_dte_write (devid, dte->valid, dte->size, dte->ittaddr); +if (dte->valid) {/* add mapping entry to device table */ dteval =FIELD_DP64 (dteval,DTE ,VALID ,1 );
hw/intc/trace-events +9 -0
@@ -188,6 +188,15 @@ gicv3_its_cmd_inv(void) "GICv3 ITS: command INV or INVALL" gicv3_its_cmd_movall(uint64_t rd1, uint64_t rd2) "GICv3 ITS: command MOVALL RDbase1 0x%" PRIx64 " RDbase2 0x%" PRIx64 gicv3_its_cmd_movi(uint32_t devid, uint32_t eventid, uint32_t icid) "GICv3 ITS: command MOVI DeviceID 0x%x EventID 0x%x ICID 0x%x" gicv3_its_cmd_unknown(unsigned cmd) "GICv3 ITS: unknown command 0x%x" +gicv3_its_cte_read(uint32_t icid, int valid, uint32_t rdbase) "GICv3 ITS: Collection Table read for ICID 0x%x: valid %d RDBase 0x%x" +gicv3_its_cte_write(uint32_t icid, int valid, uint32_t rdbase) "GICv3 ITS: Collection Table write for ICID 0x%x: valid %d RDBase 0x%x" +gicv3_its_cte_read_fault(uint32_t icid) "GICv3 ITS: Collection Table read for ICID 0x%x: faulted" +gicv3_its_ite_read(uint64_t ittaddr, uint32_t eventid, int valid, int inttype, uint32_t intid, uint32_t icid, uint32_t vpeid, uint32_t doorbell) "GICv3 ITS: Interrupt Table read for ITTaddr 0x%" PRIx64 " EventID 0x%x: valid %d inttype %d intid 0x%x ICID 0x%x vPEID 0x%x doorbell 0x%x" +gicv3_its_ite_read_fault(uint64_t ittaddr, uint32_t eventid) "GICv3 ITS: Interrupt Table read for ITTaddr 0x%" PRIx64 " EventID 0x%x: faulted" +gicv3_its_ite_write(uint64_t ittaddr, uint32_t eventid, int valid, int inttype, uint32_t intid, uint32_t icid, uint32_t vpeid, uint32_t doorbell) "GICv3 ITS: Interrupt Table write for ITTaddr 0x%" PRIx64 " EventID 0x%x: valid %d inttype %d intid 0x%x ICID 0x%x vPEID 0x%x doorbell 0x%x" +gicv3_its_dte_read(uint32_t devid, int valid, uint32_t size, uint64_t ittaddr) "GICv3 ITS: Device Table read for DeviceID 0x%x: valid %d size 0x%x ITTaddr 0x%" PRIx64 +gicv3_its_dte_write(uint32_t devid, int valid, uint32_t size, uint64_t ittaddr) "GICv3 ITS: Device Table write for DeviceID 0x%x: valid %d size 0x%x ITTaddr 0x%" PRIx64 +gicv3_its_dte_read_fault(uint32_t devid) "GICv3 ITS: Device Table read for DeviceID 0x%x: faulted" # armv7m_nvic.c nvic_recompute_state(int vectpending, int vectpending_prio, int exception_prio) "NVIC state recomputed: vectpending %d vectpending_prio %d exception_prio %d"
Signature · 1 line
2.25.1
Re: [PATCH 2/5] hw/intc/arm_gicv3_its: Add trace events for table reads and writes
Quoted 8 lines · Peter Maydell
For debugging guest use of the ITS, it can be helpful to trace when the ITS reads and writes the in-memory tables.
Signed-off-by Peter Maydell<[email protected]>--- hw/intc/arm_gicv3_its.c | 37 +++++++++++++++++++++++++++++++------ hw/intc/trace-events | 9 +++++++++ 2 files changed, 40 insertions(+), 6 deletions(-)
r~
PATCH 3/5 hw/intc/arm_gicv3: Specify valid and impl in MemoryRegionOps
In reply to Peter MaydellThe GICv3 has some registers that support byte accesses, and some that support 8-byte accesses. Our TCG implementation implements all of this, switching on the 'size' argument and handling the registers that must support reads of that size while logging an error for attempted accesses to registers that do not support that size access. However we forgot to tell the core memory subsystem about this by specifying the .impl and .valid fields in the MemoryRegionOps struct, so the core was happily simulating 8 byte accesses by combining two 4 byte accesses. This doesn't have much guest-visible effect, since there aren't many 8 byte registers and they all support being written in two 4 byte parts.
Set the .impl and .valid fields to say that all sizes from 1 to 8 bytes are both valid and implemented by the device.
--- hw/intc/arm_gicv3.c | 8 ++++++++ 1 file changed, 8 insertions(+)
hw/intc/arm_gicv3.c +8 -0
@@ -369,11 +369,19 @@ static const MemoryRegionOps gic_ops[] = { .read_with_attrs = gicv3_dist_read, .write_with_attrs = gicv3_dist_write, .endianness = DEVICE_NATIVE_ENDIAN, + .valid.min_access_size = 1, + .valid.max_access_size = 8, + .impl.min_access_size = 1, + .impl.max_access_size = 8, }, { .read_with_attrs = gicv3_redist_read, .write_with_attrs = gicv3_redist_write, .endianness = DEVICE_NATIVE_ENDIAN, + .valid.min_access_size = 1, + .valid.max_access_size = 8, + .impl.min_access_size = 1, + .impl.max_access_size = 8, } };
Signature · 1 line
2.25.1
Re: [PATCH 3/5] hw/intc/arm_gicv3: Specify valid and impl in MemoryRegionOps
Quoted 12 lines · Peter Maydell
The GICv3 has some registers that support byte accesses, and some that support 8-byte accesses. Our TCG implementation implements all of this, switching on the 'size' argument and handling the registers that must support reads of that size while logging an error for attempted accesses to registers that do not support that size access. However we forgot to tell the core memory subsystem about this by specifying the .impl and .valid fields in the MemoryRegionOps struct, so the core was happily simulating 8 byte accesses by combining two 4 byte accesses. This doesn't have much guest-visible effect, since there aren't many 8 byte registers and they all support being written in two 4 byte parts.
Quoted 4 lines
Set the .impl and .valid fields to say that all sizes from 1 to 8 bytes are both valid and implemented by the device.
Signed-off-by Peter Maydell <[email protected]>
r~
PATCH 4/5 hw/intc/arm_gicv3: Fix missing spaces in error log messages
In reply to Peter MaydellWe forgot a space in some log messages, so the output ended up looking likegicv3_dist_write: invalid guest write at offset 0000000000008000size 8
with a missing space before "size". Add the missing spaces.
--- hw/intc/arm_gicv3_dist.c | 4 ++-- hw/intc/arm_gicv3_its.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
hw/intc/arm_gicv3_dist.c +2 -2
@@ -838,7 +838,7 @@ MemTxResult gicv3_dist_read(void *opaque, hwaddr offset, uint64_t *data,if (!r) {qemu_log_mask (LOG_GUEST_ERROR ,"%s: invalid guest read at offset " TARGET_FMT_plx -"size %u\n" , __func__, offset, size); +" size %u\n" , __func__, offset, size);trace_gicv3_dist_badread (offset, size, attrs.secure);/* The spec requires that reserved registers are RAZ/WI; * so use MEMTX_ERROR returns from leaf functions as a way to
@@ -879,7 +879,7 @@ MemTxResult gicv3_dist_write(void *opaque, hwaddr offset, uint64_t data,if (!r) {qemu_log_mask (LOG_GUEST_ERROR ,"%s: invalid guest write at offset " TARGET_FMT_plx -"size %u\n" , __func__, offset, size); +" size %u\n" , __func__, offset, size);trace_gicv3_dist_badwrite (offset, data, size, attrs.secure);/* The spec requires that reserved registers are RAZ/WI; * so use MEMTX_ERROR returns from leaf functions as a way to
hw/intc/arm_gicv3_its.c +2 -2
@@ -1313,7 +1313,7 @@ static MemTxResult gicv3_its_read(void *opaque, hwaddr offset, uint64_t *data,if (!result) {qemu_log_mask (LOG_GUEST_ERROR ,"%s: invalid guest read at offset " TARGET_FMT_plx -"size %u\n" , __func__, offset, size); +" size %u\n" , __func__, offset, size);trace_gicv3_its_badread (offset, size);/* * The spec requires that reserved registers are RAZ/WI;
@@ -1349,7 +1349,7 @@ static MemTxResult gicv3_its_write(void *opaque, hwaddr offset, uint64_t data,if (!result) {qemu_log_mask (LOG_GUEST_ERROR ,"%s: invalid guest write at offset " TARGET_FMT_plx -"size %u\n" , __func__, offset, size); +" size %u\n" , __func__, offset, size);trace_gicv3_its_badwrite (offset, data, size);/* * The spec requires that reserved registers are RAZ/WI;
Signature · 1 line
2.25.1
Re: [PATCH 4/5] hw/intc/arm_gicv3: Fix missing spaces in error log messages
Quoted 11 lines · Peter Maydell
We forgot a space in some log messages, so the output ended up looking like
gicv3_dist_write: invalid guest write at offset 0000000000008000size 8with a missing space before "size". Add the missing spaces.
Signed-off-by Peter Maydell<[email protected]>--- hw/intc/arm_gicv3_dist.c | 4 ++-- hw/intc/arm_gicv3_its.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
r~
PATCH 5/5 hw/intc/arm_gicv3_cpuif: Fix register names in ICV_HPPIR read trace event
In reply to Peter MaydellThe trace_gicv3_icv_hppir_read trace event takes an integer value which it uses to form the register name, which should be either ICV_HPPIR0 or ICV_HPPIR1. We were passing in the 'grp' variable for this, but that is either GICV3_G0 or GICV3_G1NS, which happen to be 0 and 2, which meant that tracing for the ICV_HPPIR1 register was incorrectly printed as ICV_HPPIR2.
Use the same approach we do for all the other similar trace events, and pass in 'ri->crm == 8 ? 0 : 1', deriving the index value directly from the ARMCPRegInfo struct.
--- hw/intc/arm_gicv3_cpuif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/intc/arm_gicv3_cpuif.c +2 -1
@@ -612,7 +612,8 @@ static uint64_t icv_hppir_read(CPUARMState *env, const ARMCPRegInfo *ri) } } -trace_gicv3_icv_hppir_read (grp,gicv3_redist_affid (cs), value); +trace_gicv3_icv_hppir_read (ri->crm ==8 ?0 :1 , +gicv3_redist_affid (cs), value);return value; }
Signature · 1 line
2.25.1
Re: [PATCH 5/5] hw/intc/arm_gicv3_cpuif: Fix register names in ICV_HPPIR read trace event
Quoted 7 lines · Peter Maydell
The
trace_gicv3_icv_hppir_readtrace event takes an integer value which it uses to form the register name, which should be eitherICV_HPPIR0orICV_HPPIR1. We were passing in the 'grp' variable for this, but that is eitherGICV3_G0orGICV3_G1NS, which happen to be 0 and 2, which meant that tracing for theICV_HPPIR1register was incorrectly printed asICV_HPPIR2.
Quoted 5 lines
Use the same approach we do for all the other similar trace events, and pass in '
ri->crm== 8 ? 0 : 1', deriving the index value directly from the ARMCPRegInfo struct.Signed-off-by Peter Maydell <[email protected]>
r~