From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <richard.henderson@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>,
philmd@linaro.org, alex.bennee@linaro.org, qemu-arm@nongnu.org,
Yannis Bolliger <yannis.bolliger@protonmail.com>,
Pierrick Bouvier <pierrick.bouvier@linaro.org>
Subject: [PATCH 3/4] target/arm/ptw: extract arm_cpu_get_phys_page
Date: Thu, 10 Apr 2025 14:00:21 -0700 [thread overview]
Message-ID: <20250410210022.809905-4-pierrick.bouvier@linaro.org> (raw)
In-Reply-To: <20250410210022.809905-1-pierrick.bouvier@linaro.org>
Allow to call that function easily several times in next commit.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
target/arm/ptw.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index 754ef0d3a25..6ea39ee5755 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -3629,23 +3629,17 @@ bool get_phys_addr(CPUARMState *env, vaddr address,
memop, result, fi);
}
-hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr,
- MemTxAttrs *attrs)
+static hwaddr arm_cpu_get_phys_page(CPUARMState *env, vaddr addr,
+ MemTxAttrs *attrs, ARMMMUIdx mmu_idx)
{
- ARMCPU *cpu = ARM_CPU(cs);
- CPUARMState *env = &cpu->env;
- ARMMMUIdx mmu_idx = arm_mmu_idx(env);
- ARMSecuritySpace ss = arm_mmu_idx_to_security_space(env, mmu_idx);
S1Translate ptw = {
.in_mmu_idx = mmu_idx,
- .in_space = ss,
+ .in_space = arm_mmu_idx_to_security_space(env, mmu_idx),
.in_debug = true,
};
GetPhysAddrResult res = {};
ARMMMUFaultInfo fi = {};
- bool ret;
-
- ret = get_phys_addr_gpc(env, &ptw, addr, MMU_DATA_LOAD, 0, &res, &fi);
+ bool ret = get_phys_addr_gpc(env, &ptw, addr, MMU_DATA_LOAD, 0, &res, &fi);
*attrs = res.f.attrs;
if (ret) {
@@ -3653,3 +3647,13 @@ hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr,
}
return res.f.phys_addr;
}
+
+hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr,
+ MemTxAttrs *attrs)
+{
+ ARMCPU *cpu = ARM_CPU(cs);
+ CPUARMState *env = &cpu->env;
+ ARMMMUIdx mmu_idx = arm_mmu_idx(env);
+
+ return arm_cpu_get_phys_page(env, addr, attrs, mmu_idx);
+}
--
2.39.5
next prev parent reply other threads:[~2025-04-10 21:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 21:00 [PATCH 0/4] target/arm: fix arm_cpu_get_phys_page_attrs_debug Pierrick Bouvier
2025-04-10 21:00 ` [PATCH 1/4] target/arm/ptw: extract arm_mmu_idx_to_security_space Pierrick Bouvier
2025-04-11 13:44 ` Philippe Mathieu-Daudé
2025-04-11 16:43 ` Pierrick Bouvier
2025-04-10 21:00 ` [PATCH 2/4] target/arm/ptw: get current security_space for current mmu_idx Pierrick Bouvier
2025-04-10 21:00 ` Pierrick Bouvier [this message]
2025-04-11 13:45 ` [PATCH 3/4] target/arm/ptw: extract arm_cpu_get_phys_page Philippe Mathieu-Daudé
2025-04-10 21:00 ` [PATCH 4/4] target/arm/ptw: fix arm_cpu_get_phys_page_attrs_debug Pierrick Bouvier
2025-04-12 17:11 ` [PATCH 0/4] target/arm: " Richard Henderson
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=20250410210022.809905-4-pierrick.bouvier@linaro.org \
--to=pierrick.bouvier@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=yannis.bolliger@protonmail.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 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).