From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Riku Voipio <riku.voipio@linaro.org>
Subject: [Qemu-devel] [PATCH 2/9] user-exec.c: Set is_write correctly in the ARM cpu_signal_handler()
Date: Sat, 6 Jul 2013 14:17:50 +0200 [thread overview]
Message-ID: <1373113077-11698-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1373113077-11698-1-git-send-email-agraf@suse.de>
From: Peter Maydell <peter.maydell@linaro.org>
In the ARM implementation of cpu_signal_handler(), set is_write
correctly using the FSR value which the kernel passes us in the
error_code field of uc_mcontext. Since the WnR bit of the FSR was
only introduced in ARMv6, this means that v5 cores will continue
to behave as before this patch, but they are not really supported
as hosts for linux-user mode anyway since they do not have the
modern behaviour for unaligned accesses.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
user-exec.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/user-exec.c b/user-exec.c
index ed15f1e..82bfa66 100644
--- a/user-exec.c
+++ b/user-exec.c
@@ -20,6 +20,7 @@
#include "cpu.h"
#include "disas/disas.h"
#include "tcg.h"
+#include "qemu/bitops.h"
#undef EAX
#undef ECX
@@ -446,8 +447,11 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#else
pc = uc->uc_mcontext.arm_pc;
#endif
- /* XXX: compute is_write */
- is_write = 0;
+
+ /* error_code is the FSR value, in which bit 11 is WnR (assuming a v6 or
+ * later processor; on v5 we will always report this as a read).
+ */
+ is_write = extract32(uc->uc_mcontext.error_code, 11, 1);
return handle_cpu_signal(pc, (unsigned long)info->si_addr,
is_write,
&uc->uc_sigmask, puc);
--
1.6.0.2
next prev parent reply other threads:[~2013-07-06 12:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-06 12:17 [Qemu-devel] [PATCH 0/9] Wine enablement patch set v2 Alexander Graf
2013-07-06 12:17 ` [Qemu-devel] [PATCH 1/9] linux-user: fix segmentation fault passing with h2g(x) != x Alexander Graf
2013-07-06 12:17 ` Alexander Graf [this message]
2013-07-06 12:17 ` [Qemu-devel] [PATCH 3/9] linux-user: Reset copied CPUs in cpu_copy() always Alexander Graf
2013-07-06 12:17 ` [Qemu-devel] [PATCH 4/9] linux-user: Clean up sendrecvmsg message parsing Alexander Graf
2013-07-23 7:31 ` Riku Voipio
2013-07-06 12:17 ` [Qemu-devel] [PATCH 5/9] linux-user: Fix epoll on ARM hosts Alexander Graf
2013-07-06 12:17 ` [Qemu-devel] [PATCH 6/9] linux-user: Add i386 TLS setter Alexander Graf
2013-07-06 12:17 ` [Qemu-devel] [PATCH 7/9] linux-user: Enable NPTL for i386 Alexander Graf
2013-07-06 12:17 ` [Qemu-devel] [PATCH 8/9] linux-user: Default to 64k guest base Alexander Graf
2013-07-22 19:54 ` Riku Voipio
2013-07-06 12:17 ` [Qemu-devel] [PATCH 9/9] linux-user: Unlock mmap_lock when resuming guest from page_unprotect Alexander Graf
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=1373113077-11698-3-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@linaro.org \
/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).