All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Thomas Huth <thuth@linux.vnet.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Jens Freimann <jfrei@linux.vnet.ibm.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PULL 21/29] s390x/ioinst: Rework memory access in SSCH instruction
Date: Wed, 18 Feb 2015 21:22:15 +0100	[thread overview]
Message-ID: <1424290943-22480-22-git-send-email-borntraeger@de.ibm.com> (raw)
In-Reply-To: <1424290943-22480-1-git-send-email-borntraeger@de.ibm.com>

From: Thomas Huth <thuth@linux.vnet.ibm.com>

Change the handler for SSCH to use the new logical memory
access functions.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 target-s390x/ioinst.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c
index 1569df6..0ef7a93 100644
--- a/target-s390x/ioinst.c
+++ b/target-s390x/ioinst.c
@@ -210,11 +210,10 @@ void ioinst_handle_ssch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
 {
     int cssid, ssid, schid, m;
     SubchDev *sch;
-    ORB *orig_orb, orb;
+    ORB orig_orb, orb;
     uint64_t addr;
     int ret = -ENODEV;
     int cc;
-    hwaddr len = sizeof(*orig_orb);
     CPUS390XState *env = &cpu->env;
 
     addr = decode_basedisp_s(env, ipb);
@@ -222,16 +221,14 @@ void ioinst_handle_ssch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
         program_interrupt(env, PGM_SPECIFICATION, 2);
         return;
     }
-    orig_orb = s390_cpu_physical_memory_map(env, addr, &len, 0);
-    if (!orig_orb || len != sizeof(*orig_orb)) {
-        program_interrupt(env, PGM_ADDRESSING, 2);
-        goto out;
+    if (s390_cpu_virt_mem_read(cpu, addr, &orig_orb, sizeof(orb))) {
+        return;
     }
-    copy_orb_from_guest(&orb, orig_orb);
+    copy_orb_from_guest(&orb, &orig_orb);
     if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid) ||
         !ioinst_orb_valid(&orb)) {
         program_interrupt(env, PGM_OPERAND, 2);
-        goto out;
+        return;
     }
     trace_ioinst_sch_id("ssch", cssid, ssid, schid);
     sch = css_find_subch(m, cssid, ssid, schid);
@@ -253,9 +250,6 @@ void ioinst_handle_ssch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
         break;
     }
     setcc(cpu, cc);
-
-out:
-    s390_cpu_physical_memory_unmap(env, orig_orb, len, 0);
 }
 
 void ioinst_handle_stcrw(S390CPU *cpu, uint32_t ipb)
-- 
1.9.3

  parent reply	other threads:[~2015-02-18 20:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 20:21 [Qemu-devel] [PULL 00/29] s390x guest reipl and page table handling Christian Borntraeger
2015-02-18 20:21 ` [Qemu-devel] [PULL 01/29] s390x/ipl: always load the bios for ccw machine Christian Borntraeger
2015-02-18 20:21 ` [Qemu-devel] [PULL 02/29] s390x/ipl: support diagnose 308 subcodes 5 and 6 Christian Borntraeger
2015-03-19  9:31   ` Paolo Bonzini
2015-03-20  8:25     ` Christian Borntraeger
2015-02-18 20:21 ` [Qemu-devel] [PULL 03/29] s390x/ipl: drop reipl parameters on resets Christian Borntraeger
2015-02-18 20:21 ` [Qemu-devel] [PULL 04/29] s390x/ipl: make s390x ipl device aware of migration Christian Borntraeger
2015-02-18 20:21 ` [Qemu-devel] [PULL 05/29] s390x/mmu: Move mmu_translate() and friends to separate file Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 06/29] s390x/mmu: Fix the check for the real-space designation bit Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 07/29] s390x/mmu: Fix the handling of the table levels Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 08/29] s390x/mmu: Check table length and offset fields Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 09/29] s390x/mmu: Skip exceptions properly when translating addresses for debug Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 10/29] s390x/mmu: Fix translation exception code in lowcore Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 11/29] s390x/mmu: Fix exception types when checking the ASCEs Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 12/29] s390x/mmu: Fix the exception codes for illegal table entries Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 13/29] s390x/mmu: Add support for read-only regions Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 14/29] s390x/mmu: Renaming related to the ASCE confusion Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 15/29] s390x/mmu: Check bit 52 in page table entry Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 16/29] s390x/mmu: Clean up mmu_translate_asc() Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 17/29] s390x/kvm: Add function for injecting pgm access exceptions Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 18/29] s390x/mmu: Add function for accessing guest memory Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 19/29] s390x/css: Make schib parameter of css_do_msch const Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 20/29] s390x/ioinst: Rework memory access in MSCH instruction Christian Borntraeger
2015-02-18 20:22 ` Christian Borntraeger [this message]
2015-02-18 20:22 ` [Qemu-devel] [PULL 22/29] s390x/ioinst: Rework memory access in STSCH instruction Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 23/29] s390x/ioinst: Set condition code in ioinst_handle_tsch() handler Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 24/29] s390x/ioinst: Rework memory access in TSCH instruction Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 25/29] s390x/ioinst: Rework memory access in STCRW instruction Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 26/29] s390x/ioinst: Rework memory access in CHSC instruction Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 27/29] s390x/ioinst: Rework memory access in TPI instruction Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 28/29] s390x/pci: Rework memory access in zpci instruction Christian Borntraeger
2015-02-18 20:22 ` [Qemu-devel] [PULL 29/29] s390x/helper: Remove s390_cpu_physical_memory_map Christian Borntraeger
2015-02-26 10:28 ` [Qemu-devel] [PULL 00/29] s390x guest reipl and page table handling Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424290943-22480-22-git-send-email-borntraeger@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=cornelia.huck@de.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.