REG64(IRS_SWERR_SYNDROMER1, 0x3d0)
FIELD(IRS_SWERR_SYNDROMER2, ADDR, 3, 53)
+static void irs_ist_baser_write(GICv5 *s, GICv5Domain domain, uint64_t value)
+{
+ GICv5Common *cs = ARM_GICV5_COMMON(s);
+
+ if (FIELD_EX64(cs->irs_ist_baser[domain], IRS_IST_BASER, VALID)) {
+ /* If VALID is set, ADDR is RO and we can only update VALID */
+ bool valid = FIELD_EX64(value, IRS_IST_BASER, VALID);
+ if (valid) {
+ /* Ignore 1->1 transition */
+ return;
+ }
+ cs->irs_ist_baser[domain] = FIELD_DP64(cs->irs_ist_baser[domain],
+ IRS_IST_BASER, VALID, valid);
+ return;
+ }
+ cs->irs_ist_baser[domain] = value;
+}
+
static bool config_readl(GICv5 *s, GICv5Domain domain, hwaddr offset,
uint64_t *data, MemTxAttrs attrs)
{
case A_IRS_AIDR:
*data = cs->irs_aidr;
return true;
+
+ case A_IRS_IST_BASER:
+ *data = extract64(cs->irs_ist_baser[domain], 0, 32);
+ return true;
+
+ case A_IRS_IST_BASER + 4:
+ *data = extract64(cs->irs_ist_baser[domain], 32, 32);
+ return true;
+
+ case A_IRS_IST_STATUSR:
+ /*
+ * For QEMU writes to IRS_IST_BASER and IRS_MAP_L2_ISTR take effect
+ * instantaneously, and the guest can never see the IDLE bit as 0.
+ */
+ *data = R_IRS_IST_STATUSR_IDLE_MASK;
+ return true;
+
+ case A_IRS_IST_CFGR:
+ *data = cs->irs_ist_cfgr[domain];
+ return true;
}
return false;
static bool config_writel(GICv5 *s, GICv5Domain domain, hwaddr offset,
uint64_t data, MemTxAttrs attrs)
{
+ GICv5Common *cs = ARM_GICV5_COMMON(s);
+
+ switch (offset) {
+ case A_IRS_IST_BASER:
+ irs_ist_baser_write(s, domain,
+ deposit64(cs->irs_ist_baser[domain], 0, 32, data));
+ return true;
+ case A_IRS_IST_BASER + 4:
+ irs_ist_baser_write(s, domain,
+ deposit64(cs->irs_ist_baser[domain], 32, 32, data));
+ return true;
+ case A_IRS_IST_CFGR:
+ if (FIELD_EX64(cs->irs_ist_baser[domain], IRS_IST_BASER, VALID)) {
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "guest tried to write IRS_IST_CFGR for %s config frame "
+ "while IST_BASER.VALID set\n", domain_name[domain]);
+ } else {
+ cs->irs_ist_cfgr[domain] = data;
+ }
+ return true;
+ }
+
return false;
}
static bool config_readll(GICv5 *s, GICv5Domain domain, hwaddr offset,
uint64_t *data, MemTxAttrs attrs)
{
+ GICv5Common *cs = ARM_GICV5_COMMON(s);
+
+ switch (offset) {
+ case A_IRS_IST_BASER:
+ *data = cs->irs_ist_baser[domain];
+ return true;
+ }
+
return false;
}
static bool config_writell(GICv5 *s, GICv5Domain domain, hwaddr offset,
uint64_t data, MemTxAttrs attrs)
{
+ switch (offset) {
+ case A_IRS_IST_BASER:
+ irs_ist_baser_write(s, domain, data);
+ return true;
+ }
+
return false;
}