* [Qemu-devel] [PATCH] target-s390x: Implement lpp instruction
@ 2017-02-24 13:50 Miroslav Benes
2017-02-24 23:51 ` Richard Henderson
0 siblings, 1 reply; 4+ messages in thread
From: Miroslav Benes @ 2017-02-24 13:50 UTC (permalink / raw)
To: rth, agraf; +Cc: qemu-devel, mmarek, ebischoff, 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.
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
---
target/s390x/insn-data.def | 2 ++
target/s390x/translate.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def
index be830a42ed8d..d6dd391fabeb 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 141167948ee8..eb9e13e59b7d 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,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;
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] target-s390x: Implement lpp instruction
2017-02-24 13:50 [Qemu-devel] [PATCH] target-s390x: Implement lpp instruction Miroslav Benes
@ 2017-02-24 23:51 ` Richard Henderson
2017-02-25 5:49 ` Thomas Huth
2017-02-27 8:51 ` Miroslav Benes
0 siblings, 2 replies; 4+ messages in thread
From: Richard Henderson @ 2017-02-24 23:51 UTC (permalink / raw)
To: Miroslav Benes, agraf; +Cc: qemu-devel, mmarek, ebischoff
On 02/25/2017 12:50 AM, 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>
> ---
I can't find LPP in my PoO 11th edition...
> +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~
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] target-s390x: Implement lpp instruction
2017-02-24 23:51 ` Richard Henderson
@ 2017-02-25 5:49 ` Thomas Huth
2017-02-27 8:51 ` Miroslav Benes
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2017-02-25 5:49 UTC (permalink / raw)
To: Richard Henderson, Miroslav Benes, agraf; +Cc: ebischoff, mmarek, qemu-devel
On 25.02.2017 00:51, Richard Henderson wrote:
> On 02/25/2017 12:50 AM, 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>
>> ---
>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] target-s390x: Implement lpp instruction
2017-02-24 23:51 ` Richard Henderson
2017-02-25 5:49 ` Thomas Huth
@ 2017-02-27 8:51 ` Miroslav Benes
1 sibling, 0 replies; 4+ messages in thread
From: Miroslav Benes @ 2017-02-27 8:51 UTC (permalink / raw)
To: Richard Henderson; +Cc: agraf, qemu-devel, mmarek, ebischoff
On Sat, 25 Feb 2017, Richard Henderson wrote:
> On 02/25/2017 12:50 AM, 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>
> > ---
>
> I can't find LPP in my PoO 11th edition...
>
> > +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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-27 8:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-24 13:50 [Qemu-devel] [PATCH] target-s390x: Implement lpp instruction Miroslav Benes
2017-02-24 23:51 ` Richard Henderson
2017-02-25 5:49 ` Thomas Huth
2017-02-27 8:51 ` Miroslav Benes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).