[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/24] target/s390x: Handle EXECUTE of odd addresses
From: |
Thomas Huth |
Subject: |
[PULL 10/24] target/s390x: Handle EXECUTE of odd addresses |
Date: |
Mon, 20 Mar 2023 14:03:16 +0100 |
From: Ilya Leoshkevich <iii@linux.ibm.com>
Generate a specification exception in the helper before trying to fetch
the instruction.
Reported-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230316164428.275147-3-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/s390x/tcg/mem_helper.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c
index 00afae2b64..96b8ef61b5 100644
--- a/target/s390x/tcg/mem_helper.c
+++ b/target/s390x/tcg/mem_helper.c
@@ -2468,8 +2468,16 @@ void HELPER(stpq_parallel)(CPUS390XState *env, uint64_t
addr,
*/
void HELPER(ex)(CPUS390XState *env, uint32_t ilen, uint64_t r1, uint64_t addr)
{
- uint64_t insn = cpu_lduw_code(env, addr);
- uint8_t opc = insn >> 8;
+ uint64_t insn;
+ uint8_t opc;
+
+ /* EXECUTE targets must be at even addresses. */
+ if (addr & 1) {
+ tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC());
+ }
+
+ insn = cpu_lduw_code(env, addr);
+ opc = insn >> 8;
/* Or in the contents of R1[56:63]. */
insn |= r1 & 0xff;
--
2.31.1
- [PULL 00/24] s390x and misc patches for 8.0-rc1, Thomas Huth, 2023/03/20
- [PULL 05/24] target/s390x: Fix R[NOX]SBG with T=1, Thomas Huth, 2023/03/20
- [PULL 04/24] tests/tcg/s390x: Add PSW modification tests, Thomas Huth, 2023/03/20
- [PULL 01/24] MAINTAINERS: Mark the Nios II CPU as orphan, Thomas Huth, 2023/03/20
- [PULL 07/24] target/s390x: Fix EXECUTE of relative long instructions, Thomas Huth, 2023/03/20
- [PULL 06/24] tests/tcg/s390x: Add rxsbg.c, Thomas Huth, 2023/03/20
- [PULL 09/24] target/s390x: Handle branching to odd addresses, Thomas Huth, 2023/03/20
- [PULL 08/24] tests/tcg/s390x: Add ex-relative-long.c, Thomas Huth, 2023/03/20
- [PULL 10/24] target/s390x: Handle EXECUTE of odd addresses,
Thomas Huth <=
- [PULL 13/24] target/s390x: Handle LLGFRL from non-aligned addresses, Thomas Huth, 2023/03/20
- [PULL 11/24] target/s390x: Handle LGRL from non-aligned addresses, Thomas Huth, 2023/03/20
- [PULL 12/24] target/s390x: Handle LRL and LGFRL from non-aligned addresses, Thomas Huth, 2023/03/20
- [PULL 15/24] target/s390x: Handle CGRL and CLGRL with non-aligned addresses, Thomas Huth, 2023/03/20
- [PULL 02/24] target/s390x: Fix LPSW, Thomas Huth, 2023/03/20
- [PULL 14/24] target/s390x: Handle CRL and CGFRL with non-aligned addresses, Thomas Huth, 2023/03/20
- [PULL 21/24] target/s390x/tcg/mem_helper: Remove bad assert() statement, Thomas Huth, 2023/03/20
- [PULL 03/24] target/s390x: Implement Early Exception Recognition, Thomas Huth, 2023/03/20
- [PULL 20/24] tests/tcg/s390x: Test unaligned accesses, Thomas Huth, 2023/03/20
- [PULL 19/24] target/s390x: Update do_unaligned_access() comment, Thomas Huth, 2023/03/20