From: Aurelien Jarno <aurelien@aurel32.net>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] target-s390x: fix LOAD MULTIPLE instruction on page boundary
Date: Mon, 25 May 2015 23:04:03 +0200 [thread overview]
Message-ID: <20150525210403.GA29207@aurel32.net> (raw)
In-Reply-To: <55638A63.2030607@suse.de>
On 2015-05-25 22:47, Alexander Graf wrote:
>
>
> On 23.05.15 21:33, Richard Henderson wrote:
> > On 05/23/2015 12:59 AM, Aurelien Jarno wrote:
> >> On 2015-05-21 14:42, Richard Henderson wrote:
> >>> Hmm. Seems to be un/under-specified in the PoO. That said,
> >>
> >> There is a small sentence in the PoO, in chapter "Program Execution",
> >> section "Sequence of Storage Reference":
> >>
> >> It can normally be assumed that the execution of
> >> each instruction occurs as an indivisible event.
> >
> > Ah, I didn't think to look in a different chapter. ;-)
> >
> >>> It would be nice to know if there ought to be similar up-front access
> >>> checking
> >>> for STM, to avoid errant partial stores.
> >>
> >> I have just checked, the same is also true for STM instructions, though
> >> it's probably more difficult to fix that in QEMU. Maybe we need a way to
> >> check if a load/store will succeed, preferably without using a helper.
> >
> > I did just suggest a new helper in the "unaligned stores for mips r6"
> > thread. Therein we provide a probe_write helper that does assert that
> > the given page is writable, or raise the usual exception. It leaves the
> > TLB updated, so a subsequent write should take the fast path.
> >
> > It should be easy enough to extend that with an opcode so that we can
> > implement this for s390 as
> >
> > probe_write addr + n * size - 1
> > qemu_st r0, addr
> > qemu_st r1, addr + 1*size
> > ...
> >
> > Hopefully for the edge case where both pages are unmapped, producing an
> > exception pointing to the last byte, rather than the first byte, is
> > acceptable.
>
> So that means we should hold off on this patch for now as well and
> rather go for the probe approach?
For loads it's a bit different, but I guess we might come with a better
approach:
load first word
load last word
save first word in the corresponding register
save second word in the corresponding register
load words in between and save them in the corresponding registers
So yes it might be a good idea to hold off this patch.
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2015-05-25 21:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-21 21:32 [Qemu-devel] [PATCH] target-s390x: fix LOAD MULTIPLE instruction on page boundary Aurelien Jarno
2015-05-21 21:42 ` Richard Henderson
2015-05-23 7:59 ` Aurelien Jarno
2015-05-23 19:33 ` Richard Henderson
2015-05-25 20:47 ` Alexander Graf
2015-05-25 21:04 ` Aurelien Jarno [this message]
2015-05-25 21:05 ` Aurelien Jarno
2015-05-25 21:55 ` Alexander Graf
2015-05-26 7:09 ` Peter Maydell
2015-05-26 16:23 ` Richard Henderson
2015-05-21 22:00 ` Alexander Graf
2015-05-23 8:22 ` Aurelien Jarno
2015-05-23 9:26 ` 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=20150525210403.GA29207@aurel32.net \
--to=aurelien@aurel32.net \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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 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).