All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: peter.maydell@linaro.org
Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
	borntraeger@de.ibm.com, rth@twiddle.net, agraf@suse.de,
	david@redhat.com, thuth@redhat.com,
	Cornelia Huck <cohuck@redhat.com>
Subject: [Qemu-devel] [PULL v2 27/27] s390x/tcg: fix loading 31bit PSWs with the highest bit set
Date: Thu,  1 Mar 2018 14:02:01 +0100	[thread overview]
Message-ID: <20180301130201.24666-28-cohuck@redhat.com> (raw)
In-Reply-To: <20180301130201.24666-1-cohuck@redhat.com>

From: David Hildenbrand <david@redhat.com>

Let's also put the 31-bit hack in front of the REAL MMU, otherwise right
now we get errors when loading a PSW where the highest bit is set (e.g.
via s390-netboot.img). The highest bit is not masked away, therefore we
inject addressing exceptions into the guest.

The proper fix will later be to do all address wrapping before accessing
the MMU - so we won't get any "wrong" entries in there (which makes
flushing also easier). But that will require more work (wrapping in
load_psw, wrapping when incrementing the PC, wrapping every memory
access).

This fixes the tests/pxe-test test.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180301120826.6847-1-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 target/s390x/excp_helper.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c
index 411051edc3..dfee221111 100644
--- a/target/s390x/excp_helper.c
+++ b/target/s390x/excp_helper.c
@@ -107,6 +107,10 @@ int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_vaddr, int size,
             return 1;
         }
     } else if (mmu_idx == MMU_REAL_IDX) {
+        /* 31-Bit mode */
+        if (!(env->psw.mask & PSW_MASK_64)) {
+            vaddr &= 0x7fffffff;
+        }
         if (mmu_translate_real(env, vaddr, rw, &raddr, &prot)) {
             return 1;
         }
-- 
2.13.6

  parent reply	other threads:[~2018-03-01 13:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 13:01 [Qemu-devel] [PULL v2 00/27] s390x updates (and friends) Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 01/27] s390-ccw: refactor boot map table code Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 02/27] s390-ccw: refactor eckd_block_num to use CHS Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 03/27] s390-ccw: refactor IPL structs Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 04/27] s390-ccw: update libc Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 05/27] s390-ccw: move auxiliary IPL data to separate location Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 06/27] s390-ccw: parse and set boot menu options Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 07/27] s390-ccw: set up interactive boot menu parameters Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 08/27] s390-ccw: read stage2 boot loader data to find menu Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 09/27] s390-ccw: print zipl boot menu Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 10/27] s390-ccw: read user input for boot index via the SCLP console Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 11/27] s390-ccw: set cp_receive mask only when needed and consume pending service irqs Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 12/27] s390-ccw: use zipl values when no boot menu options are present Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 13/27] s390-ccw: interactive boot menu for scsi Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 14/27] pc-bios/s390: Rebuild the s390x firmware images with the boot menu changes Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 15/27] s390x/cpu: expose the guest crash information Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 16/27] s390/stattrib: Make SaveVMHandlers data static Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 17/27] s390x/tcg: fix disabling/enabling DAT Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 18/27] s390x/tcg: add various alignment checks Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 19/27] qmp: expose s390-specific CPU info Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 20/27] qmp: add query-cpus-fast Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 21/27] qmp: add architecture specific cpu data for query-cpus-fast Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 22/27] qemu-doc: deprecate query-cpus Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 23/27] hmp: change hmp_info_cpus to use query-cpus-fast Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 24/27] s390x/cpumodel: document S390FeatDef.bit not applicable Cornelia Huck
2018-03-01 13:01 ` [Qemu-devel] [PULL v2 25/27] s390x/sclp: remove memory hotplug support Cornelia Huck
2018-03-01 13:02 ` [Qemu-devel] [PULL v2 26/27] s390x: remove s390_get_memslot_count Cornelia Huck
2018-03-01 13:02 ` Cornelia Huck [this message]
2018-03-01 18:46 ` [Qemu-devel] [PULL v2 00/27] s390x updates (and friends) 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=20180301130201.24666-28-cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.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.