[Qemu-devel] [PATCH v2] target-s390x: Implement lpp instruction

Miroslav Benes posted 1 patch 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170227085353.20787-1-mbenes@suse.cz
Test checkpatch passed
Test docker passed
Test s390x passed
target/s390x/insn-data.def | 2 ++
target/s390x/translate.c   | 9 +++++++++
2 files changed, 11 insertions(+)
[Qemu-devel] [PATCH v2] target-s390x: Implement lpp instruction
Posted by Miroslav Benes 7 years ago
Linux arch/s390/kernel/head(64).S uses lpp instruction if it is
available in facilities list provided by stfl/stfle instruction. This is
the case of newer z/System generations and their qemu definition.

Signed-off-by: Miroslav Benes <mbenes@suse.cz>
---
v2
- remove potential_page_fault()

 target/s390x/insn-data.def | 2 ++
 target/s390x/translate.c   | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def
index 075ff597c3de..880b0403cb5e 100644
--- a/target/s390x/insn-data.def
+++ b/target/s390x/insn-data.def
@@ -843,6 +843,8 @@
 /* LOAD CONTROL */
     C(0xb700, LCTL,    RS_a,  Z,   0, a2, 0, 0, lctl, 0)
     C(0xeb2f, LCTLG,   RSY_a, Z,   0, a2, 0, 0, lctlg, 0)
+/* LOAD PROGRAM PARAMETER */
+    C(0xb280, LPP,     S,   LPP,   0, m2_64, 0, 0, lpp, 0)
 /* LOAD PSW */
     C(0x8200, LPSW,    S,     Z,   0, a2, 0, 0, lpsw, 0)
 /* LOAD PSW EXTENDED */
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index 01c62176bf70..3032d495dcf8 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -1194,6 +1194,7 @@ typedef enum DisasFacility {
     FAC_SCF,                /* store clock fast */
     FAC_SFLE,               /* store facility list extended */
     FAC_ILA,                /* interlocked access facility 1 */
+    FAC_LPP,                /* load-program-parameter */
 } DisasFacility;
 
 struct DisasInsn {
@@ -2567,6 +2568,14 @@ static ExitStatus op_lra(DisasContext *s, DisasOps *o)
     return NO_EXIT;
 }
 
+static ExitStatus op_lpp(DisasContext *s, DisasOps *o)
+{
+    check_privileged(s);
+
+    tcg_gen_st_i64(o->in2, cpu_env, offsetof(CPUS390XState, pp));
+    return NO_EXIT;
+}
+
 static ExitStatus op_lpsw(DisasContext *s, DisasOps *o)
 {
     TCGv_i64 t1, t2;
-- 
2.11.0


Re: [Qemu-devel] [PATCH v2] target-s390x: Implement lpp instruction
Posted by Richard Henderson 7 years ago
On 02/27/2017 07:53 PM, Miroslav Benes wrote:
> Linux arch/s390/kernel/head(64).S uses lpp instruction if it is
> available in facilities list provided by stfl/stfle instruction. This is
> the case of newer z/System generations and their qemu definition.
>
> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
> ---
> v2
> - remove potential_page_fault()
>
>  target/s390x/insn-data.def | 2 ++
>  target/s390x/translate.c   | 9 +++++++++
>  2 files changed, 11 insertions(+)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~