From: Andrew Jones <drjones@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH 5/5] target-arm: apply get_S1prot to get_phys_addr_v6
Date: Thu, 12 Feb 2015 16:05:07 +0100 [thread overview]
Message-ID: <1423753507-30542-6-git-send-email-drjones@redhat.com> (raw)
In-Reply-To: <1423753507-30542-1-git-send-email-drjones@redhat.com>
Now that we have get_S1prot, we can apply it to get_phys_addr_v6
for a minor code cleanup.
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
target-arm/helper.c | 27 ++++++++-------------------
1 file changed, 8 insertions(+), 19 deletions(-)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 20e5753bd216d..c41305e7e2bdf 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -5064,30 +5064,19 @@ static int get_phys_addr_v6(CPUARMState *env, uint32_t address, int access_type,
}
code = 15;
}
- if (domain_prot == 3) {
- *prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
- } else {
- bool is_user = regime_is_user(env, mmu_idx);
-
- if (pxn && !is_user) {
- xn = 1;
- }
- if (xn && access_type == 2)
- goto do_fault;
-
+ if (regime_sctlr(env, mmu_idx) & SCTLR_AFE) {
/* The simplified model uses AP[0] as an access control bit. */
- if ((regime_sctlr(env, mmu_idx) & SCTLR_AFE)
- && (ap & 1) == 0) {
+ if ((ap & 1) == 0) {
/* Access flag fault. */
code = (code == 15) ? 6 : 3;
goto do_fault;
}
- *prot = get_rw_prot(env, mmu_idx, is_user, ap, domain_prot);
- *prot |= *prot && !xn ? PAGE_EXEC : 0;
- if (!(*prot & (1 << access_type))) {
- /* Access permission fault. */
- goto do_fault;
- }
+ ap >>= 1;
+ }
+ *prot = get_S1prot(env, mmu_idx, false, ap, domain_prot, 0, xn, pxn);
+ if (!(*prot & (1 << access_type))) {
+ /* Access permission fault. */
+ goto do_fault;
}
*phys_ptr = phys_addr;
return 0;
--
1.9.3
next prev parent reply other threads:[~2015-02-12 15:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-12 15:05 [Qemu-devel] [PATCH 0/5] tcg-arm: LPAE: fix and extend xn control Andrew Jones
2015-02-12 15:05 ` [Qemu-devel] [PATCH 1/5] target-arm: convert check_ap to get_rw_prot Andrew Jones
2015-03-10 15:07 ` Peter Maydell
2015-03-10 15:17 ` Peter Maydell
2015-03-10 15:12 ` Peter Maydell
2015-03-10 15:52 ` Andrew Jones
2015-02-12 15:05 ` [Qemu-devel] [PATCH 2/5] target-arm: enable get_rw_prot to take simple AP Andrew Jones
2015-03-10 15:22 ` Peter Maydell
2015-03-10 16:32 ` Andrew Jones
2015-03-10 16:41 ` Peter Maydell
2015-03-10 16:57 ` Andrew Jones
2015-02-12 15:05 ` [Qemu-devel] [PATCH 3/5] target-arm: add an is_user param to get_rw_prot Andrew Jones
2015-02-12 15:05 ` [Qemu-devel] [PATCH 4/5] target-arm: get_phys_addr_lpae: more xn control Andrew Jones
2015-02-12 17:44 ` Andrew Jones
2015-03-10 15:56 ` Peter Maydell
2015-03-10 16:48 ` Andrew Jones
2015-03-10 16:55 ` Peter Maydell
2015-03-10 17:02 ` Andrew Jones
2015-03-10 17:14 ` Peter Maydell
2015-03-10 17:28 ` Andrew Jones
2015-03-10 17:38 ` Peter Maydell
2015-03-11 10:37 ` Andrew Jones
2015-02-12 15:05 ` Andrew Jones [this message]
2015-02-12 17:08 ` [Qemu-devel] [PATCH 5/5] target-arm: apply get_S1prot to get_phys_addr_v6 Andrew Jones
2015-03-10 15:57 ` Peter Maydell
2015-03-10 16:54 ` Andrew Jones
2015-03-10 17:03 ` Peter Maydell
2015-03-10 17:08 ` Andrew Jones
2015-02-24 15:06 ` [Qemu-devel] [PATCH 0/5] tcg-arm: LPAE: fix and extend xn control Andrew Jones
2015-02-24 15:08 ` Peter Maydell
2015-02-24 15:14 ` Andrew Jones
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=1423753507-30542-6-git-send-email-drjones@redhat.com \
--to=drjones@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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).