[PATCH v2] accel/tcg: Fix TLB_MMIO check in tlb_plugin_lookup()

Anton Blanchard posted 1 patch 1 week, 3 days ago
accel/tcg/cputlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] accel/tcg: Fix TLB_MMIO check in tlb_plugin_lookup()
Posted by Anton Blanchard 1 week, 3 days ago
Update tlb_plugin_lookup() to check TLB_MMIO in slow_flags.

Signed-off-by: Anton Blanchard <antonb@tenstorrent.com>
---
 accel/tcg/cputlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 7f7c208ba1..3ca777d59c 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1593,7 +1593,7 @@ bool tlb_plugin_lookup(CPUState *cpu, vaddr addr, int mmu_idx,
     data->phys_addr = full->phys_addr | (addr & ~TARGET_PAGE_MASK);
 
     /* We must have an iotlb entry for MMIO */
-    if (tlb_addr & TLB_MMIO) {
+    if (full->slow_flags[access_type] & TLB_MMIO) {
         MemoryRegionSection *section = full->section;
         data->is_io = true;
         data->mr = section->mr;
-- 
2.34.1
Re: [PATCH v2] accel/tcg: Fix TLB_MMIO check in tlb_plugin_lookup()
Posted by Richard Henderson 1 week, 3 days ago
On 9/16/26 02:39, Anton Blanchard wrote:
> Update tlb_plugin_lookup() to check TLB_MMIO in slow_flags.
> 
> Signed-off-by: Anton Blanchard <antonb@tenstorrent.com>
> ---
>   accel/tcg/cputlb.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index 7f7c208ba1..3ca777d59c 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -1593,7 +1593,7 @@ bool tlb_plugin_lookup(CPUState *cpu, vaddr addr, int mmu_idx,
>       data->phys_addr = full->phys_addr | (addr & ~TARGET_PAGE_MASK);
>   
>       /* We must have an iotlb entry for MMIO */
> -    if (tlb_addr & TLB_MMIO) {
> +    if (full->slow_flags[access_type] & TLB_MMIO) {
>           MemoryRegionSection *section = full->section;
>           data->is_io = true;
>           data->mr = section->mr;

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
and queued for tcg-next.


r~