All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 05/39] target/arm: Use GetPhysAddrResult in get_phys_addr_v6
Date: Thu, 22 Sep 2022 17:35:02 +0100	[thread overview]
Message-ID: <20220922163536.1096175-6-peter.maydell@linaro.org> (raw)
In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org>

From: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220822152741.1617527-5-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/ptw.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index e8d3f88628e..600d9e6650d 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -536,8 +536,7 @@ do_fault:
 
 static bool get_phys_addr_v6(CPUARMState *env, uint32_t address,
                              MMUAccessType access_type, ARMMMUIdx mmu_idx,
-                             hwaddr *phys_ptr, MemTxAttrs *attrs, int *prot,
-                             target_ulong *page_size, ARMMMUFaultInfo *fi)
+                             GetPhysAddrResult *result, ARMMMUFaultInfo *fi)
 {
     ARMCPU *cpu = env_archcpu(env);
     int level = 1;
@@ -597,11 +596,11 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t address,
             phys_addr = (desc & 0xff000000) | (address & 0x00ffffff);
             phys_addr |= (uint64_t)extract32(desc, 20, 4) << 32;
             phys_addr |= (uint64_t)extract32(desc, 5, 4) << 36;
-            *page_size = 0x1000000;
+            result->page_size = 0x1000000;
         } else {
             /* Section.  */
             phys_addr = (desc & 0xfff00000) | (address & 0x000fffff);
-            *page_size = 0x100000;
+            result->page_size = 0x100000;
         }
         ap = ((desc >> 10) & 3) | ((desc >> 13) & 4);
         xn = desc & (1 << 4);
@@ -627,12 +626,12 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t address,
         case 1: /* 64k page.  */
             phys_addr = (desc & 0xffff0000) | (address & 0xffff);
             xn = desc & (1 << 15);
-            *page_size = 0x10000;
+            result->page_size = 0x10000;
             break;
         case 2: case 3: /* 4k page.  */
             phys_addr = (desc & 0xfffff000) | (address & 0xfff);
             xn = desc & 1;
-            *page_size = 0x1000;
+            result->page_size = 0x1000;
             break;
         default:
             /* Never happens, but compiler isn't smart enough to tell.  */
@@ -640,7 +639,7 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t address,
         }
     }
     if (domain_prot == 3) {
-        *prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
+        result->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
     } else {
         if (pxn && !regime_is_user(env, mmu_idx)) {
             xn = 1;
@@ -658,14 +657,14 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t address,
                 fi->type = ARMFault_AccessFlag;
                 goto do_fault;
             }
-            *prot = simple_ap_to_rw_prot(env, mmu_idx, ap >> 1);
+            result->prot = simple_ap_to_rw_prot(env, mmu_idx, ap >> 1);
         } else {
-            *prot = ap_to_rw_prot(env, mmu_idx, ap, domain_prot);
+            result->prot = ap_to_rw_prot(env, mmu_idx, ap, domain_prot);
         }
