diff mbox

[RFC,08/21] target-arm: adjust arm_current_pl() for TrustZone

Message ID 1386060535-15908-9-git-send-email-s.fedorov@samsung.com
State New
Headers show

Commit Message

Sergey Fedorov Dec. 3, 2013, 8:48 a.m. UTC
Make arm_current_pl() to return PL3 in secure privileged mode.

Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
---
 target-arm/cpu.h |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Peter Crosthwaite Dec. 3, 2013, 12:23 p.m. UTC | #1
On Tue, Dec 3, 2013 at 6:48 PM, Sergey Fedorov <s.fedorov@samsung.com> wrote:
> Make arm_current_pl() to return PL3 in secure privileged mode.
>
> Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
> ---
>  target-arm/cpu.h |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/target-arm/cpu.h b/target-arm/cpu.h
> index a00c86f..1b03450 100644
> --- a/target-arm/cpu.h
> +++ b/target-arm/cpu.h
> @@ -622,9 +622,11 @@ static inline int arm_current_pl(CPUARMState *env)
>  {
>      if ((env->uncached_cpsr & 0x1f) == ARM_CPU_MODE_USR) {
>          return 0;
> +    } else if (arm_is_secure(env)) {
> +        return 3;
>      }
> -    /* We don't currently implement the Virtualization or TrustZone
> -     * extensions, so PL2 and PL3 don't exist for us.
> +    /* We don't currently implement the Virtualization extensions, so PL2 don't

"doesn't". (second "don't" not first).

> +     * exist for us.
>       */
>      return 1;
>  }
> --
> 1.7.9.5
>
>
diff mbox

Patch

diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index a00c86f..1b03450 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -622,9 +622,11 @@  static inline int arm_current_pl(CPUARMState *env)
 {
     if ((env->uncached_cpsr & 0x1f) == ARM_CPU_MODE_USR) {
         return 0;
+    } else if (arm_is_secure(env)) {
+        return 3;
     }
-    /* We don't currently implement the Virtualization or TrustZone
-     * extensions, so PL2 and PL3 don't exist for us.
+    /* We don't currently implement the Virtualization extensions, so PL2 don't
+     * exist for us.
      */
     return 1;
 }