qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 2.2 0/2] s390 patch queue 2014-11-05 for 2.2
@ 2014-11-05  9:56 Alexander Graf
  2014-11-05  9:56 ` [Qemu-devel] [PULL 1/2] s390x: Fix sclp console input Alexander Graf
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexander Graf @ 2014-11-05  9:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, kbastian, rth

Hi Peter,

This is my current patch queue for s390.  Please pull.

Alex


The following changes since commit d5b4dc3b50175f0c34f3cf4b053e123fb37f5aed:

  Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging (2014-11-04 17:33:34 +0000)

are available in the git repository at:


  git://github.com/agraf/qemu.git tags/signed-s390-for-upstream

for you to fetch changes up to ab6b1c0a36b23e3e8c47c00fb6c9931de957f608:

  s390x: Implement SAM{24,31,64} (2014-11-05 10:54:28 +0100)

----------------------------------------------------------------
Patch queue for s390 - 2014-11-05

Two simple bug fixes to enable slightly newer guest kernels
and preliminary -M s390-ccw support for TCG (virtio doesn't work yet!)

----------------------------------------------------------------
Alexander Graf (2):
      s390x: Fix sclp console input
      s390x: Implement SAM{24,31,64}

 target-s390x/insn-data.def |  6 +++---
 target-s390x/interrupt.c   |  2 --
 target-s390x/translate.c   | 12 ++++++++++++
 3 files changed, 15 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 1/2] s390x: Fix sclp console input
  2014-11-05  9:56 [Qemu-devel] [PULL 2.2 0/2] s390 patch queue 2014-11-05 for 2.2 Alexander Graf
@ 2014-11-05  9:56 ` Alexander Graf
  2014-11-05  9:56 ` [Qemu-devel] [PULL 2/2] s390x: Implement SAM{24,31,64} Alexander Graf
  2014-11-05 15:15 ` [Qemu-devel] [PULL 2.2 0/2] s390 patch queue 2014-11-05 for 2.2 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2014-11-05  9:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, kbastian, rth

When injecting an sclp console interrupt into the guest, we increase
the PC by 4 for some reason. I have no idea why I put that code there,
but it's clearly wrong. Remove the increment.

