diff mbox

[RFC,v2,1/6] xen/arm: traps: Reorder early overwrite of FID

Message ID 1486496525-14637-2-git-send-email-edgar.iglesias@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Edgar E. Iglesias Feb. 7, 2017, 7:42 p.m. UTC
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>

Move the early setting of PSCI_RESULT_REG to a later stage
avoiding the early override of the FID that's stored in
the same register.

No functional change.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 xen/arch/arm/traps.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Stefano Stabellini Feb. 13, 2017, 10:06 p.m. UTC | #1
On Tue, 7 Feb 2017, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> 
> Move the early setting of PSCI_RESULT_REG to a later stage
> avoiding the early override of the FID that's stored in
> the same register.
> 
> No functional change.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


>  xen/arch/arm/traps.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 92b1d80..c5a4d41 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -1335,8 +1335,6 @@ static void do_trap_psci(struct cpu_user_regs *regs)
>  {
>      register_t fid = PSCI_ARG(regs,0);
>  
> -    /* preloading in case psci_mode_check fails */
> -    PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
>      switch( fid )
>      {
>      case PSCI_cpu_off:
> @@ -1369,6 +1367,7 @@ static void do_trap_psci(struct cpu_user_regs *regs)
>      case PSCI_0_2_FN_MIGRATE_INFO_UP_CPU:
>      case PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU:
>          perfc_incr(vpsci_migrate_info_up_cpu);
> +        PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
>          if ( psci_mode_check(current->domain, fid) )
>              PSCI_RESULT_REG(regs) = do_psci_0_2_migrate_info_up_cpu();
>          break;
> @@ -1385,6 +1384,7 @@ static void do_trap_psci(struct cpu_user_regs *regs)
>      case PSCI_0_2_FN_CPU_ON:
>      case PSCI_0_2_FN64_CPU_ON:
>          perfc_incr(vpsci_cpu_on);
> +        PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
>          if ( psci_mode_check(current->domain, fid) )
>          {
>              register_t vcpuid = PSCI_ARG(regs,1);
> @@ -1397,6 +1397,7 @@ static void do_trap_psci(struct cpu_user_regs *regs)
>      case PSCI_0_2_FN_CPU_SUSPEND:
>      case PSCI_0_2_FN64_CPU_SUSPEND:
>          perfc_incr(vpsci_cpu_suspend);
> +        PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
>          if ( psci_mode_check(current->domain, fid) )
>          {
>              uint32_t pstate = PSCI_ARG32(regs,1);
> @@ -1409,6 +1410,7 @@ static void do_trap_psci(struct cpu_user_regs *regs)
>      case PSCI_0_2_FN_AFFINITY_INFO:
>      case PSCI_0_2_FN64_AFFINITY_INFO:
>          perfc_incr(vpsci_cpu_affinity_info);
> +        PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
>          if ( psci_mode_check(current->domain, fid) )
>          {
>              register_t taff = PSCI_ARG(regs,1);
> @@ -1420,6 +1422,7 @@ static void do_trap_psci(struct cpu_user_regs *regs)
>      case PSCI_0_2_FN_MIGRATE:
>      case PSCI_0_2_FN64_MIGRATE:
>          perfc_incr(vpsci_cpu_migrate);
> +        PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
>          if ( psci_mode_check(current->domain, fid) )
>          {
>              uint32_t tcpu = PSCI_ARG32(regs,1);
> -- 
> 2.7.4
>
diff mbox

Patch

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 92b1d80..c5a4d41 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1335,8 +1335,6 @@  static void do_trap_psci(struct cpu_user_regs *regs)
 {
     register_t fid = PSCI_ARG(regs,0);
 
-    /* preloading in case psci_mode_check fails */
-    PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
     switch( fid )
     {
     case PSCI_cpu_off:
@@ -1369,6 +1367,7 @@  static void do_trap_psci(struct cpu_user_regs *regs)
     case PSCI_0_2_FN_MIGRATE_INFO_UP_CPU:
     case PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU:
         perfc_incr(vpsci_migrate_info_up_cpu);
+        PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
         if ( psci_mode_check(current->domain, fid) )
             PSCI_RESULT_REG(regs) = do_psci_0_2_migrate_info_up_cpu();
         break;
@@ -1385,6 +1384,7 @@  static void do_trap_psci(struct cpu_user_regs *regs)
     case PSCI_0_2_FN_CPU_ON:
     case PSCI_0_2_FN64_CPU_ON:
         perfc_incr(vpsci_cpu_on);
+        PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
         if ( psci_mode_check(current->domain, fid) )
         {
             register_t vcpuid = PSCI_ARG(regs,1);
@@ -1397,6 +1397,7 @@  static void do_trap_psci(struct cpu_user_regs *regs)
     case PSCI_0_2_FN_CPU_SUSPEND:
     case PSCI_0_2_FN64_CPU_SUSPEND:
         perfc_incr(vpsci_cpu_suspend);
+        PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
         if ( psci_mode_check(current->domain, fid) )
         {
             uint32_t pstate = PSCI_ARG32(regs,1);
@@ -1409,6 +1410,7 @@  static void do_trap_psci(struct cpu_user_regs *regs)
     case PSCI_0_2_FN_AFFINITY_INFO:
     case PSCI_0_2_FN64_AFFINITY_INFO:
         perfc_incr(vpsci_cpu_affinity_info);
+        PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
         if ( psci_mode_check(current->domain, fid) )
         {
             register_t taff = PSCI_ARG(regs,1);
@@ -1420,6 +1422,7 @@  static void do_trap_psci(struct cpu_user_regs *regs)
     case PSCI_0_2_FN_MIGRATE:
     case PSCI_0_2_FN64_MIGRATE:
         perfc_incr(vpsci_cpu_migrate);
+        PSCI_RESULT_REG(regs) = PSCI_INVALID_PARAMETERS;
         if ( psci_mode_check(current->domain, fid) )
         {
             uint32_t tcpu = PSCI_ARG32(regs,1);