[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 33/41] hw/intc/arm_gicv3_redist: Use set_pending_table_bit() in m
From: |
Peter Maydell |
Subject: |
[PATCH 33/41] hw/intc/arm_gicv3_redist: Use set_pending_table_bit() in mov handling |
Date: |
Fri, 8 Apr 2022 15:15:42 +0100 |
We can use our new set_pending_table_bit() utility function
in gicv3_redist_mov_lpi() to clear the bit in the source
pending table, rather than doing the "load, clear bit, store"
ourselves.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/intc/arm_gicv3_redist.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/hw/intc/arm_gicv3_redist.c b/hw/intc/arm_gicv3_redist.c
index eadf5e8265e..3127af3e2ca 100644
--- a/hw/intc/arm_gicv3_redist.c
+++ b/hw/intc/arm_gicv3_redist.c
@@ -909,11 +909,9 @@ void gicv3_redist_mov_lpi(GICv3CPUState *src,
GICv3CPUState *dest, int irq)
* we choose to NOP. If LPIs are disabled on source there's nothing
* to be transferred anyway.
*/
- AddressSpace *as = &src->gic->dma_as;
uint64_t idbits;
uint32_t pendt_size;
uint64_t src_baddr;
- uint8_t src_pend;
if (!(src->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) ||
!(dest->gicr_ctlr & GICR_CTLR_ENABLE_LPIS)) {
@@ -932,15 +930,10 @@ void gicv3_redist_mov_lpi(GICv3CPUState *src,
GICv3CPUState *dest, int irq)
src_baddr = src->gicr_pendbaser & R_GICR_PENDBASER_PHYADDR_MASK;
- address_space_read(as, src_baddr + (irq / 8),
- MEMTXATTRS_UNSPECIFIED, &src_pend, sizeof(src_pend));
- if (!extract32(src_pend, irq % 8, 1)) {
+ if (!set_pending_table_bit(src, src_baddr, irq, 0)) {
/* Not pending on source, nothing to do */
return;
}
- src_pend &= ~(1 << (irq % 8));
- address_space_write(as, src_baddr + (irq / 8),
- MEMTXATTRS_UNSPECIFIED, &src_pend, sizeof(src_pend));
if (irq == src->hpplpi.irq) {
/*
* We just made this LPI not-pending so only need to update
--
2.25.1
- Re: [PATCH 36/41] hw/intc/arm_gicv3_redist: Implement gicv3_redist_inv_vlpi(), (continued)
- [PATCH 37/41] hw/intc/arm_gicv3: Update ID and feature registers for GICv4, Peter Maydell, 2022/04/08
- [PATCH 25/41] hw/intc/arm_gicv3_cpuif: Support vLPIs, Peter Maydell, 2022/04/08
- [PATCH 26/41] hw/intc/arm_gicv3_cpuif: Don't recalculate maintenance irq unnecessarily, Peter Maydell, 2022/04/08
- [PATCH 30/41] hw/intc/arm_gicv3_redist: Factor out "update bit in pending table" code, Peter Maydell, 2022/04/08
- [PATCH 33/41] hw/intc/arm_gicv3_redist: Use set_pending_table_bit() in mov handling,
Peter Maydell <=
- [PATCH 39/41] hw/arm/virt: Use VIRT_GIC_VERSION_* enum values in create_gic(), Peter Maydell, 2022/04/08
- [PATCH 32/41] hw/intc/arm_gicv3_redist: Implement gicv3_redist_vlpi_pending(), Peter Maydell, 2022/04/08
- [PATCH 40/41] hw/arm/virt: Abstract out calculation of redistributor region capacity, Peter Maydell, 2022/04/08
- Re: [PATCH 00/41] arm: Implement GICv4, Peter Maydell, 2022/04/08