Skip to contentSkip to conversation

target-s390x: Implement lpp instruction

PATCH Superseded Miroslav Benes 3 participants 4 messages Feb 24, 2017 – Feb 27, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-s390x: Implement lpp instruction

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.

---
 target/s390x/insn-data.def |  2 ++
 target/s390x/translate.c   | 10 ++++++++++
 2 files changed, 12 insertions(+)
target/s390x/insn-data.def +2 -0
index be830a42ed8d..d6dd391fabeb 100644
@@ -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 */
target/s390x/translate.c +10 -0
index 141167948ee8..eb9e13e59b7d 100644
@@ -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,15 @@ static ExitStatus op_lra(DisasContext *s, DisasOps *o)
     return NO_EXIT;
 }
 
+static ExitStatus op_lpp(DisasContext *s, DisasOps *o)
+{
+    check_privileged(s);
+    potential_page_fault(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;
Signature · 1 line
2.11.0
#1 lore raw
Quoted 6 lines · Miroslav Benes

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.

---

I can't find LPP in my PoO 11th edition...

target/s390x/translate.c static ExitStatus op_lra(DisasContext *s, DisasOps *o) · line 2576

Quoted 6 lines
target/s390x/translate.c +6 -0
+static ExitStatus op_lpp(DisasContext *s, DisasOps *o)
+{
+    check_privileged(s);
+    potential_page_fault(s);
+
+    tcg_gen_st_i64(o->in2, cpu_env, offsetof(CPUS390XState, pp));

But you don't need the potential_page_fault, since this is not a store to guest memory.

r~

#2 lore raw
Quoted 9 lines · Richard Henderson
Quoted 6 lines · Miroslav Benes

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.

---

I can't find LPP in my PoO 11th edition...

LPP is one of the instructions that is documented separately. You can find its spec here, for example:

http://www-01.ibm.com/support/docview.wss?uid=isg26fcd1cc32246f4c8852574ce0044734a

Thomas

#3 lore raw
In reply to Richard Henderson
Quoted 10 lines · Richard Henderson
Quoted 6 lines · Miroslav Benes

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.

---

I can't find LPP in my PoO 11th edition...

Quoted 9 lines

target/s390x/translate.c static ExitStatus op_lra(DisasContext *s, DisasOps *o) · line 2576

Quoted 6 lines
target/s390x/translate.c +6 -0
+static ExitStatus op_lpp(DisasContext *s, DisasOps *o)
+{
+    check_privileged(s);
+    potential_page_fault(s);
+
+    tcg_gen_st_i64(o->in2, cpu_env, offsetof(CPUS390XState, pp));

But you don't need the potential_page_fault, since this is not a store to guest memory.

Right. I got confused by Access Program Exception in the spec. Sending v2.

Thanks for the review!

Miroslav