[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 12/20] target/riscv: initialise MemTxAttrs for CPU access
From: |
Alex Bennée |
Subject: |
[PATCH v5 12/20] target/riscv: initialise MemTxAttrs for CPU access |
Date: |
Fri, 11 Nov 2022 18:25:27 +0000 |
get_physical_address works in the CPU context. Use the new
MEMTXATTRS_CPU constructor to ensure the correct CPU id is filled in
should it ever be needed by any devices later.
Currently the tlb_fill function isn't using the set with attributes
function so IO accesses from the softmmu slow-path will not be tagged
as coming from the CPU.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
target/riscv/cpu_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 278d163803..e661f9e68a 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -761,7 +761,7 @@ static int get_physical_address(CPURISCVState *env, hwaddr
*physical,
* correct, but the value visible to the exception handler
* (riscv_cpu_do_interrupt) is correct */
MemTxResult res;
- MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED;
+ MemTxAttrs attrs = MEMTXATTRS_CPU(env_cpu(env));
int mode = mmu_idx & TB_FLAGS_PRIV_MMU_MASK;
bool use_background = false;
hwaddr ppn;
--
2.34.1
- Re: [PATCH v5 19/20] hw/isa: derive CPUState from MemTxAttrs in apm_ioport_writeb, (continued)
- [PATCH v5 06/20] qtest: make read/write operation appear to be from CPU, Alex Bennée, 2022/11/11
- [PATCH v5 09/20] hw/arm: remove current_cpu hack from pxa2xx access, Alex Bennée, 2022/11/11
- [PATCH v5 10/20] target/microblaze: initialise MemTxAttrs for CPU access, Alex Bennée, 2022/11/11
- [PATCH v5 12/20] target/riscv: initialise MemTxAttrs for CPU access,
Alex Bennée <=
- [PATCH v5 16/20] include: add MEMTXATTRS_MACHINE helper, Alex Bennée, 2022/11/11
- [PATCH v5 11/20] target/sparc: initialise MemTxAttrs for CPU access, Alex Bennée, 2022/11/11
- [PATCH v5 18/20] hw/i386: convert apic access to use MemTxAttrs, Alex Bennée, 2022/11/11
- [PATCH v5 20/20] include/hw: add commentary to current_cpu export, Alex Bennée, 2022/11/11