All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] cputlb: Fix io_readx() to respect the access_type
@ 2019-04-19 11:45 ` Shahab Vahedi
  0 siblings, 0 replies; 15+ messages in thread
From: Shahab Vahedi @ 2019-04-19 11:45 UTC (permalink / raw)
  To: open list:Overall; +Cc: Richard Henderson, Paolo Bonzini, Shahab Vahedi

This change adapts io_readx() to its input access_type. Currently
io_readx() treats any memory access as a read, although it has an
input argument "MMUAccessType access_type". This results in:

1) Calling the tlb_fill() only with MMU_DATA_LOAD
2) Considering only entry->addr_read as the tlb_addr

Buglink: https://bugs.launchpad.net/qemu/+bug/1825359

Signed-off-by: Shahab Vahedi <shahab.vahedi@gmail.com>
---
Changelog:
- Extra space before closing parenthesis is removed

 accel/tcg/cputlb.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 88cc8389e9..4a305ac942 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -878,10 +878,13 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
         CPUTLBEntry *entry;
         target_ulong tlb_addr;
 
-        tlb_fill(cpu, addr, size, MMU_DATA_LOAD, mmu_idx, retaddr);
+        tlb_fill(cpu, addr, size, access_type, mmu_idx, retaddr);
 
         entry = tlb_entry(env, mmu_idx, addr);
-        tlb_addr = entry->addr_read;
+        tlb_addr =
+            (access_type == MMU_DATA_LOAD)  ? entry->addr_read  :
+            (access_type == MMU_DATA_STORE) ? entry->addr_write :
+            entry->addr_code;
         if (!(tlb_addr & ~(TARGET_PAGE_MASK | TLB_RECHECK))) {
             /* RAM access */
             uintptr_t haddr = addr + entry->addend;
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [Qemu-devel] [PATCH] cputlb: Fix io_readx() to respect the access_type
@ 2019-04-19 10:37 ` Shahab Vahedi
  0 siblings, 0 replies; 15+ messages in thread
From: Shahab Vahedi @ 2019-04-19 10:37 UTC (permalink / raw)
  To: open list:Overall; +Cc: Richard Henderson, Paolo Bonzini, Shahab Vahedi

This change adapts io_readx() to its input access_type. Currently
io_readx() treats any memory access as a read, although it has an
input argument "MMUAccessType access_type". This results in:

1) Calling the tlb_fill() only with MMU_DATA_LOAD
2) Considering only entry->addr_read as the tlb_addr

Buglink: https://bugs.launchpad.net/qemu/+bug/1825359

Signed-off-by: Shahab Vahedi <shahab.vahedi@gmail.com>
---
 accel/tcg/cputlb.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 88cc8389e9..0daac0e806 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -878,10 +878,13 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
         CPUTLBEntry *entry;
         target_ulong tlb_addr;
 
-        tlb_fill(cpu, addr, size, MMU_DATA_LOAD, mmu_idx, retaddr);
+        tlb_fill(cpu, addr, size, access_type, mmu_idx, retaddr);
 
         entry = tlb_entry(env, mmu_idx, addr);
-        tlb_addr = entry->addr_read;
+        tlb_addr =
+            (access_type == MMU_DATA_LOAD ) ? entry->addr_read  :
+            (access_type == MMU_DATA_STORE) ? entry->addr_write :
+            entry->addr_code;
         if (!(tlb_addr & ~(TARGET_PAGE_MASK | TLB_RECHECK))) {
             /* RAM access */
             uintptr_t haddr = addr + entry->addend;
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-04-21 14:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-19 11:45 [Qemu-devel] [PATCH] cputlb: Fix io_readx() to respect the access_type Shahab Vahedi
2019-04-19 11:45 ` Shahab Vahedi
2019-04-20 18:57 ` Peter Maydell
2019-04-20 18:57   ` Peter Maydell
2019-04-21  8:03   ` Shahab Vahedi
2019-04-21  8:03     ` Shahab Vahedi
2019-04-21 14:19     ` Peter Maydell
2019-04-21 14:19       ` Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2019-04-19 10:37 Shahab Vahedi
2019-04-19 10:37 ` Shahab Vahedi
2019-04-19 10:41 ` no-reply
2019-04-19 10:41   ` no-reply
2019-04-19 23:04 ` Alex Bennée
2019-04-20  9:49   ` Philippe Mathieu-Daudé
2019-04-20  9:49     ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.