From: Sergey Fedorov <serge.fdrv@gmail.com>
To: Greg Bellows <greg.bellows@linaro.org>,
qemu-devel@nongnu.org, peter.maydell@linaro.org,
alex.bennee@linaro.org
Subject: Re: [Qemu-devel] [[PATCH] 5/7] target-arm: Add TTBR regime function and use
Date: Fri, 27 Mar 2015 16:25:31 -0700 [thread overview]
Message-ID: <5515E6EB.2050308@gmail.com> (raw)
In-Reply-To: <1427483446-31900-6-git-send-email-greg.bellows@linaro.org>
On 27.03.2015 12:10, Greg Bellows wrote:
> Add a utility function for choosing the correct TTBR system register based on
> the specified MMU index. Add use of function on physical address lookup.
>
> Signed-off-by: Greg Bellows <greg.bellows@linaro.org>
> ---
> target-arm/helper.c | 44 ++++++++++++++++++++++++++++++++------------
> 1 file changed, 32 insertions(+), 12 deletions(-)
>
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index 00b457a..13fdf02 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
(snip)
> @@ -5376,20 +5390,26 @@ static int get_phys_addr_lpae(CPUARMState *env, target_ulong address,
> int32_t tbi = 0;
> TCR *tcr = regime_tcr(env, mmu_idx);
> int ap, ns, xn, pxn;
> + uint32_t el = regime_el(env, mmu_idx);
>
> /* TODO:
> * This code assumes we're either a 64-bit EL1 or a 32-bit PL1;
> - * it doesn't handle the different format TCR for TCR_EL2, TCR_EL3,
> - * and VTCR_EL2, or the fact that those regimes don't have a split
> + * it doesn't handle the different format TCR for and VTCR_EL2,
s/and VTCR_EL2/VTCR_EL2/
> + * or the fact that those regimes don't have a split
> * TTBR0/TTBR1. Attribute and permission bit handling should also
> * be checked when adding support for those page table walks.
> */
> - if (arm_el_is_aa64(env, regime_el(env, mmu_idx))) {
> + if (arm_el_is_aa64(env, el)) {
> va_size = 64;
> - if (extract64(address, 55, 1))
> - tbi = extract64(tcr->raw_tcr, 38, 1);
> - else
> - tbi = extract64(tcr->raw_tcr, 37, 1);
> + if (el == 3 || el == 2) {
> + tbi = extract64(tcr->raw_tcr, 20, 1);
> + } else {
> + if (extract64(address, 55, 1)) {
> + tbi = extract64(tcr->raw_tcr, 38, 1);
> + } else {
> + tbi = extract64(tcr->raw_tcr, 37, 1);
> + }
> + }
> tbi *= 8;
> }
>
(snip)
next prev parent reply other threads:[~2015-03-27 23:25 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 19:10 [Qemu-devel] [[PATCH] 0/7] target-arm: EL3 trap support Greg Bellows
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 1/7] target-arm: Add exception target el infrastructure Greg Bellows
2015-04-16 17:50 ` Peter Maydell
2015-04-16 21:39 ` Greg Bellows
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 2/7] target-arm: Extend helpers to route exceptions Greg Bellows
2015-04-16 17:51 ` Peter Maydell
2015-04-21 22:13 ` Greg Bellows
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 3/7] target-arm: Update interrupt handling to use target EL Greg Bellows
2015-04-16 17:52 ` Peter Maydell
2015-04-16 21:03 ` Greg Bellows
2015-04-16 21:26 ` Peter Maydell
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 4/7] target-arm: Add AArch64 CPTR registers Greg Bellows
2015-04-16 18:00 ` Peter Maydell
2015-04-20 19:57 ` Greg Bellows
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 5/7] target-arm: Add TTBR regime function and use Greg Bellows
2015-03-27 23:25 ` Sergey Fedorov [this message]
2015-04-16 18:03 ` Peter Maydell
2015-04-17 18:29 ` Greg Bellows
2015-04-21 5:15 ` Sergey Fedorov
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 6/7] target-arm: Add WFx syndrome function Greg Bellows
2015-04-16 18:05 ` Peter Maydell
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 7/7] target-arm: Add WFx instruction trap support Greg Bellows
2015-04-16 18:22 ` Peter Maydell
2015-04-17 15:47 ` Greg Bellows
2015-04-17 15:50 ` 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=5515E6EB.2050308@gmail.com \
--to=serge.fdrv@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=greg.bellows@linaro.org \
--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).