qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] target/arm: Two fixes for secure ptw


From: Richard Henderson
Subject: Re: [PATCH] target/arm: Two fixes for secure ptw
Date: Fri, 4 Nov 2022 07:30:13 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

On 11/4/22 00:19, Peter Maydell wrote:
@@ -2671,6 +2671,13 @@ static bool get_phys_addr_with_struct(CPUARMState *env, 
S1Translate *ptw,
      bool is_secure = ptw->in_secure;
      ARMMMUIdx s1_mmu_idx;

+    /*
+     * The page table entries may downgrade secure to non-secure, but
+     * cannot upgrade an non-secure translation regime's attributes
+     * to secure.
+     */
+    result->f.attrs.secure = is_secure;
+
      switch (mmu_idx) {
      case ARMMMUIdx_Phys_S:
      case ARMMMUIdx_Phys_NS:
@@ -2712,12 +2719,6 @@ static bool get_phys_addr_with_struct(CPUARMState *env, 
S1Translate *ptw,
          break;
      }

-    /*
-     * The page table entries may downgrade secure to non-secure, but
-     * cannot upgrade an non-secure translation regime's attributes
-     * to secure.
-     */
-    result->f.attrs.secure = is_secure;
      result->f.attrs.user = regime_is_user(env, mmu_idx);

Do we also need to move this setting of attrs.user ?
get_phys_addr_disabled() doesn't set that either.

I don't think so. The only cases which don't pass through the setting of attrs.user are the two Phys mmu_idx. Which was by design per the comment up there about artificially deciding which EL regime they belong to.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]