Skip to content

Commit ffbc5e6

Browse files
committed
Merge tag 'pull-target-arm-20250307' of https://git.linaro.org/people/pmaydell/qemu-arm into staging
target-arm queue: * hw/arm/smmu-common: Remove the repeated ttb field * hw/gpio: npcm7xx: fixup out-of-bounds access * tests/functional/test_arm_sx1: Check whether the serial console is working * target/arm: Fix minor bugs in generic timer register handling * target/arm: Implement SEL2 physical and virtual timers * target/arm: Correct STRD, LDRD atomicity and fault behaviour * target/arm: Make dummy debug registers RAZ, not NOP * util/qemu-timer.c: Don't warp timer from timerlist_rearm() * include/exec/memop.h: Expand comment for MO_ATOM_SUBALIGN * hw/arm/smmu: Introduce smmu_configs_inv_sid_range() helper * target/rx: Set exception vector base to 0xffffff80 * target/rx: Remove TCG_CALL_NO_WG from helpers which write env # -----BEGIN PGP SIGNATURE----- # # iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmfLCzgZHHBldGVyLm1h # eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3pwVEACgJJm1zdtRd87AnA0eY29a # uG8M35+VS/bNbA6IXzz1hFHUFh1smrda0C7VOefRqThEhkDObh1gfKWK3YeBenDn # FQsI6Hwu23ozTCgOniheU8SGbTtIvVxRRX4S91xNZgJ15riEATDnTisZv8iUChdr # DcZopuH0uRiOq7TWuRjxqvhaqH6WusvHzK0mizTqr9UhbqPHVl7CZfr1/AtJLpZF # 32ix0JMofFWS52LFI19KWPlQG5Z3+lOw2ASyTf4cCaoCG6FTMv22E1x8mbMc2i96 # WrsB+NdhlBVRu7mskOP2Br09AbQZ/Fy7AGlDhgZebipOUVMlpDj1RXj/BDH3H/px # qsjOk3V3gzM2bD+KvJuO4FlGXgEbOzGsGBwwY152C/6DYW5uTha/H1Pp+/iR8kcS # HvAsqNLh/uF7O1Kn8qzCNvglKDC3z0C4X15Sj8SjGz8Xtn1Ign/GVkDv8ZCoR39K # ltnXwvhzlDMkcGFFfEn33MYZZYqB15nX5a78/cStB/aOGPtZwUJ+2udLDzmug5ve # 9oY9WMqqBDVxo4+qcAeZ+aem2VD6w79mhJyy1xmqOkifhFWqQ2VbDrKtqnrqhPK/ # neyWrd2zCF6fY1wvb7vVKMy7aC5jI2K6qVU7ueZGCGKU2MtvbVaFJFByOjnVjv6o # c65VNXkbaCIedrSlalMO4w== # =8typ # -----END PGP SIGNATURE----- # gpg: Signature made Fri 07 Mar 2025 23:05:28 HKT # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "[email protected]" # gpg: Good signature from "Peter Maydell <[email protected]>" [full] # gpg: aka "Peter Maydell <[email protected]>" [full] # gpg: aka "Peter Maydell <[email protected]>" [full] # gpg: aka "Peter Maydell <[email protected]>" [unknown] # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * tag 'pull-target-arm-20250307' of https://git.linaro.org/people/pmaydell/qemu-arm: (21 commits) target/rx: Remove TCG_CALL_NO_WG from helpers which write env target/rx: Set exception vector base to 0xffffff80 hw/arm/smmu: Introduce smmu_configs_inv_sid_range() helper include/exec/memop.h: Expand comment for MO_ATOM_SUBALIGN util/qemu-timer.c: Don't warp timer from timerlist_rearm() target/arm: Make dummy debug registers RAZ, not NOP target/arm: Drop unused address_offset from op_addr_{rr, ri}_post() target/arm: Correct STRD atomicity target/arm: Correct LDRD atomicity and fault behaviour hw/arm: enable secure EL2 timers for sbsa machine hw/arm: enable secure EL2 timers for virt machine target/arm: Document the architectural names of our GTIMERs target/arm: Implement SEL2 physical and virtual timers target/arm: Refactor handling of timer offset for direct register accesses target/arm: Always apply CNTVOFF_EL2 for CNTV_TVAL_EL02 accesses target/arm: Make CNTPS_* UNDEF from Secure EL1 when Secure EL2 is enabled target/arm: Don't apply CNTVOFF_EL2 for EL2_VIRT timer target/arm: Apply correct timer offset when calculating deadlines tests/functional/test_arm_sx1: Check whether the serial console is working hw/gpio: npcm7xx: fixup out-of-bounds access ... Signed-off-by: Stefan Hajnoczi <[email protected]>
2 parents e88a579 + 0ce0739 commit ffbc5e6

File tree

23 files changed

+455
-176
lines changed

23 files changed

