target/s390x: Prohibit target_ulong and TARGET_PAGE_SIZE uses
v2 cover target/s390x: Prohibit target_ulong and TARGET_PAGE_SIZE uses
Since v1:
- Drop merged patches
- Added R-b/A-b tags
- Use address_space_ldQ_be() in read_table_entry()
- One patch for vaddr replacement and another for hwaddr
- Do not remove the TARGET_PAGE_SIZE use in ioinst.c
- Expand TCG definitions for fixed 64-bit target
v1 cover:
- Restrict WatchPoint API to TCG
- Replace target_ulong uses by vaddr / hwaddr / uint64_t
- Remove the single TARGET_PAGE_SIZE
- Remove CONFIG_KVM from headers
- Compiles objects as target_common_system_arch, effectively forbidding further target_ulong / TARGET_PAGE_SIZE uses.
Philippe Mathieu-Daudé (9):
target/s390x: Use address_space_ldl_be() in read_table_entry() target/s390x: Rename get_phys_page_debug() @vaddr argument as @v_addr target/s390x: Replace %target_ulong -> %vaddr where appropriate target/s390x: Replace %target_ulong -> %hwaddr where appropriate target/s390x: Un-inline KVM Protected Virtualization stubs target/s390x: Add more unreachable KVM stubs
target/s390x: Build system units in common source set target/s390x: Expand TCGv type as 64-bit target target/s390x: Expand TCGv type as 64-bit target
target/s390x/kvm/pv.h | 27 ------ target/s390x/s390x-internal.h | 14 +-- target/s390x/helper.c | 10 +- target/s390x/kvm/stubs.c | 170 ++++++++++++++++++++++++++++++++- target/s390x/mmu_helper.c | 33 +++---- target/s390x/tcg/excp_helper.c | 3 +- target/s390x/tcg/translate.c | 60 ++++++------ target/s390x/meson.build | 7 +- target/s390x/tcg/meson.build | 2 +- 9 files changed, 236 insertions(+), 90 deletions(-)
Signature · 1 line
2.52.0
PATCH v2 1/9 target/s390x: Use address_space_ldl_be() in read_table_entry()
address_space_read/write() is meant for accessing random amount of memory blobs. When the access size is known, use the address_space_ld/st() API which can directly swap endianness.
--- target/s390x/mmu_helper.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
target/s390x/mmu_helper.c +4 -7
@@ -108,6 +108,7 @@ static inline bool read_table_entry(CPUS390XState *env, hwaddr gaddr, uint64_t *entry) {CPUState *cs =env_cpu (env); +MemTxResult ret;/* * According to the PoP, these table addresses are "unpredictably real
@@ -116,13 +117,9 @@ static inline bool read_table_entry(CPUS390XState *env, hwaddr gaddr,* * We treat them as absolute addresses and don't wrap them. */ -if (unlikely (address_space_read (cs->as, gaddr,MEMTXATTRS_UNSPECIFIED , - entry,sizeof (*entry)) != -MEMTX_OK )) { -return false; - } - *entry =be64_to_cpu (*entry); -return true; + *entry =address_space_ldq_be (cs->as, gaddr,MEMTXATTRS_UNSPECIFIED , &ret); + +return ret ==MEMTX_OK ; } static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr,
Signature · 1 line
2.52.0
Re: [PATCH v2 1/9] target/s390x: Use address_space_ldl_be() in read_table_entry()
$SUBJECT should be s/ldl/ldq/
Quoted 10 lines · Philippe Mathieu-Daudé
address_space_read/write() is meant for accessing random amount of memory blobs. When the access size is known, use the address_space_ld/st() API which can directly swap endianness.
Reviewed-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/mmu_helper.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
PATCH v2 2/9 target/s390x: Rename get_phys_page_debug() @vaddr argument as @v_addr
In reply to Philippe Mathieu-DaudéIn order to use the %vaddr type in s390_cpu_get_phys_page_debug() in the next commit, rename the argument @vaddr -> @v_addr.
--- target/s390x/helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
target/s390x/helper.c +3 -3
@@ -68,14 +68,14 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr)return raddr; } -hwaddr s390_cpu_get_phys_addr_debug (CPUState *cs,vaddr vaddr) +hwaddr s390_cpu_get_phys_addr_debug (CPUState *cs,vaddr v_addr) {hwaddr phys_addr;target_ulong page; - page = vaddr &TARGET_PAGE_MASK ; + page = v_addr &TARGET_PAGE_MASK ; phys_addr =cpu_get_phys_page_debug (cs, page); - phys_addr += (vaddr & ~TARGET_PAGE_MASK ); + phys_addr += (v_addr & ~TARGET_PAGE_MASK );return phys_addr; }
Signature · 1 line
2.52.0
Re: [PATCH v2 2/9] target/s390x: Rename get_phys_page_debug() @vaddr argument as @v_addr
Quoted 7 lines · Philippe Mathieu-Daudé
In order to use the %vaddr type in
s390_cpu_get_phys_page_debug()in the next commit, rename the argument @vaddr -> @v_addr.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
PATCH v2 3/9 target/s390x: Replace %target_ulong -> %vaddr where appropriate
In reply to Philippe Mathieu-DaudéUse the %vaddr type for virtual addresses.
--- target/s390x/s390x-internal.h | 5 +++-- target/s390x/helper.c | 2 +- target/s390x/mmu_helper.c | 6 +++--- target/s390x/tcg/excp_helper.c | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-)
target/s390x/s390x-internal.h +3 -2
@@ -10,6 +10,7 @@#ifndef S390X_INTERNAL_H #define S390X_INTERNAL_H +#include "exec/vaddr.h" #include "cpu.h" #include "fpu/softfloat.h"
@@ -376,9 +377,9 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,bool mmu_absolute_addr_valid (target_ulong addr,bool is_write);/* Special access mode only valid for mmu_translate() */ #define MMU_S390_LRA -1 -int mmu_translate (CPUS390XState *env,target_ulong vaddr,int rw,uint64_t asc, +int mmu_translate (CPUS390XState *env,vaddr vaddr,int rw,uint64_t asc,target_ulong *raddr,int *flags,uint64_t *tec); -int mmu_translate_real (CPUS390XState *env,target_ulong raddr,int rw, +int mmu_translate_real (CPUS390XState *env,vaddr raddr,int rw,target_ulong *addr,int *flags,uint64_t *tec);
target/s390x/helper.c +1 -1
@@ -71,7 +71,7 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr)hwaddr s390_cpu_get_phys_addr_debug (CPUState *cs,vaddr v_addr) {hwaddr phys_addr; -target_ulong page; +vaddr page; page = v_addr &TARGET_PAGE_MASK ; phys_addr =cpu_get_phys_page_debug (cs, page);
target/s390x/mmu_helper.c +3 -3
@@ -122,7 +122,7 @@ static inline bool read_table_entry(CPUS390XState *env, hwaddr gaddr,return ret ==MEMTX_OK ; } -static int mmu_translate_asce (CPUS390XState *env,target_ulong vaddr, +static int mmu_translate_asce (CPUS390XState *env,vaddr vaddr,uint64_t asc,uint64_t asce,target_ulong *raddr,int *flags) {
@@ -381,7 +381,7 @@ static void mmu_handle_skey(target_ulong addr, int rw, int *flags)* there is an exception to raise * @return 0 = success, != 0, the exception to raise */ -int mmu_translate (CPUS390XState *env,target_ulong vaddr,int rw,uint64_t asc, +int mmu_translate (CPUS390XState *env,vaddr vaddr,int rw,uint64_t asc,target_ulong *raddr,int *flags,uint64_t *tec) {uint64_t asce;
@@ -584,7 +584,7 @@ void s390_cpu_virt_mem_handle_exc(S390CPU *cpu, uintptr_t ra)* @param flags the PAGE_READ/WRITE/EXEC flags are stored to this pointer * @return 0 = success, != 0, the exception to raise */ -int mmu_translate_real (CPUS390XState *env,target_ulong raddr,int rw, +int mmu_translate_real (CPUS390XState *env,vaddr raddr,int rw,target_ulong *addr,int *flags,uint64_t *tec) {const bool lowprot_enabled = env->cregs[0 ] &CR0_LOWPROT ;
target/s390x/tcg/excp_helper.c +2 -1
@@ -147,7 +147,8 @@ bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, int size, bool probe, uintptr_t retaddr) {CPUS390XState *env =cpu_env (cs); -target_ulong vaddr, raddr; +vaddr vaddr; +target_ulong raddr;uint64_t asc, tec;int prot, excp;
Signature · 1 line
2.52.0
Re: [PATCH v2 3/9] target/s390x: Replace %target_ulong -> %vaddr where appropriate
Quoted 9 lines · Philippe Mathieu-Daudé
Use the %vaddr type for virtual addresses.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/s390x-internal.h | 5 +++-- target/s390x/helper.c | 2 +- target/s390x/mmu_helper.c | 6 +++--- target/s390x/tcg/excp_helper.c | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-)
Re: [PATCH v2 3/9] target/s390x: Replace %target_ulong -> %vaddr where appropriate
In reply to Philippe Mathieu-DaudéQuoted 23 lines · Philippe Mathieu-Daudé
Use the %vaddr type for virtual addresses.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/s390x-internal.h | 5 +++-- target/s390x/helper.c | 2 +- target/s390x/mmu_helper.c | 6 +++--- target/s390x/tcg/excp_helper.c | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-)target/s390x/s390x-internal.h +1
-0@@ -10,6 +10,7 @@#ifndef S390X_INTERNAL_H #define S390X_INTERNAL_H +#include "exec/vaddr.h" #include "cpu.h" #include "fpu/softfloat.h"
target/s390x/s390x-internal.h void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len, · line 382
Quoted 8 lines
target/s390x/s390x-internal.h +2
-2@@ -376,9 +377,9 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,bool mmu_absolute_addr_valid (target_ulong addr,bool is_write);/* Special access mode only valid for mmu_translate() */ #define MMU_S390_LRA -1 -int mmu_translate (CPUS390XState *env,target_ulong vaddr,int rw,uint64_t asc, +int mmu_translate (CPUS390XState *env,vaddr vaddr,int rw,uint64_t asc,target_ulong *raddr,int *flags,uint64_t *tec); -int mmu_translate_real(CPUS390XState *env, target_ulong raddr, int rw, +int mmu_translate_real(CPUS390XState *env, vaddr raddr, int rw,
I think this one should remain target_ulong, and become hwaddr in the next patch, no?
Quoted 61 lines
target/s390x/s390x-internal.h +0
-0target_ulong *addr, int *flags, uint64_t *tec);target/s390x/helper.c +1
-1@@ -71,7 +71,7 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr)hwaddr s390_cpu_get_phys_addr_debug (CPUState *cs,vaddr v_addr) {hwaddr phys_addr; -target_ulong page; +vaddr page; page = v_addr &TARGET_PAGE_MASK ; phys_addr =cpu_get_phys_page_debug (cs, page);target/s390x/mmu_helper.c +3
-3@@ -122,7 +122,7 @@ static inline bool read_table_entry(CPUS390XState *env, hwaddr gaddr,return ret ==MEMTX_OK ; } -static int mmu_translate_asce (CPUS390XState *env,target_ulong vaddr, +static int mmu_translate_asce (CPUS390XState *env,vaddr vaddr,uint64_t asc,uint64_t asce,target_ulong *raddr,int *flags) {@@ -381,7 +381,7 @@ static void mmu_handle_skey(target_ulong addr, int rw, int *flags)* there is an exception to raise * @return 0 = success, != 0, the exception to raise */ -int mmu_translate (CPUS390XState *env,target_ulong vaddr,int rw,uint64_t asc, +int mmu_translate (CPUS390XState *env,vaddr vaddr,int rw,uint64_t asc,target_ulong *raddr,int *flags,uint64_t *tec) {uint64_t asce;@@ -584,7 +584,7 @@ void s390_cpu_virt_mem_handle_exc(S390CPU *cpu, uintptr_t ra)* @param flags the PAGE_READ/WRITE/EXEC flags are stored to this pointer * @return 0 = success, != 0, the exception to raise */ -int mmu_translate_real (CPUS390XState *env,target_ulong raddr,int rw, +int mmu_translate_real (CPUS390XState *env,vaddr raddr,int rw,target_ulong *addr,int *flags,uint64_t *tec) {const bool lowprot_enabled = env->cregs[0 ] &CR0_LOWPROT ;target/s390x/tcg/excp_helper.c +2
-1@@ -147,7 +147,8 @@ bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, int size, bool probe, uintptr_t retaddr) {CPUS390XState *env =cpu_env (cs); -target_ulong vaddr, raddr; +vaddr vaddr; +target_ulong raddr;uint64_t asc, tec;int prot, excp;
Re: [PATCH v2 3/9] target/s390x: Replace %target_ulong -> %vaddr where appropriate
Hi Eric,
Quoted 12 lines · Eric Farman
Quoted 9 lines · Philippe Mathieu-Daudé
Use the %vaddr type for virtual addresses.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/s390x-internal.h | 5 +++-- target/s390x/helper.c | 2 +- target/s390x/mmu_helper.c | 6 +++--- target/s390x/tcg/excp_helper.c | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-)
Quoted 11 lines
target/s390x/s390x-internal.h void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len, · line 382
Quoted 9 lines
target/s390x/s390x-internal.h +2
-2@@ -376,9 +377,9 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,bool mmu_absolute_addr_valid (target_ulong addr,bool is_write);/* Special access mode only valid for mmu_translate() */ #define MMU_S390_LRA -1 -int mmu_translate (CPUS390XState *env,target_ulong vaddr,int rw,uint64_t asc, +int mmu_translate (CPUS390XState *env,vaddr vaddr,int rw,uint64_t asc,target_ulong *raddr,int *flags,uint64_t *tec); -int mmu_translate_real(CPUS390XState *env, target_ulong raddr, int rw, +int mmu_translate_real(CPUS390XState *env, vaddr raddr, int rw,I think this one should remain
target_ulong, and become hwaddr in the next patch, no?
Without s390x background, I don't understand well what real addresses are. IFAICT the single caller s390_cpu_tlb_fill() provides a virtual address. But then indeed mmu_real2abs() consumes a hwaddr as real addr.
Quoted 4 lines
Quoted 4 lines
target/s390x/s390x-internal.h +0
-0target_ulong *addr, int *flags, uint64_t *tec);
Re: [PATCH v2 3/9] target/s390x: Replace %target_ulong -> %vaddr where appropriate
Quoted 27 lines · Philippe Mathieu-Daudé
Hi Eric,
Quoted 12 lines · Eric Farman
Quoted 9 lines · Philippe Mathieu-Daudé
Use the %vaddr type for virtual addresses.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/s390x-internal.h | 5 +++-- target/s390x/helper.c | 2 +- target/s390x/mmu_helper.c | 6 +++--- target/s390x/tcg/excp_helper.c | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-)Quoted 11 lines
target/s390x/s390x-internal.h void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len, · line 382
Quoted 9 lines
target/s390x/s390x-internal.h +2
-2@@ -376,9 +377,9 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,bool mmu_absolute_addr_valid (target_ulong addr,bool is_write);/* Special access mode only valid for mmu_translate() */ #define MMU_S390_LRA -1 -int mmu_translate (CPUS390XState *env,target_ulong vaddr,int rw,uint64_t asc, +int mmu_translate (CPUS390XState *env,vaddr vaddr,int rw,uint64_t asc,target_ulong *raddr,int *flags,uint64_t *tec); -int mmu_translate_real(CPUS390XState *env, target_ulong raddr, int rw, +int mmu_translate_real(CPUS390XState *env, vaddr raddr, int rw,I think this one should remain
target_ulong, and become hwaddr in the next patch, no?
Quoted 3 lines
Without s390x background, I don't understand well what real addresses are. IFAICT the single caller
s390_cpu_tlb_fill()provides a virtual address. But then indeedmmu_real2abs()consumes a hwaddr as real addr.
Hi Philippe,
Ah, I didn't go the other direction (my bad). The usage of "real" here is kind of halfway between virtual and -really- real. I suspect the caller is mistaken here, but I think that's a research project for tomorrow.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
target/s390x/s390x-internal.h +0
-0target_ulong *addr, int *flags, uint64_t *tec);
Re: [PATCH v2 3/9] target/s390x: Replace %target_ulong -> %vaddr where appropriate
Quoted 28 lines · Eric Farman
Quoted 27 lines · Philippe Mathieu-Daudé
Hi Eric,
Quoted 23 lines · Eric Farman
Quoted 12 lines · Philippe Mathieu-Daudé
Use the %vaddr type for virtual addresses.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/s390x-internal.h | 5 +++-- target/s390x/helper.c | 2 +- target/s390x/mmu_helper.c | 6 +++--- target/s390x/tcg/excp_helper.c | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-)target/s390x/s390x-internal.h void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len, · line 382
Quoted 8 lines
target/s390x/s390x-internal.h +2
-2@@ -376,9 +377,9 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,bool mmu_absolute_addr_valid (target_ulong addr,bool is_write);/* Special access mode only valid for mmu_translate() */ #define MMU_S390_LRA -1 -int mmu_translate (CPUS390XState *env,target_ulong vaddr,int rw,uint64_t asc, +int mmu_translate (CPUS390XState *env,vaddr vaddr,int rw,uint64_t asc,target_ulong *raddr,int *flags,uint64_t *tec); -int mmu_translate_real(CPUS390XState *env, target_ulong raddr, int rw, +int mmu_translate_real(CPUS390XState *env, vaddr raddr, int rw,I think this one should remain
target_ulong, and become hwaddr in the next patch, no?
Quoted 8 lines
Quoted 3 lines
Without s390x background, I don't understand well what real addresses are. IFAICT the single caller
s390_cpu_tlb_fill()provides a virtual address. But then indeedmmu_real2abs()consumes a hwaddr as real addr.Hi Philippe,
Ah, I didn't go the other direction (my bad). The usage of "real" here is kind of halfway between virtual and -really- real.
Yes, real addresses are like physical addresses in s390 land - except for the two so-called low-core pages that might be swapped with two other pages in memory.
Quoted 2 lines
I suspect the caller is mistaken here, but I think that's a research project for tomorrow.
The caller s390_cpu_tlb_fill() seems to deal with both, real a virtual addresses, and uses the same variable for both, so I think that's fine there. But I agree with Eric mmu_translate_real() should use "hwaddr" for the raddr parameter instead. Philippe, could you please adjust the patch?
Thanks,
Thomas
Re: [PATCH v2 3/9] target/s390x: Replace %target_ulong -> %vaddr where appropriate
Quoted 42 lines · Thomas Huth
Quoted 32 lines · Eric Farman
Quoted 31 lines · Philippe Mathieu-Daudé
Hi Eric,
Quoted 27 lines · Eric Farman
Quoted 22 lines · Philippe Mathieu-Daudé
Use the %vaddr type for virtual addresses.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
target/s390x/s390x-internal.h | 5 +++--
target/s390x/helper.c | 2 +-
target/s390x/mmu_helper.c | 6 +++---
target/s390x/tcg/excp_helper.c| 3 ++-4 files changed, 9 insertions(+), 7 deletions(-)(quoted diff) +1
-2@@ -376,9 +377,9 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len, bool mmu_absolute_addr_valid(target_ulong addr, bool is_write); /* Special access mode only valid for mmu_translate() */ #define MMU_S390_LRA -1 -int mmu_translate(CPUS390XState *env, target_ulong vaddr, int rw, uint64_t asc, +int mmu_translate(CPUS390XState *env, vaddr vaddr, int rw, uint64_t asc, target_ulong *raddr, int *flags, uint64_t *tec); -int mmu_translate_real(CPUS390XState *env, target_ulong raddr, intQuoted 2 lines
rw,
+int mmu_translate_real(CPUS390XState *env, vaddr raddr, int rw,I think this one should remain
target_ulong, and become hwaddr in the next patch, no?Quoted 8 lines
Quoted 3 lines
Without s390x background, I don't understand well what real addresses are. IFAICT the single caller
s390_cpu_tlb_fill()provides a virtual address. But then indeedmmu_real2abs()consumes a hwaddr as real addr.Hi Philippe,
Ah, I didn't go the other direction (my bad). The usage of "real" here is kind of halfway between virtual and -really- real.
Quoted 7 lines
Yes, real addresses are like physical addresses in s390 land - except for the two so-called low-core pages that might be swapped with two other pages in memory.
Quoted 2 lines
I suspect the caller is mistaken here, but I think that's a research project for tomorrow.
The caller
s390_cpu_tlb_fill()seems to deal with both, real a virtual addresses, and uses the same variable for both, so I think that's fine there. But I agree with Ericmmu_translate_real()should use "hwaddr" for the raddr parameter instead. Philippe, could you please adjust the patch?
Sure!
PATCH v2 4/9 target/s390x: Replace %target_ulong -> %hwaddr where appropriate
In reply to Philippe Mathieu-DaudéUse the %hwaddr type for physical addresses.
--- target/s390x/s390x-internal.h | 9 +++++---- target/s390x/helper.c | 2 +- target/s390x/mmu_helper.c | 16 ++++++++-------- target/s390x/tcg/excp_helper.c | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-)
target/s390x/s390x-internal.h +5 -4
@@ -10,6 +10,7 @@#ifndef S390X_INTERNAL_H #define S390X_INTERNAL_H +#include "exec/hwaddr.h" #include "exec/vaddr.h" #include "cpu.h" #include "fpu/softfloat.h"
@@ -368,19 +369,19 @@ void ioinst_handle_sal(S390CPU *cpu, uint64_t reg1, uintptr_t ra);/* mem_helper.c */ -target_ulong mmu_real2abs (CPUS390XState *env,target_ulong raddr);void probe_write_access (CPUS390XState *env,uint64_t addr,uint64_t len,uintptr_t ra);/* mmu_helper.c */ -bool mmu_absolute_addr_valid (target_ulong addr,bool is_write); +hwaddr mmu_real2abs (CPUS390XState *env,hwaddr raddr); +bool mmu_absolute_addr_valid (hwaddr addr,bool is_write);/* Special access mode only valid for mmu_translate() */ #define MMU_S390_LRA -1int mmu_translate (CPUS390XState *env,vaddr vaddr,int rw,uint64_t asc, -target_ulong *raddr,int *flags,uint64_t *tec); +hwaddr *raddr,int *flags,uint64_t *tec);int mmu_translate_real (CPUS390XState *env,vaddr raddr,int rw, -target_ulong *addr,int *flags,uint64_t *tec); +hwaddr *addr,int *flags,uint64_t *tec);/* misc_helper.c */
target/s390x/helper.c +1 -1
@@ -43,7 +43,7 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr) {S390CPU *cpu =S390_CPU (cs);CPUS390XState *env = &cpu->env; -target_ulong raddr; +hwaddr raddr;int prot;uint64_t asc = env->psw.mask &PSW_MASK_ASC ;uint64_t tec;
target/s390x/mmu_helper.c +8 -8
@@ -86,7 +86,7 @@ static bool lowprot_enabled(const CPUS390XState *env, uint64_t asc)* Translate real address to absolute (= physical) * address by taking care of the prefix mapping. */ -target_ulong mmu_real2abs (CPUS390XState *env,target_ulong raddr) +hwaddr mmu_real2abs (CPUS390XState *env,hwaddr raddr) {if (raddr <0x2000 ) {return raddr + env->psa;/* Map the lowcore. */
@@ -96,7 +96,7 @@ target_ulong mmu_real2abs(CPUS390XState *env, target_ulong raddr)return raddr; } -bool mmu_absolute_addr_valid (target_ulong addr,bool is_write) +bool mmu_absolute_addr_valid (hwaddr addr,bool is_write) { return address_space_access_valid(&address_space_memory, addr & TARGET_PAGE_MASK,
@@ -123,7 +123,7 @@ static inline bool read_table_entry(CPUS390XState *env, hwaddr gaddr, }static int mmu_translate_asce (CPUS390XState *env,vaddr vaddr, -uint64_t asc,uint64_t asce,target_ulong *raddr, +uint64_t asc,uint64_t asce,hwaddr *raddr,int *flags) { const bool edat1 = (env->cregs[0] & CR0_EDAT) &&
@@ -296,7 +296,7 @@ static int mmu_translate_asce(CPUS390XState *env, vaddr vaddr,return 0 ; } -static void mmu_handle_skey (target_ulong addr,int rw,int *flags) +static void mmu_handle_skey (hwaddr addr,int rw,int *flags) {static S390SKeysClass *skeyclass;static S390SKeysState *ss;
@@ -382,7 +382,7 @@ static void mmu_handle_skey(target_ulong addr, int rw, int *flags)* @return 0 = success, != 0, the exception to raise */ int mmu_translate (CPUS390XState *env,vaddr vaddr,int rw,uint64_t asc, -target_ulong *raddr,int *flags,uint64_t *tec) +hwaddr *raddr,int *flags,uint64_t *tec) {uint64_t asce;int r;
@@ -472,7 +472,7 @@ nodat:* the MEMOP interface. */ static int translate_pages (S390CPU *cpu,vaddr addr,int nr_pages, -target_ulong *pages,bool is_write,uint64_t *tec) +hwaddr *pages,bool is_write,uint64_t *tec) {uint64_t asc = cpu->env.psw.mask &PSW_MASK_ASC ;CPUS390XState *env = &cpu->env;
@@ -523,7 +523,7 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uint8_t ar, void *hostbuf, {const MemTxAttrs attrs =MEMTXATTRS_UNSPECIFIED ;int currlen, nr_pages, i; -target_ulong *pages; +hwaddr *pages;uint64_t tec;int ret;
@@ -585,7 +585,7 @@ void s390_cpu_virt_mem_handle_exc(S390CPU *cpu, uintptr_t ra)* @return 0 = success, != 0, the exception to raise */ int mmu_translate_real (CPUS390XState *env,vaddr raddr,int rw, -target_ulong *addr,int *flags,uint64_t *tec) +hwaddr *addr,int *flags,uint64_t *tec) {const bool lowprot_enabled = env->cregs[0 ] &CR0_LOWPROT ;
target/s390x/tcg/excp_helper.c +1 -1
@@ -148,7 +148,7 @@ bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, int size, {CPUS390XState *env =cpu_env (cs);vaddr vaddr; -target_ulong raddr; +hwaddr raddr;uint64_t asc, tec;int prot, excp;
Signature · 1 line
2.52.0
Re: [PATCH v2 4/9] target/s390x: Replace %target_ulong -> %hwaddr where appropriate
Quoted 9 lines · Philippe Mathieu-Daudé
Use the %hwaddr type for physical addresses.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/s390x-internal.h | 9 +++++---- target/s390x/helper.c | 2 +- target/s390x/mmu_helper.c | 16 ++++++++-------- target/s390x/tcg/excp_helper.c | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-)
PATCH v2 5/9 target/s390x: Un-inline KVM Protected Virtualization stubs
In reply to Philippe Mathieu-DaudéBy removing the target-specific 'CONFIG_KVM' definition this header can be used by files in meson common_ss[].
--- target/s390x/kvm/pv.h | 27 ------------ target/s390x/kvm/stubs.c | 94 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 27 deletions(-)
target/s390x/kvm/pv.h +0 -27
@@ -20,7 +20,6 @@ struct S390PVResponse {uint16_t rc; }; -#ifdef CONFIG_KVM bool s390_is_pv (void );int s390_pv_query_info (void );int s390_pv_vm_enable (void );
@@ -43,31 +42,5 @@ int kvm_s390_dump_init(void);int kvm_s390_dump_cpu (S390CPU *cpu,void *buff);int kvm_s390_dump_mem_state (uint64_t addr,size_t len,void *dest);int kvm_s390_dump_completion_data (void *buff); -#else /* CONFIG_KVM */ -static inline bool s390_is_pv (void ) {return false; } -static inline int s390_pv_query_info (void ) {return 0 ; } -static inline int s390_pv_vm_enable (void ) {return 0 ; } -static inline void s390_pv_vm_disable (void ) {} -static inline bool s390_pv_vm_try_disable_async (S390CcwMachineState *ms) {return false; } -static inline int s390_pv_set_sec_parms (uint64_t origin,uint64_t length, -struct S390PVResponse *pv_resp, -Error **errp) {return 0 ; } -static inline int s390_pv_unpack (uint64_t addr,uint64_t size,uint64_t tweak, -struct S390PVResponse *pv_resp) {return 0 ; } -static inline void s390_pv_prep_reset (void ) {} -static inline int s390_pv_verify (struct S390PVResponse *pv_resp) {return 0 ; } -static inline void s390_pv_unshare (void ) {} -static inline void s390_pv_inject_reset_error (CPUState *cs, -struct S390PVResponse pv_resp) {}; -static inline uint64_t kvm_s390_pv_dmp_get_size_cpu (void ) {return 0 ; } -static inline uint64_t kvm_s390_pv_dmp_get_size_mem_state (void ) {return 0 ; } -static inline uint64_t kvm_s390_pv_dmp_get_size_completion_data (void ) {return 0 ; } -static inline bool kvm_s390_pv_info_basic_valid (void ) {return false; } -static inline int kvm_s390_dump_init (void ) {return 0 ; } -static inline int kvm_s390_dump_cpu (S390CPU *cpu,void *buff) {return 0 ; } -static inline int kvm_s390_dump_mem_state (uint64_t addr,size_t len, -void *dest) {return 0 ; } -static inline int kvm_s390_dump_completion_data (void *buff) {return 0 ; } -#endif /* CONFIG_KVM */ #endif /* HW_S390_PV_H */
target/s390x/kvm/stubs.c +94 -0
102 lines not on this page · raw message
Signature · 1 line
2.52.0
Re: [PATCH v2 5/9] target/s390x: Un-inline KVM Protected Virtualization stubs
Quoted 8 lines · Philippe Mathieu-Daudé
By removing the target-specific '
CONFIG_KVM' definition this header can be used by files in meson common_ss[].Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/kvm/pv.h | 27 ------------ target/s390x/kvm/stubs.c | 94 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 27 deletions(-)
Re: [PATCH v2 5/9] target/s390x: Un-inline KVM Protected Virtualization stubs
In reply to Philippe Mathieu-DaudéQuoted 8 lines · Philippe Mathieu-Daudé
By removing the target-specific '
CONFIG_KVM' definition this header can be used by files in meson common_ss[].Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/kvm/pv.h | 27 ------------ target/s390x/kvm/stubs.c | 94 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 27 deletions(-)
PATCH v2 6/9 target/s390x: Add more unreachable KVM stubs
In reply to Philippe Mathieu-DaudéNext patch will move s390x system objects from the target specific source set to the common one. Unfortunately the kvm_enabled() macro won't be evaluable at built-time anymore. Add stubs for KVM symbols unreachable at runtime.
--- target/s390x/kvm/stubs.c | 76 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-)
target/s390x/kvm/stubs.c +75 -1
@@ -4,8 +4,9 @@#include "qemu/osdep.h" -#include "kvm_s390x.h" +#include "target/s390x/kvm/kvm_s390x.h" #include "target/s390x/kvm/pv.h" +#include "target/s390x/cpu_models.h" int kvm_s390_get_protected_dump (void ) {
@@ -104,3 +105,76 @@ int kvm_s390_dump_completion_data(void *buff) {return 0 ; } + +bool kvm_s390_apply_cpu_model (const S390CPUModel *model,Error **errp) +{ +g_assert_not_reached (); +} + +void kvm_s390_access_exception (S390CPU *cpu,uint16_t code,uint64_t te_code) +{ +g_assert_not_reached (); +} + +int kvm_s390_mem_op (S390CPU *cpu,vaddr addr,uint8_t ar,void *hostbuf, +int len,bool is_write) +{ +g_assert_not_reached (); +} + +int kvm_s390_mem_op_pv (S390CPU *cpu,vaddr addr,void *hostbuf,int len, +bool is_write) +{ +g_assert_not_reached (); +} + +int kvm_s390_set_cpu_state (S390CPU *cpu,uint8_t cpu_state) +{ +g_assert_not_reached (); +} + +void kvm_s390_vcpu_interrupt_pre_save (S390CPU *cpu) +{ +g_assert_not_reached (); +} + +int kvm_s390_vcpu_interrupt_post_load (S390CPU *cpu) +{ +g_assert_not_reached (); +} + +int kvm_s390_get_hpage_1m (void ) +{ +g_assert_not_reached (); +} + +void kvm_s390_enable_css_support (S390CPU *cpu) +{ +g_assert_not_reached (); +} + +int kvm_s390_assign_subch_ioeventfd (EventNotifier *notifier,uint32_t sch, +int vq,bool assign) +{ +g_assert_not_reached (); +} + +void kvm_s390_cmma_reset (void ) +{ +g_assert_not_reached (); +} + +void kvm_s390_crypto_reset (void ) +{ +g_assert_not_reached (); +} + +void kvm_s390_set_diag318 (CPUState *cs,uint64_t diag318_info) +{ +g_assert_not_reached (); +} + +int kvm_s390_topology_set_mtcr (uint64_t attr) +{ +g_assert_not_reached (); +}
Signature · 1 line
2.52.0
Re: [PATCH v2 6/9] target/s390x: Add more unreachable KVM stubs
Quoted 10 lines · Philippe Mathieu-Daudé
Next patch will move s390x system objects from the target specific source set to the common one. Unfortunately the
kvm_enabled()macro won't be evaluable at built-time anymore. Add stubs for KVM symbols unreachable at runtime.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Acked-by Thomas Huth <[email protected]>--- target/s390x/kvm/stubs.c | 76 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-)
PATCH v2 7/9 target/s390x: Build system units in common source set
In reply to Philippe Mathieu-DaudéExcept the ioinst.c file which uses the TARGET_PAGE_SIZE definition in the ioinst_handle_chsc() method, all other files in meson's s390x_system_ss[] source set don't use any target-specific code. Moving them in the other s390x_common_system_ss[] set to build as common objects ensures these files won't use any target-specific API such target_ulong / TARGET_PAGE_SIZE, thus forcing to use the appropriate types instead (such vaddr, hwaddr, uint64_t, ...).
--- target/s390x/meson.build | 7 ++++++- target/s390x/tcg/meson.build | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-)
target/s390x/meson.build +6 -1
@@ -20,10 +20,14 @@ s390x_ss.add(gen_features_h) s390x_system_ss = ss.source_set() s390x_system_ss.add(files( + 'ioinst.c', +)) + +s390x_common_system_ss = ss.source_set() +s390x_common_system_ss.add(files( 'helper.c', 'arch_dump.c', 'diag.c', - 'ioinst.c', 'machine.c', 'mmu_helper.c', 'sigp.c',
@@ -41,4 +45,5 @@ subdir('kvm') target_arch += {'s390x': s390x_ss} target_system_arch += {'s390x': s390x_system_ss} +target_common_system_arch += {'s390x': s390x_common_system_ss} target_user_arch += {'s390x': s390x_user_ss}
target/s390x/tcg/meson.build +1 -1
@@ -12,6 +12,6 @@ s390x_ss.add(when: 'CONFIG_TCG', if_true: files( 'vec_int_helper.c', 'vec_string_helper.c', )) -s390x_system_ss.add(when: 'CONFIG_TCG', if_true: files( +s390x_common_system_ss.add(when: 'CONFIG_TCG', if_true: files( 'debug.c', ))
Signature · 1 line
2.52.0
Re: [PATCH v2 7/9] target/s390x: Build system units in common source set
Quoted 10 lines · Philippe Mathieu-Daudé
Except the
ioinst.cfile which uses theTARGET_PAGE_SIZEdefinition in theioinst_handle_chsc()method, all other files in meson's s390x_system_ss[] source set don't use any target-specific code. Moving them in the other s390x_common_system_ss[] set to build as common objects ensures these files won't use any target-specific API suchtarget_ulong/TARGET_PAGE_SIZE, thus forcing to use the appropriate types instead (such vaddr, hwaddr,uint64_t, ...).
Quoted 5 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/meson.build | 7 ++++++- target/s390x/tcg/meson.build | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-)
PATCH v2 8/9 target/s390x: Expand TCGv type as 64-bit target
In reply to Philippe Mathieu-DaudéThe s390x target is a 64-bit one, so TCGv expands to TCGv_i64. Use the latter which is already used about a hundred times in this file, and is also more explicit.
--- target/s390x/tcg/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
target/s390x/tcg/translate.c +3 -3
@@ -3142,7 +3142,7 @@ static DisasJumpType op_mov2(DisasContext *s, DisasOps *o)static DisasJumpType op_mov2e (DisasContext *s,DisasOps *o) {int b2 =get_field (s, b2); -TCGv ar1 =tcg_temp_new_i64 (); +TCGv_i64 ar1 =tcg_temp_new_i64 ();int r1 =get_field (s, r1); o->out = o->in2;
@@ -5743,9 +5743,9 @@ static void in2_a2(DisasContext *s, DisasOps *o) }#define SPEC_in2_a2 0 -static TCGv gen_ri2 (DisasContext *s) +static TCGv_i64 gen_ri2 (DisasContext *s) { -TCGv ri2 =NULL ; +TCGv_i64 ri2 =NULL ;bool is_imm;int imm;
Signature · 1 line
2.52.0
Re: [PATCH v2 8/9] target/s390x: Expand TCGv type as 64-bit target
Quoted 8 lines · Philippe Mathieu-Daudé
The s390x target is a 64-bit one, so TCGv expands to
TCGv_i64. Use the latter which is already used about a hundred times in this file, and is also more explicit.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/tcg/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
PATCH v2 9/9 target/s390x: Expand TCGv type as 64-bit target
In reply to Philippe Mathieu-DaudéThe s390x target is a 64-bit one, so we have these expansions in the "tcg/tcg-op.h" header:
. tcg_gen_qemu_ld_tl() -> tcg_gen_qemu_ld_i64()
. tcg_gen_qemu_st_tl() -> tcg_gen_qemu_st_i64()
Use the expanded form which is more explicit when a target isn't built for different words size.
--- target/s390x/tcg/translate.c | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-)
target/s390x/tcg/translate.c +27 -27
@@ -1259,7 +1259,7 @@ static DisasJumpType op_asi(DisasContext *s, DisasOps *o) o->in1 =tcg_temp_new_i64 ();if (non_atomic) { -tcg_gen_qemu_ld_tl (o->in1, o->addr1,get_mem_index (s), s->insn->data); +tcg_gen_qemu_ld_i64 (o->in1, o->addr1,get_mem_index (s), s->insn->data); }else {/* Perform the atomic addition in memory. */ tcg_gen_atomic_fetch_add_i64(o->in1, o->addr1, o->in2, get_mem_index(s),
@@ -1270,7 +1270,7 @@ static DisasJumpType op_asi(DisasContext *s, DisasOps *o)tcg_gen_add_i64 (o->out, o->in1, o->in2);if (non_atomic) { -tcg_gen_qemu_st_tl (o->out, o->addr1,get_mem_index (s), s->insn->data); +tcg_gen_qemu_st_i64 (o->out, o->addr1,get_mem_index (s), s->insn->data); }return DISAS_NEXT ; }
@@ -1281,7 +1281,7 @@ static DisasJumpType op_asiu64(DisasContext *s, DisasOps *o) o->in1 =tcg_temp_new_i64 ();if (non_atomic) { -tcg_gen_qemu_ld_tl (o->in1, o->addr1,get_mem_index (s), s->insn->data); +tcg_gen_qemu_ld_i64 (o->in1, o->addr1,get_mem_index (s), s->insn->data); }else {/* Perform the atomic addition in memory. */ tcg_gen_atomic_fetch_add_i64(o->in1, o->addr1, o->in2, get_mem_index(s),
@@ -1293,7 +1293,7 @@ static DisasJumpType op_asiu64(DisasContext *s, DisasOps *o)tcg_gen_add2_i64 (o->out, cc_src, o->in1, cc_src, o->in2, cc_src);if (non_atomic) { -tcg_gen_qemu_st_tl (o->out, o->addr1,get_mem_index (s), s->insn->data); +tcg_gen_qemu_st_i64 (o->out, o->addr1,get_mem_index (s), s->insn->data); }return DISAS_NEXT ; }
@@ -1374,7 +1374,7 @@ static DisasJumpType op_ni(DisasContext *s, DisasOps *o) o->in1 =tcg_temp_new_i64 ();if (!s390_has_feat (S390_FEAT_INTERLOCKED_ACCESS_2 )) { -tcg_gen_qemu_ld_tl (o->in1, o->addr1,get_mem_index (s), s->insn->data); +tcg_gen_qemu_ld_i64 (o->in1, o->addr1,get_mem_index (s), s->insn->data); }else {/* Perform the atomic operation in memory. */ tcg_gen_atomic_fetch_and_i64(o->in1, o->addr1, o->in2, get_mem_index(s),
@@ -1385,7 +1385,7 @@ static DisasJumpType op_ni(DisasContext *s, DisasOps *o)tcg_gen_and_i64 (o->out, o->in1, o->in2);if (!s390_has_feat (S390_FEAT_INTERLOCKED_ACCESS_2 )) { -tcg_gen_qemu_st_tl (o->out, o->addr1,get_mem_index (s), s->insn->data); +tcg_gen_qemu_st_i64 (o->out, o->addr1,get_mem_index (s), s->insn->data); }return DISAS_NEXT ; }
@@ -1917,8 +1917,8 @@ static DisasJumpType op_clc(DisasContext *s, DisasOps *o) mop =ctz32 (l +1 ) |MO_BE ;/* Do not update cc_src yet: loading cc_dst may cause an exception. */ src =tcg_temp_new_i64 (); -tcg_gen_qemu_ld_tl (src, o->addr1,get_mem_index (s), mop); -tcg_gen_qemu_ld_tl (cc_dst, o->in2,get_mem_index (s), mop); +tcg_gen_qemu_ld_i64 (src, o->addr1,get_mem_index (s), mop); +tcg_gen_qemu_ld_i64 (cc_dst, o->in2,get_mem_index (s), mop);gen_op_update2_cc_i64 (s,CC_OP_LTUGTU_64 , src, cc_dst);return DISAS_NEXT ;default :
@@ -2747,15 +2747,15 @@ static DisasJumpType op_ld16u(DisasContext *s, DisasOps *o)static DisasJumpType op_ld32s (DisasContext *s,DisasOps *o) { -tcg_gen_qemu_ld_tl (o->out, o->in2,get_mem_index (s), -MO_BESL | s->insn->data); +tcg_gen_qemu_ld_i64 (o->out, o->in2,get_mem_index (s), +MO_BESL | s->insn->data);return DISAS_NEXT ; }static DisasJumpType op_ld32u (DisasContext *s,DisasOps *o) { -tcg_gen_qemu_ld_tl (o->out, o->in2,get_mem_index (s), -MO_BEUL | s->insn->data); +tcg_gen_qemu_ld_i64 (o->out, o->in2,get_mem_index (s), +MO_BEUL | s->insn->data);return DISAS_NEXT ; }
@@ -3087,7 +3087,7 @@ static DisasJumpType op_lpq(DisasContext *s, DisasOps *o)#ifndef CONFIG_USER_ONLY static DisasJumpType op_lura (DisasContext *s,DisasOps *o) { -tcg_gen_qemu_ld_tl (o->out, o->in2,MMU_REAL_IDX , s->insn->data); +tcg_gen_qemu_ld_i64 (o->out, o->in2,MMU_REAL_IDX , s->insn->data);return DISAS_NEXT ; }#endif
@@ -3506,7 +3506,7 @@ static DisasJumpType op_oi(DisasContext *s, DisasOps *o) o->in1 =tcg_temp_new_i64 ();if (!s390_has_feat (S390_FEAT_INTERLOCKED_ACCESS_2 )) { -tcg_gen_qemu_ld_tl (o->in1, o->addr1,get_mem_index (s), s->insn->data); +tcg_gen_qemu_ld_i64 (o->in1, o->addr1,get_mem_index (s), s->insn->data); }else {/* Perform the atomic operation in memory. */ tcg_gen_atomic_fetch_or_i64(o->in1, o->addr1, o->in2, get_mem_index(s),
@@ -3517,7 +3517,7 @@ static DisasJumpType op_oi(DisasContext *s, DisasOps *o)tcg_gen_or_i64 (o->out, o->in1, o->in2);if (!s390_has_feat (S390_FEAT_INTERLOCKED_ACCESS_2 )) { -tcg_gen_qemu_st_tl (o->out, o->addr1,get_mem_index (s), s->insn->data); +tcg_gen_qemu_st_i64 (o->out, o->addr1,get_mem_index (s), s->insn->data); }return DISAS_NEXT ; }
@@ -4334,7 +4334,7 @@ static DisasJumpType op_stnosm(DisasContext *s, DisasOps *o)static DisasJumpType op_stura (DisasContext *s,DisasOps *o) { -tcg_gen_qemu_st_tl (o->in1, o->in2,MMU_REAL_IDX , s->insn->data); +tcg_gen_qemu_st_i64 (o->in1, o->in2,MMU_REAL_IDX , s->insn->data);if (s->base.tb->flags &FLAG_MASK_PER_STORE_REAL ) {update_cc_op (s);
@@ -4367,8 +4367,8 @@ static DisasJumpType op_st16(DisasContext *s, DisasOps *o)static DisasJumpType op_st32 (DisasContext *s,DisasOps *o) { -tcg_gen_qemu_st_tl (o->in1, o->in2,get_mem_index (s), -MO_BEUL | s->insn->data); +tcg_gen_qemu_st_i64 (o->in1, o->in2,get_mem_index (s), +MO_BEUL | s->insn->data);return DISAS_NEXT ; }
@@ -4836,7 +4836,7 @@ static DisasJumpType op_xi(DisasContext *s, DisasOps *o) o->in1 =tcg_temp_new_i64 ();if (!s390_has_feat (S390_FEAT_INTERLOCKED_ACCESS_2 )) { -tcg_gen_qemu_ld_tl (o->in1, o->addr1,get_mem_index (s), s->insn->data); +tcg_gen_qemu_ld_i64 (o->in1, o->addr1,get_mem_index (s), s->insn->data); }else {/* Perform the atomic operation in memory. */ tcg_gen_atomic_fetch_xor_i64(o->in1, o->addr1, o->in2, get_mem_index(s),
@@ -4847,7 +4847,7 @@ static DisasJumpType op_xi(DisasContext *s, DisasOps *o)tcg_gen_xor_i64 (o->out, o->in1, o->in2);if (!s390_has_feat (S390_FEAT_INTERLOCKED_ACCESS_2 )) { -tcg_gen_qemu_st_tl (o->out, o->addr1,get_mem_index (s), s->insn->data); +tcg_gen_qemu_st_i64 (o->out, o->addr1,get_mem_index (s), s->insn->data); }return DISAS_NEXT ; }
@@ -5291,7 +5291,7 @@ static void wout_m1_16(DisasContext *s, DisasOps *o)#ifndef CONFIG_USER_ONLY static void wout_m1_16a (DisasContext *s,DisasOps *o) { -tcg_gen_qemu_st_tl (o->out, o->addr1,get_mem_index (s),MO_BEUW |MO_ALIGN ); +tcg_gen_qemu_st_i64 (o->out, o->addr1,get_mem_index (s),MO_BEUW |MO_ALIGN ); }#define SPEC_wout_m1_16a 0#endif
@@ -5305,7 +5305,7 @@ static void wout_m1_32(DisasContext *s, DisasOps *o)#ifndef CONFIG_USER_ONLY static void wout_m1_32a (DisasContext *s,DisasOps *o) { -tcg_gen_qemu_st_tl (o->out, o->addr1,get_mem_index (s),MO_BEUL |MO_ALIGN ); +tcg_gen_qemu_st_i64 (o->out, o->addr1,get_mem_index (s),MO_BEUL |MO_ALIGN ); }#define SPEC_wout_m1_32a 0#endif
@@ -5816,7 +5816,7 @@ static void in2_m2_32u(DisasContext *s, DisasOps *o)static void in2_m2_32ua (DisasContext *s,DisasOps *o) {in2_a2 (s, o); -tcg_gen_qemu_ld_tl (o->in2, o->in2,get_mem_index (s),MO_BEUL |MO_ALIGN ); +tcg_gen_qemu_ld_i64 (o->in2, o->in2,get_mem_index (s),MO_BEUL |MO_ALIGN ); }#define SPEC_in2_m2_32ua 0#endif
@@ -5862,16 +5862,16 @@ static void in2_mri2_16u(DisasContext *s, DisasOps *o)static void in2_mri2_32s (DisasContext *s,DisasOps *o) { o->in2 =tcg_temp_new_i64 (); -tcg_gen_qemu_ld_tl (o->in2,gen_ri2 (s),get_mem_index (s), -MO_BESL |MO_ALIGN ); +tcg_gen_qemu_ld_i64 (o->in2,gen_ri2 (s),get_mem_index (s), +MO_BESL |MO_ALIGN ); }#define SPEC_in2_mri2_32s 0static void in2_mri2_32u (DisasContext *s,DisasOps *o) { o->in2 =tcg_temp_new_i64 (); -tcg_gen_qemu_ld_tl (o->in2,gen_ri2 (s),get_mem_index (s), -MO_BEUL |MO_ALIGN ); +tcg_gen_qemu_ld_i64 (o->in2,gen_ri2 (s),get_mem_index (s), +MO_BEUL |MO_ALIGN ); }#define SPEC_in2_mri2_32u 0
Signature · 1 line
2.52.0
Re: [PATCH v2 9/9] target/s390x: Expand TCGv type as 64-bit target
Quoted 6 lines · Philippe Mathieu-Daudé
The s390x target is a 64-bit one, so we have these expansions in the "
tcg/tcg-op.h" header:.
tcg_gen_qemu_ld_tl()->tcg_gen_qemu_ld_i64()
.tcg_gen_qemu_st_tl()->tcg_gen_qemu_st_i64()
Quoted 7 lines
Use the expanded form which is more explicit when a target isn't built for different words size.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/tcg/translate.c | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-)
Argh, $Subject ought to be:
"target/s390x: Expand tcg_gen_qemu_ld/st_tl() as 64-bit target"
Re: [PATCH v2 9/9] target/s390x: Expand TCGv type as 64-bit target
In reply to Philippe Mathieu-DaudéQuoted 6 lines · Philippe Mathieu-Daudé
The s390x target is a 64-bit one, so we have these expansions in the "
tcg/tcg-op.h" header:.
tcg_gen_qemu_ld_tl()->tcg_gen_qemu_ld_i64()
.tcg_gen_qemu_st_tl()->tcg_gen_qemu_st_i64()
Quoted 7 lines
Use the expanded form which is more explicit when a target isn't built for different words size.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/tcg/translate.c | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-)