On 9/14/22 17:09, Alex Bennée wrote:
@@ -1340,8 +1340,13 @@ static uint64_t io_readx(CPUArchState *env,
CPUIOTLBEntry *iotlbentry,
uint64_t val;
bool locked = false;
MemTxResult r;
+ MemTxAttrs attrs = iotlbentry->attrs;
- section = iotlb_to_section(cpu, iotlbentry->addr, iotlbentry->attrs);
+ /* encode the accessing CPU */
+ attrs.requester_cpu = 1;
+ attrs.requester_id = cpu->cpu_index;
+
+ section = iotlb_to_section(cpu, iotlbentry->addr, attrs);
mr = section->mr;
mr_offset = (iotlbentry->addr & TARGET_PAGE_MASK) + addr;
cpu->mem_io_pc = retaddr;
At first I was going to suggest that this be done in tlb_set_page_with_attrs, so that it
could be done once and not duplicate code across read/write.
But then I got to thinking how this ought to interact with MEMTXATTRS_UNSPECIFIED, and now
I think that we simply have to leave this to the cpu's tlb_fill routine, where it fills in
(or doesn't) all of the other transaction attributes.
r~