* [Qemu-devel] [PATCH 0/2] s390x: virtio-less ccw target enablement @ 2014-11-04 12:21 Alexander Graf 2014-11-04 12:21 ` [Qemu-devel] [PATCH 1/2] s390x: Fix sclp console input Alexander Graf 2014-11-04 12:21 ` [Qemu-devel] [PATCH 2/2] s390x: Ignore sam31 Alexander Graf 0 siblings, 2 replies; 6+ messages in thread From: Alexander Graf @ 2014-11-04 12:21 UTC (permalink / raw) To: rth; +Cc: kbastian, qemu-devel Hi, With these two patches I'm able to boot a kernel with -M s390-ccw and TCG. So far the actual CCW instruction interpretation is missing, so it won't get any further than an initrd, but at least it's a start ;). Alex Alexander Graf (2): s390x: Fix sclp console input s390x: Ignore sam31 target-s390x/insn-data.def | 4 +++- target-s390x/interrupt.c | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) -- 1.7.12.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 1/2] s390x: Fix sclp console input 2014-11-04 12:21 [Qemu-devel] [PATCH 0/2] s390x: virtio-less ccw target enablement Alexander Graf @ 2014-11-04 12:21 ` Alexander Graf 2014-11-04 19:05 ` Bastian Koppelmann 2014-11-04 12:21 ` [Qemu-devel] [PATCH 2/2] s390x: Ignore sam31 Alexander Graf 1 sibling, 1 reply; 6+ messages in thread From: Alexander Graf @ 2014-11-04 12:21 UTC (permalink / raw) To: rth; +Cc: kbastian, qemu-devel 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> --- 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] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] s390x: Fix sclp console input 2014-11-04 12:21 ` [Qemu-devel] [PATCH 1/2] s390x: Fix sclp console input Alexander Graf @ 2014-11-04 19:05 ` Bastian Koppelmann 0 siblings, 0 replies; 6+ messages in thread From: Bastian Koppelmann @ 2014-11-04 19:05 UTC (permalink / raw) To: Alexander Graf, rth; +Cc: qemu-devel On 11/04/2014 12:21 PM, Alexander Graf wrote: > 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> > --- > 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); > } > } Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 2/2] s390x: Ignore sam31 2014-11-04 12:21 [Qemu-devel] [PATCH 0/2] s390x: virtio-less ccw target enablement Alexander Graf 2014-11-04 12:21 ` [Qemu-devel] [PATCH 1/2] s390x: Fix sclp console input Alexander Graf @ 2014-11-04 12:21 ` Alexander Graf 2014-11-04 18:40 ` Bastian Koppelmann 1 sibling, 1 reply; 6+ messages in thread From: Alexander Graf @ 2014-11-04 12:21 UTC (permalink / raw) To: rth; +Cc: kbastian, qemu-devel The SAM31 instruction switches the memory model to 31bit. Linux uses it on bootup, so we have to implement it. We only really model the 64bit memory model though, so we can nop it, cross our fingers and hope for the guest to not rely on 32bit wrap semantics. Signed-off-by: Alexander Graf <agraf@suse.de> --- target-s390x/insn-data.def | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def index b42ebb6..4cc2da4 100644 --- a/target-s390x/insn-data.def +++ b/target-s390x/insn-data.def @@ -744,8 +744,10 @@ /* SERVICE CALL LOGICAL PROCESSOR (PV hypercall) */ C(0xb220, SERVC, RRE, Z, r1_o, r2_o, 0, 0, servc, 0) /* SET ADDRESSING MODE */ + /* We have to nop SAM31, it is used by early Linux bootup */ + C(0x010d, SAM31, E, Z, 0, 0, 0, 0, 0, 0) /* We only do 64-bit, so accept this as a no-op. - Let SAM24 and SAM31 signal illegal instruction. */ + Let SAM24 signal illegal instruction. */ C(0x010e, SAM64, E, Z, 0, 0, 0, 0, 0, 0) /* SET ADDRESS SPACE CONTROL FAST */ C(0xb279, SACF, S, Z, 0, a2, 0, 0, sacf, 0) -- 1.7.12.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] s390x: Ignore sam31 2014-11-04 12:21 ` [Qemu-devel] [PATCH 2/2] s390x: Ignore sam31 Alexander Graf @ 2014-11-04 18:40 ` Bastian Koppelmann 2014-11-04 19:06 ` Alexander Graf 0 siblings, 1 reply; 6+ messages in thread From: Bastian Koppelmann @ 2014-11-04 18:40 UTC (permalink / raw) To: Alexander Graf, rth; +Cc: qemu-devel Hi Alex, I'm not really happy with that. A brief look into the instruction manual shows, that modal instructions have different outputs depending on the addressing mode. On the long run it would be better to implement this. That said I'm not an expert on s390x and there is a reason we're only doing 64-bit. Thanks, Bastian On 11/04/2014 12:21 PM, Alexander Graf wrote: > The SAM31 instruction switches the memory model to 31bit. Linux uses > it on bootup, so we have to implement it. We only really model the 64bit > memory model though, so we can nop it, cross our fingers and hope for > the guest to not rely on 32bit wrap semantics. > > Signed-off-by: Alexander Graf <agraf@suse.de> > --- > target-s390x/insn-data.def | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def > index b42ebb6..4cc2da4 100644 > --- a/target-s390x/insn-data.def > +++ b/target-s390x/insn-data.def > @@ -744,8 +744,10 @@ > /* SERVICE CALL LOGICAL PROCESSOR (PV hypercall) */ > C(0xb220, SERVC, RRE, Z, r1_o, r2_o, 0, 0, servc, 0) > /* SET ADDRESSING MODE */ > + /* We have to nop SAM31, it is used by early Linux bootup */ > + C(0x010d, SAM31, E, Z, 0, 0, 0, 0, 0, 0) > /* We only do 64-bit, so accept this as a no-op. > - Let SAM24 and SAM31 signal illegal instruction. */ > + Let SAM24 signal illegal instruction. */ > C(0x010e, SAM64, E, Z, 0, 0, 0, 0, 0, 0) > /* SET ADDRESS SPACE CONTROL FAST */ > C(0xb279, SACF, S, Z, 0, a2, 0, 0, sacf, 0) ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] s390x: Ignore sam31 2014-11-04 18:40 ` Bastian Koppelmann @ 2014-11-04 19:06 ` Alexander Graf 0 siblings, 0 replies; 6+ messages in thread From: Alexander Graf @ 2014-11-04 19:06 UTC (permalink / raw) To: Bastian Koppelmann, rth; +Cc: qemu-devel On 04.11.14 19:40, Bastian Koppelmann wrote: > Hi Alex, > > I'm not really happy with that. A brief look into the instruction manual > shows, that modal instructions have different outputs depending on the > addressing mode. On the long run it would be better to implement this. > That said I'm not an expert on s390x and there is a reason we're only > doing 64-bit. IIRC we even do support 31bit mode - we merely would need to set the respective PSW bit :). I'll give that a try. Alex ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-11-04 19:06 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-11-04 12:21 [Qemu-devel] [PATCH 0/2] s390x: virtio-less ccw target enablement Alexander Graf 2014-11-04 12:21 ` [Qemu-devel] [PATCH 1/2] s390x: Fix sclp console input Alexander Graf 2014-11-04 19:05 ` Bastian Koppelmann 2014-11-04 12:21 ` [Qemu-devel] [PATCH 2/2] s390x: Ignore sam31 Alexander Graf 2014-11-04 18:40 ` Bastian Koppelmann 2014-11-04 19:06 ` Alexander Graf
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).