+455
-176
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,6 +2010,7 @@ S: Maintained
20102010
F: hw/*/omap*
20112011
F: include/hw/arm/omap.h
20122012
F: docs/system/arm/sx1.rst
2013+
F: tests/functional/test_arm_sx1.py
20132014

20142015
IPack
20152016
M: Alberto Garcia <[email protected]>

hw/arm/sbsa-ref.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,8 @@ static void create_gic(SBSAMachineState *sms, MemoryRegion *mem)
484484
[GTIMER_HYP] = ARCH_TIMER_NS_EL2_IRQ,
485485
[GTIMER_SEC] = ARCH_TIMER_S_EL1_IRQ,
486486
[GTIMER_HYPVIRT] = ARCH_TIMER_NS_EL2_VIRT_IRQ,
487+
[GTIMER_S_EL2_PHYS] = ARCH_TIMER_S_EL2_IRQ,
488+
[GTIMER_S_EL2_VIRT] = ARCH_TIMER_S_EL2_VIRT_IRQ,
487489
};
488490

489491
for (irq = 0; irq < ARRAY_SIZE(timer_irq); irq++) {

hw/arm/smmu-common.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,27 @@ static gboolean smmu_hash_remove_by_vmid_ipa(gpointer key, gpointer value,
225225
((entry->iova & ~info->mask) == info->iova);
226226
}
227227

228+
static gboolean
229+
smmu_hash_remove_by_sid_range(gpointer key, gpointer value, gpointer user_data)
230+
{
231+
SMMUDevice *sdev = (SMMUDevice *)key;
232+
uint32_t sid = smmu_get_sid(sdev);
233+
SMMUSIDRange *sid_range = (SMMUSIDRange *)user_data;
234+
235+
if (sid < sid_range->start || sid > sid_range->end) {
236+
return false;
237+
}
238+
trace_smmu_config_cache_inv(sid);
239+
return true;
240+
}
241+
242+
void smmu_configs_inv_sid_range(SMMUState *s, SMMUSIDRange sid_range)
243+
{
244+
trace_smmu_configs_inv_sid_range(sid_range.start, sid_range.end);
245+
g_hash_table_foreach_remove(s->configs, smmu_hash_remove_by_sid_range,
246+
&sid_range);
247+
}
248+
228249
void smmu_iotlb_inv_iova(SMMUState *s, int asid, int vmid, dma_addr_t iova,
229250
uint8_t tg, uint64_t num_pages, uint8_t ttl)
230251
{

hw/arm/smmu-internal.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,4 @@ typedef struct SMMUIOTLBPageInvInfo {
141141
uint64_t mask;
142142
} SMMUIOTLBPageInvInfo;
143143

144-
typedef struct SMMUSIDRange {
145-
uint32_t start;
146-
uint32_t end;
147-
} SMMUSIDRange;
148-
149144
#endif

hw/arm/smmuv3.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ static void smmuv3_flush_config(SMMUDevice *sdev)
903903
SMMUv3State *s = sdev->smmu;
904904
SMMUState *bc = &s->smmu_state;
905905

906-
trace_smmuv3_config_cache_inv(smmu_get_sid(sdev));
906+
trace_smmu_config_cache_inv(smmu_get_sid(sdev));
907907
g_hash_table_remove(bc->configs, sdev);
908908
}
909909

@@ -1277,20 +1277,6 @@ static void smmuv3_range_inval(SMMUState *s, Cmd *cmd, SMMUStage stage)
12771277
}
12781278
}
12791279

1280-
static gboolean
1281-
smmuv3_invalidate_ste(gpointer key, gpointer value, gpointer user_data)
1282-
{
1283-
SMMUDevice *sdev = (SMMUDevice *)key;
1284-
uint32_t sid = smmu_get_sid(sdev);
1285-
SMMUSIDRange *sid_range = (SMMUSIDRange *)user_data;
1286-
1287-
if (sid < sid_range->start || sid > sid_range->end) {
1288-
return false;
1289-
}
1290-
trace_smmuv3_config_cache_inv(sid);
1291-
return true;
1292-
}
1293-
12941280
static int smmuv3_cmdq_consume(SMMUv3State *s)
12951281
{
12961282
SMMUState *bs = ARM_SMMU(s);
@@ -1373,8 +1359,7 @@ static int smmuv3_cmdq_consume(SMMUv3State *s)
13731359
sid_range.end = sid_range.start + mask;
13741360

13751361
trace_smmuv3_cmdq_cfgi_ste_range(sid_range.start, sid_range.end);
1376-
g_hash_table_foreach_remove(bs->configs, smmuv3_invalidate_ste,
1377-
&sid_range);
1362+
smmu_configs_inv_sid_range(bs, sid_range);
13781363
break;
13791364
}
13801365
case SMMU_CMD_CFGI_CD:

hw/arm/trace-events

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ smmu_iotlb_inv_asid_vmid(int asid, int vmid) "IOTLB invalidate asid=%d vmid=%d"
2222
smmu_iotlb_inv_vmid(int vmid) "IOTLB invalidate vmid=%d"
2323
smmu_iotlb_inv_vmid_s1(int vmid) "IOTLB invalidate vmid=%d"
2424
smmu_iotlb_inv_iova(int asid, uint64_t addr) "IOTLB invalidate asid=%d addr=0x%"PRIx64
25+
smmu_configs_inv_sid_range(uint32_t start, uint32_t end) "Config cache INV SID range from 0x%x to 0x%x"
26+
smmu_config_cache_inv(uint32_t sid) "Config cache INV for sid=0x%x"
2527
smmu_inv_notifiers_mr(const char *name) "iommu mr=%s"
2628
smmu_iotlb_lookup_hit(int asid, int vmid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache HIT asid=%d vmid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d"
2729
smmu_iotlb_lookup_miss(int asid, int vmid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache MISS asid=%d vmid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d"
@@ -59,7 +61,6 @@ smmuv3_cmdq_tlbi_nh(int vmid) "vmid=%d"
5961
smmuv3_cmdq_tlbi_nsnh(void) ""
6062
smmuv3_cmdq_tlbi_nh_asid(int asid) "asid=%d"
6163
smmuv3_cmdq_tlbi_s12_vmid(int vmid) "vmid=%d"
62-
smmuv3_config_cache_inv(uint32_t sid) "Config cache INV for sid=0x%x"
6364
smmuv3_notify_flag_add(const char *iommu) "ADD SMMUNotifier node for iommu mr=%s"
6465
smmuv3_notify_flag_del(const char *iommu) "DEL SMMUNotifier node for iommu mr=%s"
6566
smmuv3_inv_notifiers_iova(const char *name, int asid, int vmid, uint64_t iova, uint8_t tg, uint64_t num_pages, int stage) "iommu mr=%s asid=%d vmid=%d iova=0x%"PRIx64" tg=%d num_pages=0x%"PRIx64" stage=%d"

hw/arm/virt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,8 @@ static void create_gic(VirtMachineState *vms, MemoryRegion *mem)
882882
[GTIMER_HYP] = ARCH_TIMER_NS_EL2_IRQ,
883883
[GTIMER_SEC] = ARCH_TIMER_S_EL1_IRQ,
884884
[GTIMER_HYPVIRT] = ARCH_TIMER_NS_EL2_VIRT_IRQ,
885+
[GTIMER_S_EL2_PHYS] = ARCH_TIMER_S_EL2_IRQ,
886+
[GTIMER_S_EL2_VIRT] = ARCH_TIMER_S_EL2_VIRT_IRQ,
885887
};
886888

887889
for (unsigned irq = 0; irq < ARRAY_SIZE(timer_irq); irq++) {

hw/gpio/npcm7xx_gpio.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ static void npcm7xx_gpio_regs_write(void *opaque, hwaddr addr, uint64_t v,
220220
return;
221221
}
222222

223-
diff = s->regs[reg] ^ value;
224-
225223
switch (reg) {
226224
case NPCM7XX_GPIO_TLOCK1:
227225
case NPCM7XX_GPIO_TLOCK2:
@@ -242,6 +240,7 @@ static void npcm7xx_gpio_regs_write(void *opaque, hwaddr addr, uint64_t v,
242240
case NPCM7XX_GPIO_PU:
243241
case NPCM7XX_GPIO_PD:
244242
case NPCM7XX_GPIO_IEM:
243+
diff = s->regs[reg] ^ value;
245244
s->regs[reg] = value;
246245
npcm7xx_gpio_update_pins(s, diff);
247246
break;

include/exec/memop.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ typedef enum MemOp {
9191
* Depending on alignment, one or both will be single-copy atomic.
9292
* This is the atomicity e.g. of Arm FEAT_LSE2 LDP.
9393
* MO_ATOM_SUBALIGN: the operation is single-copy atomic by parts
94-
* by the alignment. E.g. if the address is 0 mod 4, then each
95-
* 4-byte subobject is single-copy atomic.
94+
* by the alignment. E.g. if an 8-byte value is accessed at an
95+
* address which is 0 mod 8, then the whole 8-byte access is
96+
* single-copy atomic; otherwise, if it is accessed at 0 mod 4
97+
* then each 4-byte subobject is single-copy atomic; otherwise
98+
* if it is accessed at 0 mod 2 then the four 2-byte subobjects
99+
* are single-copy atomic.
96100
* This is the atomicity e.g. of IBM Power.
97101
* MO_ATOM_NONE: the operation has no atomicity requirements.
98102
*

include/hw/arm/bsa.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#define QEMU_ARM_BSA_H
2323

2424
/* These are architectural INTID values */
25+
#define ARCH_TIMER_S_EL2_VIRT_IRQ 19
26+
#define ARCH_TIMER_S_EL2_IRQ 20
2527
#define VIRTUAL_PMU_IRQ 23
2628
#define ARCH_GIC_MAINT_IRQ 25
2729
#define ARCH_TIMER_NS_EL2_IRQ 26

0 commit comments

Comments
 (0)