|
From: | Richard Henderson |
Subject: | Re: [RFC PATCH 1/4] hw: encode accessing CPU index in MemTxAttrs |
Date: | Thu, 15 Sep 2022 09:05:13 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
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~
[Prev in Thread] | Current Thread | [Next in Thread] |