diff mbox

[v2,12/19] xen/arm: Move macro VABORT_GEN_BY_GUEST to common header

Message ID 1490865209-18283-13-git-send-email-Wei.Chen@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Chen March 30, 2017, 9:13 a.m. UTC
We want to move part of SErrors checking code from hyp_error assembly code
to a function. This new function will use this macro to distinguish the
guest SErrors from hypervisor SErrors. So we have to move this macro to
common header.

The VABORT_GEN_BY_GUEST macro used two symbols abort_guest_exit_start and
abort_guest_exit_end. After we moved this macro to common header, we
should export these two symbols to other source files that will use
VABORT_GEN_BY_GUEST macro. So we change these two symbols to global.

Signed-off-by: Wei Chen <Wei.Chen@arm.com>
---
v1->v2:
1. Explain in commit message why we change abort_guest_exit_start and
   abort_guest_exit_end to global.
---
 xen/arch/arm/arm64/entry.S            |  2 ++
 xen/include/asm-arm/arm32/processor.h | 10 ----------
 xen/include/asm-arm/processor.h       | 10 ++++++++++
 3 files changed, 12 insertions(+), 10 deletions(-)

Comments

Stefano Stabellini March 30, 2017, 9:36 p.m. UTC | #1
On Thu, 30 Mar 2017, Wei Chen wrote:
> We want to move part of SErrors checking code from hyp_error assembly code
> to a function. This new function will use this macro to distinguish the
> guest SErrors from hypervisor SErrors. So we have to move this macro to
> common header.
> 
> The VABORT_GEN_BY_GUEST macro used two symbols abort_guest_exit_start and
> abort_guest_exit_end. After we moved this macro to common header, we
> should export these two symbols to other source files that will use
> VABORT_GEN_BY_GUEST macro. So we change these two symbols to global.

Please rewrite this to:

  The VABORT_GEN_BY_GUEST macro uses the symbols abort_guest_exit_start
  and abort_guest_exit_end. After we move this macro to a common header,
  we need to make sure that the two symbols are visible to other source
  files. Currently, they are declared .global in arm32/entry.S, but not
  arm64/entry.S. Fix that.

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


