Skip to contentSkip to conversation

target/s390x/tcg/mem_helper: Remove bad assert() statement

PATCH In review Thomas Huth 3 participants 3 messages Mar 17, 2023 – Mar 20, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/s390x/tcg/mem_helper: Remove bad assert() statement

The "assert(!nonfault)" statement can be triggered by running the "mvpg" s390x kvm-unit-test with TCG. According to Richard: "... the assert looks backward. We should only arrive there if nonfault was true for the probe (otherwise the probe would have raised the exception directly). I would think we could just remove the assert."

Fixes 4049431478 ("target/s390x: Fix s390_probe_access for user-only")
---
 target/s390x/tcg/mem_helper.c | 1 -
 1 file changed, 1 deletion(-)
target/s390x/tcg/mem_helper.c +0 -1
index 6835c26dda..adbc79b446 100644
@@ -149,7 +149,6 @@ static inline int s390_probe_access(CPUArchState *env, target_ulong addr,
                                    nonfault, phost, ra);
 
     if (unlikely(flags & TLB_INVALID_MASK)) {
-        assert(!nonfault);
 #ifdef CONFIG_USER_ONLY
         /* Address is in TEC in system mode; see s390_cpu_record_sigsegv. */
         env->__excp_addr = addr & TARGET_PAGE_MASK;
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Thomas Huth

The "assert(!nonfault)" statement can be triggered by running the "mvpg" s390x kvm-unit-test with TCG. According to Richard: "... the assert looks backward. We should only arrive there if nonfault was true for the probe (otherwise the probe would have raised the exception directly). I would think we could just remove the assert."

Quoted 6 lines
Fixes 4049431478 ("target/s390x: Fix s390_probe_access for user-only")
---
  target/s390x/tcg/mem_helper.c | 1 -
  1 file changed, 1 deletion(-)

r~

Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 10 lines · Thomas Huth

The "assert(!nonfault)" statement can be triggered by running the "mvpg" s390x kvm-unit-test with TCG. According to Richard: "... the assert looks backward. We should only arrive there if nonfault was true for the probe (otherwise the probe would have raised the exception directly). I would think we could just remove the assert."

Fixes 4049431478 ("target/s390x: Fix s390_probe_access for user-only")

---

Signature · 3 lines
Thanks,

David / dhildenb