qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 03/12] s390x/tcg: convert real to absolute address for RRB


From: Thomas Huth
Subject: Re: [PATCH v1 03/12] s390x/tcg: convert real to absolute address for RRBE, SSKE and ISKE
Date: Fri, 6 Aug 2021 08:50:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0

On 05/08/2021 17.27, David Hildenbrand wrote:
For RRBE, SSKE, and ISKE, we're dealing with real addresses, so we have to
convert to an absolute address first.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
  target/s390x/tcg/mem_helper.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c
index 3c0820dd74..dd506d8d17 100644
--- a/target/s390x/tcg/mem_helper.c
+++ b/target/s390x/tcg/mem_helper.c
@@ -2177,6 +2177,7 @@ uint64_t HELPER(iske)(CPUS390XState *env, uint64_t r2)
      uint64_t addr = wrap_address(env, r2);
      uint8_t key;
+ addr = mmu_real2abs(env, addr);

Ack.

      if (addr > ms->ram_size) {
          return 0;
      }
@@ -2201,6 +2202,7 @@ void HELPER(sske)(CPUS390XState *env, uint64_t r1, 
uint64_t r2)
      uint64_t addr = wrap_address(env, r2);
      uint8_t key;
+ addr = mmu_real2abs(env, addr);

According to the PoP:

"When the enhanced-DAT facility 1 is not installed, or
 when the facility is installed but the multiple-block
 control is zero, general register R 2 contains a real
 address. When the enhanced-DAT facility 1 is
 installed and the multiple-block control is one, gen-
 eral register R 2 contains an absolute address."

Don't we have to take that into consideration here, too?

      if (addr > ms->ram_size) {
          return;
      }
@@ -2228,6 +2230,7 @@ uint32_t HELPER(rrbe)(CPUS390XState *env, uint64_t r2)
      static S390SKeysClass *skeyclass;
      uint8_t re, key;
+ addr = mmu_real2abs(env, addr);
      if (addr > ms->ram_size) {
          return 0;
      }

Ack for rrbe.

 Thomas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]