> Signed-off-by: Wei Chen <Wei.Chen@arm.com>
> ---
> v1->v2:
> 1. Explain in commit message why we change abort_guest_exit_start and
>    abort_guest_exit_end to global.
> ---
>  xen/arch/arm/arm64/entry.S            |  2 ++
>  xen/include/asm-arm/arm32/processor.h | 10 ----------
>  xen/include/asm-arm/processor.h       | 10 ++++++++++
>  3 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
> index 4baa3cb..113e1c3 100644
> --- a/xen/arch/arm/arm64/entry.S
> +++ b/xen/arch/arm/arm64/entry.S
> @@ -380,10 +380,12 @@ check_pending_vserror:
>           * exception handler, and the elr_el2 will be set to
>           * abort_guest_exit_start or abort_guest_exit_end.
>           */
> +        .global abort_guest_exit_start
>  abort_guest_exit_start:
>  
>          isb
>  
> +        .global abort_guest_exit_end
>  abort_guest_exit_end:
>          /* Mask PSTATE asynchronous abort bit, close the checking window. */
>          msr     daifset, #4
> diff --git a/xen/include/asm-arm/arm32/processor.h b/xen/include/asm-arm/arm32/processor.h
> index f6d5df3..68cc821 100644
> --- a/xen/include/asm-arm/arm32/processor.h
> +++ b/xen/include/asm-arm/arm32/processor.h
> @@ -56,16 +56,6 @@ struct cpu_user_regs
>      uint32_t pad1; /* Doubleword-align the user half of the frame */
>  };
>  
> -/* Functions for pending virtual abort checking window. */
> -void abort_guest_exit_start(void);
> -void abort_guest_exit_end(void);
> -
> -#define VABORT_GEN_BY_GUEST(r)  \
> -( \
> -    ( (unsigned long)abort_guest_exit_start == (r)->pc ) || \
> -    ( (unsigned long)abort_guest_exit_end == (r)->pc ) \
> -)
> -
>  #endif
>  
>  /* Layout as used in assembly, with src/dest registers mixed in */
> diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
> index 47e7026..700bde9 100644
> --- a/xen/include/asm-arm/processor.h
> +++ b/xen/include/asm-arm/processor.h
> @@ -709,6 +709,16 @@ int call_smc(register_t function_id, register_t arg0, register_t arg1,
>  
>  void do_trap_guest_error(struct cpu_user_regs *regs);
>  
> +/* Functions for pending virtual abort checking window. */
> +void abort_guest_exit_start(void);
> +void abort_guest_exit_end(void);
> +
> +#define VABORT_GEN_BY_GUEST(r)  \
> +( \
> +    ( (unsigned long)abort_guest_exit_start == (r)->pc ) || \
> +    ( (unsigned long)abort_guest_exit_end == (r)->pc ) \
> +)
> +
>  #endif /* __ASSEMBLY__ */
>  #endif /* __ASM_ARM_PROCESSOR_H */
>  /*
> -- 
> 2.7.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
>
Wei Chen March 31, 2017, 5:35 a.m. UTC | #2
On 2017/3/31 5:36, Stefano Stabellini wrote:
> On Thu, 30 Mar 2017, Wei Chen wrote:
>> We want to move part of SErrors checking code from hyp_error assembly code
>> to a function. This new function will use this macro to distinguish the
>> guest SErrors from hypervisor SErrors. So we have to move this macro to
>> common header.
>>
>> The VABORT_GEN_BY_GUEST macro used two symbols abort_guest_exit_start and
>> abort_guest_exit_end. After we moved this macro to common header, we
>> should export these two symbols to other source files that will use
>> VABORT_GEN_BY_GUEST macro. So we change these two symbols to global.
>
> Please rewrite this to:
>
>   The VABORT_GEN_BY_GUEST macro uses the symbols abort_guest_exit_start
>   and abort_guest_exit_end. After we move this macro to a common header,
>   we need to make sure that the two symbols are visible to other source
>   files. Currently, they are declared .global in arm32/entry.S, but not
>   arm64/entry.S. Fix that.
>

Thanks for reorganization, I would rewrite in next version.

> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
>
>
>> Signed-off-by: Wei Chen <Wei.Chen@arm.com>
>> ---
>> v1->v2:
>> 1. Explain in commit message why we change abort_guest_exit_start and
>>    abort_guest_exit_end to global.
>> ---
>>  xen/arch/arm/arm64/entry.S            |  2 ++
>>  xen/include/asm-arm/arm32/processor.h | 10 ----------
>>  xen/include/asm-arm/processor.h       | 10 ++++++++++
>>  3 files changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
>> index 4baa3cb..113e1c3 100644
>> --- a/xen/arch/arm/arm64/entry.S
>> +++ b/xen/arch/arm/arm64/entry.S
>> @@ -380,10 +380,12 @@ check_pending_vserror:
>>           * exception handler, and the elr_el2 will be set to
>>           * abort_guest_exit_start or abort_guest_exit_end.
>>           */
>> +        .global abort_guest_exit_start
>>  abort_guest_exit_start:
>>
>>          isb
>>
>> +        .global abort_guest_exit_end
>>  abort_guest_exit_end:
>>          /* Mask PSTATE asynchronous abort bit, close the checking window. */
>>          msr     daifset, #4
>> diff --git a/xen/include/asm-arm/arm32/processor.h b/xen/include/asm-arm/arm32/processor.h
>> index f6d5df3..68cc821 100644
>> --- a/xen/include/asm-arm/arm32/processor.h
>> +++ b/xen/include/asm-arm/arm32/processor.h
>> @@ -56,16 +56,6 @@ struct cpu_user_regs
>>      uint32_t pad1; /* Doubleword-align the user half of the frame */
>>  };
>>
>> -/* Functions for pending virtual abort checking window. */
>> -void abort_guest_exit_start(void);
>> -void abort_guest_exit_end(void);
>> -
>> -#define VABORT_GEN_BY_GUEST(r)  \
>> -( \
>> -    ( (unsigned long)abort_guest_exit_start == (r)->pc ) || \
>> -    ( (unsigned long)abort_guest_exit_end == (r)->pc ) \
>> -)
>> -
>>  #endif
>>
>>  /* Layout as used in assembly, with src/dest registers mixed in */
>> diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
>> index 47e7026..700bde9 100644
>> --- a/xen/include/asm-arm/processor.h
>> +++ b/xen/include/asm-arm/processor.h
>> @@ -709,6 +709,16 @@ int call_smc(register_t function_id, register_t arg0, register_t arg1,
>>
>>  void do_trap_guest_error(struct cpu_user_regs *regs);
>>
>> +/* Functions for pending virtual abort checking window. */
>> +void abort_guest_exit_start(void);
>> +void abort_guest_exit_end(void);
>> +
>> +#define VABORT_GEN_BY_GUEST(r)  \
>> +( \
>> +    ( (unsigned long)abort_guest_exit_start == (r)->pc ) || \
>> +    ( (unsigned long)abort_guest_exit_end == (r)->pc ) \
>> +)
>> +
>>  #endif /* __ASSEMBLY__ */
>>  #endif /* __ASM_ARM_PROCESSOR_H */
>>  /*
>> --
>> 2.7.4
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> https://lists.xen.org/xen-devel
>>
>
diff mbox

Patch

diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
index 4baa3cb..113e1c3 100644
--- a/xen/arch/arm/arm64/entry.S
+++ b/xen/arch/arm/arm64/entry.S
@@ -380,10 +380,12 @@  check_pending_vserror:
          * exception handler, and the elr_el2 will be set to
          * abort_guest_exit_start or abort_guest_exit_end.
          */
+        .global abort_guest_exit_start
 abort_guest_exit_start:
 
         isb
 
+        .global abort_guest_exit_end
 abort_guest_exit_end:
         /* Mask PSTATE asynchronous abort bit, close the checking window. */
         msr     daifset, #4
diff --git a/xen/include/asm-arm/arm32/processor.h b/xen/include/asm-arm/arm32/processor.h
index f6d5df3..68cc821 100644
--- a/xen/include/asm-arm/arm32/processor.h
+++ b/xen/include/asm-arm/arm32/processor.h
@@ -56,16 +56,6 @@  struct cpu_user_regs
     uint32_t pad1; /* Doubleword-align the user half of the frame */
 };
 
-/* Functions for pending virtual abort checking window. */
-void abort_guest_exit_start(void);
-void abort_guest_exit_end(void);
-
-#define VABORT_GEN_BY_GUEST(r)  \
-( \
-    ( (unsigned long)abort_guest_exit_start == (r)->pc ) || \
-    ( (unsigned long)abort_guest_exit_end == (r)->pc ) \
-)
-
 #endif
 
 /* Layout as used in assembly, with src/dest registers mixed in */
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 47e7026..700bde9 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -709,6 +709,16 @@  int call_smc(register_t function_id, register_t arg0, register_t arg1,
 
 void do_trap_guest_error(struct cpu_user_regs *regs);
 
+/* Functions for pending virtual abort checking window. */
+void abort_guest_exit_start(void);
+void abort_guest_exit_end(void);
+
+#define VABORT_GEN_BY_GUEST(r)  \
+( \
+    ( (unsigned long)abort_guest_exit_start == (r)->pc ) || \
+    ( (unsigned long)abort_guest_exit_end == (r)->pc ) \
+)
+
 #endif /* __ASSEMBLY__ */
 #endif /* __ASM_ARM_PROCESSOR_H */
 /*