This patch fixes sclp serial input for the ccw machine.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 target-s390x/interrupt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target-s390x/interrupt.c b/target-s390x/interrupt.c
index 23a9114..1404d0a 100644
--- a/target-s390x/interrupt.c
+++ b/target-s390x/interrupt.c
@@ -22,9 +22,7 @@ void s390_sclp_extint(uint32_t parm)
         kvm_s390_service_interrupt(parm);
     } else {
         S390CPU *dummy_cpu = s390_cpu_addr2state(0);
-        CPUS390XState *env = &dummy_cpu->env;
 
-        env->psw.addr += 4;
         cpu_inject_ext(dummy_cpu, EXT_SERVICE, parm, 0);
     }
 }
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 2/2] s390x: Implement SAM{24,31,64}
  2014-11-05  9:56 [Qemu-devel] [PULL 2.2 0/2] s390 patch queue 2014-11-05 for 2.2 Alexander Graf
  2014-11-05  9:56 ` [Qemu-devel] [PULL 1/2] s390x: Fix sclp console input Alexander Graf
@ 2014-11-05  9:56 ` Alexander Graf
  2014-11-05 15:15 ` [Qemu-devel] [PULL 2.2 0/2] s390 patch queue 2014-11-05 for 2.2 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2014-11-05  9:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, kbastian, rth

The SAM instructions simply change 2 bits in PSW.MASK to advertise
the current memory mode. While we can't fully guarantee that 31 bit
mode (or even remotely 24 bit mode) actually work correctly, we don't
check whether lpswe modifies these bits, so we shouldn't keep the
guest from executing SAM instructions either.

This patch implements all SAM instrutions with their actual PSW changing
semantics, making more recent Linux kernels boot properly which do issue
a SAM31 call during early boot.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 target-s390x/insn-data.def |  6 +++---
 target-s390x/translate.c   | 12 ++++++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def
index b42ebb6..4d2feb6 100644
--- a/target-s390x/insn-data.def
+++ b/target-s390x/insn-data.def
@@ -744,9 +744,9 @@
 /* SERVICE CALL LOGICAL PROCESSOR (PV hypercall) */
     C(0xb220, SERVC,   RRE,   Z,   r1_o, r2_o, 0, 0, servc, 0)
 /* SET ADDRESSING MODE */
-    /* We only do 64-bit, so accept this as a no-op.
-       Let SAM24 and SAM31 signal illegal instruction.  */
-    C(0x010e, SAM64,   E,     Z,   0, 0, 0, 0, 0, 0)
+    D(0x010c, SAM24,   E,     Z,   0, 0, 0, 0, sam, 0, 0)
+    D(0x010d, SAM31,   E,     Z,   0, 0, 0, 0, sam, 0, 1)
+    D(0x010e, SAM64,   E,     Z,   0, 0, 0, 0, sam, 0, 3)
 /* SET ADDRESS SPACE CONTROL FAST */
     C(0xb279, SACF,    S,     Z,   0, a2, 0, 0, sacf, 0)
 /* SET CLOCK */
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index 0cb036f..827cda4 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -2927,6 +2927,18 @@ static ExitStatus op_sacf(DisasContext *s, DisasOps *o)
 }
 #endif
 
+static ExitStatus op_sam(DisasContext *s, DisasOps *o)
+{
+    int sam = s->insn->data;
+    TCGv_i64 tsam = tcg_const_i64(sam);
+
+    /* Overwrite PSW_MASK_64 and PSW_MASK_32 */
+    tcg_gen_deposit_i64(psw_mask, psw_mask, tsam, 31, 2);
+
+    tcg_temp_free_i64(tsam);
+    return EXIT_PC_STALE;
+}
+
 static ExitStatus op_sar(DisasContext *s, DisasOps *o)
 {
     int r1 = get_field(s->fields, r1);
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 2.2 0/2] s390 patch queue 2014-11-05 for 2.2
  2014-11-05  9:56 [Qemu-devel] [PULL 2.2 0/2] s390 patch queue 2014-11-05 for 2.2 Alexander Graf
  2014-11-05  9:56 ` [Qemu-devel] [PULL 1/2] s390x: Fix sclp console input Alexander Graf
  2014-11-05  9:56 ` [Qemu-devel] [PULL 2/2] s390x: Implement SAM{24,31,64} Alexander Graf
@ 2014-11-05 15:15 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2014-11-05 15:15 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Bastian Koppelmann, QEMU Developers, Richard Henderson

On 5 November 2014 09:56, Alexander Graf <agraf@suse.de> wrote:
> Hi Peter,
>
> This is my current patch queue for s390.  Please pull.
>
> Alex
>
>
> The following changes since commit d5b4dc3b50175f0c34f3cf4b053e123fb37f5aed:
>
>   Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging (2014-11-04 17:33:34 +0000)
>
> are available in the git repository at:
>
>
>   git://github.com/agraf/qemu.git tags/signed-s390-for-upstream
>
> for you to fetch changes up to ab6b1c0a36b23e3e8c47c00fb6c9931de957f608:
>
>   s390x: Implement SAM{24,31,64} (2014-11-05 10:54:28 +0100)
>
> ----------------------------------------------------------------
> Patch queue for s390 - 2014-11-05
>
> Two simple bug fixes to enable slightly newer guest kernels
> and preliminary -M s390-ccw support for TCG (virtio doesn't work yet!)
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-05 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05  9:56 [Qemu-devel] [PULL 2.2 0/2] s390 patch queue 2014-11-05 for 2.2 Alexander Graf
2014-11-05  9:56 ` [Qemu-devel] [PULL 1/2] s390x: Fix sclp console input Alexander Graf
2014-11-05  9:56 ` [Qemu-devel] [PULL 2/2] s390x: Implement SAM{24,31,64} Alexander Graf
2014-11-05 15:15 ` [Qemu-devel] [PULL 2.2 0/2] s390 patch queue 2014-11-05 for 2.2 Peter Maydell

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).