-        if (*prot && !xn) {
-            *prot |= PAGE_EXEC;
+        if (result->prot && !xn) {
+            result->prot |= PAGE_EXEC;
         }
-        if (!(*prot & (1 << access_type))) {
+        if (!(result->prot & (1 << access_type))) {
             /* Access permission fault.  */
             fi->type = ARMFault_Permission;
             goto do_fault;
@@ -676,9 +675,9 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t address,
          * the CPU doesn't support TZ or this is a non-secure translation
          * regime, because the attribute will already be non-secure.
          */
-        attrs->secure = false;
+        result->attrs.secure = false;
     }
-    *phys_ptr = phys_addr;
+    result->phys = phys_addr;
     return false;
 do_fault:
     fi->domain = domain;
@@ -2518,8 +2517,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address,
                                   result, fi);
     } else if (regime_sctlr(env, mmu_idx) & SCTLR_XP) {
         return get_phys_addr_v6(env, address, access_type, mmu_idx,
-                                &result->phys, &result->attrs,
-                                &result->prot, &result->page_size, fi);
+                                result, fi);
     } else {
         return get_phys_addr_v5(env, address, access_type, mmu_idx,
                                 &result->phys, &result->prot,
-- 
2.25.1



  parent reply	other threads:[~2022-09-22 18:23 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 16:34 [PULL 00/39] target-arm queue Peter Maydell
2022-09-22 16:34 ` [PULL 01/39] hw/net/can: fix Xilinx ZynqMP CAN RX FIFO logic Peter Maydell
2022-09-22 16:34 ` [PULL 02/39] target/arm: Fix alignment for VLD4.32 Peter Maydell
2022-09-22 16:35 ` [PULL 03/39] target/arm: Create GetPhysAddrResult Peter Maydell
2022-09-22 16:35 ` [PULL 04/39] target/arm: Use GetPhysAddrResult in get_phys_addr_lpae Peter Maydell
2022-09-22 16:35 ` Peter Maydell [this message]
2022-09-22 16:35 ` [PULL 06/39] target/arm: Use GetPhysAddrResult in get_phys_addr_v5 Peter Maydell
2022-09-22 16:35 ` [PULL 07/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav5 Peter Maydell
2022-09-22 16:35 ` [PULL 08/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav7 Peter Maydell
2022-09-22 16:35 ` [PULL 09/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav8 Peter Maydell
2022-09-22 16:35 ` [PULL 10/39] target/arm: Use GetPhysAddrResult in pmsav8_mpu_lookup Peter Maydell
2022-09-22 16:35 ` [PULL 11/39] target/arm: Remove is_subpage argument to pmsav8_mpu_lookup Peter Maydell
2022-09-22 16:35 ` [PULL 12/39] target/arm: Add is_secure parameter to v8m_security_lookup Peter Maydell
2022-09-22 16:35 ` [PULL 13/39] target/arm: Add secure parameter to pmsav8_mpu_lookup Peter Maydell
2022-09-22 16:35 ` [PULL 14/39] target/arm: Add is_secure parameter to get_phys_addr_v5 Peter Maydell
2022-09-22 16:35 ` [PULL 15/39] target/arm: Add is_secure parameter to get_phys_addr_v6 Peter Maydell
2022-09-22 16:35 ` [PULL 16/39] target/arm: Add secure parameter to get_phys_addr_pmsav8 Peter Maydell
2022-09-22 16:35 ` [PULL 17/39] target/arm: Add is_secure parameter to pmsav7_use_background_region Peter Maydell
2022-09-22 16:35 ` [PULL 18/39] target/arm: Add secure parameter to get_phys_addr_pmsav7 Peter Maydell
2022-09-22 16:35 ` [PULL 19/39] target/arm: Add is_secure parameter to get_phys_addr_pmsav5 Peter Maydell
2022-09-22 16:35 ` [PULL 20/39] hw/acpi: Add ospm_status hook implementation for acpi-ged Peter Maydell
2022-09-22 16:35 ` [PULL 21/39] hw/net/lan9118: Signal TSFL_INT flag when TX FIFO reaches specified level Peter Maydell
2022-09-22 16:35 ` [PULL 22/39] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions Peter Maydell
2022-09-22 16:35 ` [PULL 23/39] chardev/baum: Use definitions to avoid dynamic stack allocation Peter Maydell
2022-09-22 16:35 ` [PULL 24/39] chardev/baum: Avoid " Peter Maydell
2022-09-22 16:35 ` [PULL 25/39] io/channel-websock: Replace strlen(const_str) by sizeof(const_str) - 1 Peter Maydell
2022-09-22 16:35 ` [PULL 26/39] hw/net/e1000e_core: Use definition to avoid dynamic stack allocation Peter Maydell
2022-09-22 16:35 ` [PULL 27/39] hw/ppc/pnv: Avoid " Peter Maydell
2022-09-22 16:35 ` [PULL 28/39] hw/intc/xics: " Peter Maydell
2022-09-22 16:35 ` [PULL 29/39] hw/i386/multiboot: " Peter Maydell
2022-09-22 16:35 ` [PULL 30/39] hw/usb/hcd-ohci: Use definition to avoid " Peter Maydell
2022-09-22 16:35 ` [PULL 31/39] ui/curses: Avoid " Peter Maydell
2022-09-22 16:35 ` [PULL 32/39] tests/unit/test-vmstate: " Peter Maydell
2022-09-22 16:35 ` [PULL 33/39] configure: Remove unused python_version variable Peter Maydell
2022-09-22 16:35 ` [PULL 34/39] configure: Remove unused meson_args variable Peter Maydell
2022-09-22 16:35 ` [PULL 35/39] configure: Add missing quoting for some easy cases Peter Maydell
2022-09-22 16:35 ` [PULL 36/39] configure: Add './' on front of glob of */config-devices.mak.d Peter Maydell
2022-09-22 16:35 ` [PULL 37/39] configure: Remove use of backtick `...` syntax Peter Maydell
2022-09-22 16:35 ` [PULL 38/39] configure: Check mkdir result directly, not via $? Peter Maydell
2022-09-22 16:35 ` [PULL 39/39] configure: Avoid use of 'local' as it is non-POSIX Peter Maydell
2022-09-26 19:22 ` [PULL 00/39] target-arm queue Stefan Hajnoczi

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=20220922163536.1096175-6-peter.maydell@linaro.org \
    --to=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.