All of lore.kernel.org
 help / color / mirror / Atom feed
From: <tobias.roehmel@rwth-aachen.de>
To: <qemu-devel@nongnu.org>
Cc: peter.maydell@linaro.org,
	"Tobias Röhmel" <tobias.roehmel@rwth-aachen.de>
Subject: [PATCH v3 4/9] target/arm: Make stage_2_format for cache attributes optional
Date: Sat, 20 Aug 2022 16:19:09 +0200	[thread overview]
Message-ID: <20220820141914.217399-5-tobias.roehmel@rwth-aachen.de> (raw)
In-Reply-To: <20220820141914.217399-1-tobias.roehmel@rwth-aachen.de>

From: Tobias Röhmel <tobias.roehmel@rwth-aachen.de>

The Cortex-R52 has a 2 stage MPU translation process but doesn't have the
FEAT_S2FWB feature. This makes it neccessary to allow for the old cache
attribut combination. This is facilitated by changing the control path
of combine_cacheattrs instead of failing if the second cache attributes
struct is not in that format.

Signed-off-by: Tobias Röhmel <tobias.roehmel@rwth-aachen.de>
---
 target/arm/ptw.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index 4d97a24808..8b037c1f55 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -2108,7 +2108,11 @@ static uint8_t combined_attrs_nofwb(CPUARMState *env,
 {
     uint8_t s1lo, s2lo, s1hi, s2hi, s2_mair_attrs, ret_attrs;
 
-    s2_mair_attrs = convert_stage2_attrs(env, s2.attrs);
+    if (s2.is_s2_format) {
+        s2_mair_attrs = convert_stage2_attrs(env, s2.attrs);
+    } else {
+        s2_mair_attrs = s2.attrs;
+    }
 
     s1lo = extract32(s1.attrs, 0, 4);
     s2lo = extract32(s2_mair_attrs, 0, 4);
@@ -2166,6 +2170,8 @@ static uint8_t force_cacheattr_nibble_wb(uint8_t attr)
 static uint8_t combined_attrs_fwb(CPUARMState *env,
                                   ARMCacheAttrs s1, ARMCacheAttrs s2)
 {
+    assert(s2.is_s2_format && !s1.is_s2_format);
+
     switch (s2.attrs) {
     case 7:
         /* Use stage 1 attributes */
@@ -2215,7 +2221,6 @@ static ARMCacheAttrs combine_cacheattrs(CPUARMState *env,
     ARMCacheAttrs ret;
     bool tagged = false;
 
-    assert(s2.is_s2_format && !s1.is_s2_format);
     ret.is_s2_format = false;
 
     if (s1.attrs == 0xf0) {
-- 
2.25.1



  parent reply	other threads:[~2022-08-20 14:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-20 14:19 [PATCH v3 0/9] Add ARM Cortex-R52 cpu tobias.roehmel
2022-08-20 14:19 ` [PATCH v3 1/9] target/arm: Add ARM_FEATURE_V8_R tobias.roehmel
2022-08-20 14:19 ` [PATCH v3 2/9] target/arm: Don't add all MIDR aliases for cores that immplement PMSA tobias.roehmel
2022-09-27 16:29   ` Peter Maydell
2022-08-20 14:19 ` [PATCH v3 3/9] target/arm: Make RVBAR available for all ARMv8 CPUs tobias.roehmel
2022-09-27 13:01   ` Peter Maydell
2022-08-20 14:19 ` tobias.roehmel [this message]
2022-09-27 12:52   ` [PATCH v3 4/9] target/arm: Make stage_2_format for cache attributes optional Peter Maydell
2022-08-20 14:19 ` [PATCH v3 5/9] target/arm: Add ARMCacheAttrs to the signature of pmsav8_mpu_lookup tobias.roehmel
2022-09-27 13:05   ` Peter Maydell
2022-08-20 14:19 ` [PATCH v3 6/9] target/arm: Enable TTBCR_EAE for ARMv8-R AArch32 tobias.roehmel
2022-09-27 13:20   ` Peter Maydell
2022-08-20 14:19 ` [PATCH v3 7/9] target/arm: Add PMSAv8r registers tobias.roehmel
2022-09-27 13:50   ` Peter Maydell
2022-10-15 13:07     ` Tobias Roehmel
2022-10-20 15:02       ` Peter Maydell
2022-08-20 14:19 ` [PATCH v3 8/9] target/arm: Add PMSAv8r functionality tobias.roehmel
2022-09-27 16:23   ` Peter Maydell
2022-08-20 14:19 ` [PATCH v3 9/9] target/arm: Add ARM Cortex-R52 cpu tobias.roehmel
2022-09-27 16:31 ` [PATCH v3 0/9] " 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=20220820141914.217399-5-tobias.roehmel@rwth-aachen.de \
    --to=tobias.roehmel@rwth-aachen.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.