From: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
Thomas Huth <thuth@redhat.com>
Cc: Nina Schoetterl-Glausch <nsg@linux.ibm.com>,
David Hildenbrand <david@redhat.com>,
kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [kvm-unit-tests PATCH v3 0/3] s390x: Add misaligned instruction tests
Date: Wed, 15 Mar 2023 16:54:41 +0100 [thread overview]
Message-ID: <20230315155445.1688249-1-nsg@linux.ibm.com> (raw)
Instructions on s390 must be halfword aligned.
Add two tests for that.
These currently fail when using TCG.
v3 -> v2:
* pick up R-b (thanks Janosch)
* use br instead of bcr (thanks Claudio)
* use text section instead of rodata for ex target (thanks Claudio)
* fix label position (thanks Claudio)
v1 -> v2:
* rebase
* use PSW macros
* simplify odd psw test (thanks Claudio)
* rename some identifiers
* pick up R-b (thanks Claudio)
Nina Schoetterl-Glausch (3):
s390x/spec_ex: Use PSW macro
s390x/spec_ex: Add test introducing odd address into PSW
s390x/spec_ex: Add test of EXECUTE with odd target address
s390x/spec_ex.c | 85 +++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 76 insertions(+), 9 deletions(-)
Range-diff against v2:
1: d82f4fb6 ! 1: 6ae1eb7d s390x/spec_ex: Use PSW macro
@@ Commit message
Replace explicit psw definition by PSW macro.
No functional change intended.
+ Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
## s390x/spec_ex.c ##
2: e537797f ! 2: a0d02438 s390x/spec_ex: Add test introducing odd address into PSW
@@ s390x/spec_ex.c: static int psw_bit_12_is_1(void)
+" . = . + 1\n"
+"misaligned_code:\n"
+" larl %r0,0\n"
-+" bcr 0xf,%r1\n"
++" br %r1\n"
+);
+
+static int psw_odd_address(void)
3: dc552880 ! 3: e771deeb s390x/spec_ex: Add test of EXECUTE with odd target address
@@ s390x/spec_ex.c: static int short_psw_bit_12_is_0(void)
+ uint64_t pre_target_addr;
+ int to = 0, from = 0x0dd;
+
-+ asm volatile ( ".pushsection .rodata\n"
-+ "pre_odd_ex_target:\n"
++ asm volatile ( ".pushsection .text.ex_odd\n"
+ " .balign 2\n"
++ "pre_odd_ex_target:\n"
+ " . = . + 1\n"
+ " lr %[to],%[from]\n"
+ " .popsection\n"
base-commit: e3c5c3ef2524c58023073c0fadde2e8ae3c04ec6
--
2.39.1
next reply other threads:[~2023-03-15 15:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 15:54 Nina Schoetterl-Glausch [this message]
2023-03-15 15:54 ` [kvm-unit-tests PATCH v3 1/3] s390x/spec_ex: Use PSW macro Nina Schoetterl-Glausch
2023-03-15 15:54 ` [kvm-unit-tests PATCH v3 2/3] s390x/spec_ex: Add test introducing odd address into PSW Nina Schoetterl-Glausch
2023-03-17 9:26 ` Janosch Frank
2023-03-17 10:51 ` Nina Schoetterl-Glausch
2023-03-17 12:21 ` Janosch Frank
2023-03-15 15:54 ` [kvm-unit-tests PATCH v3 3/3] s390x/spec_ex: Add test of EXECUTE with odd target address Nina Schoetterl-Glausch
2023-03-17 9:51 ` Janosch Frank
2023-03-17 14:09 ` Thomas Huth
2023-03-17 14:11 ` Thomas Huth
2023-03-17 15:36 ` Claudio Imbrenda
2023-03-17 16:37 ` Thomas Huth
2023-03-20 12:21 ` Janosch Frank
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230315155445.1688249-1-nsg@linux.ibm.com \
--to=nsg@linux.ibm.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox