2017-11-01 13:00:17

by Dongjiu Geng

[permalink] [raw]
Subject: Re: [PATCH v1 1/3] arm64: add a macro for SError synchronization

Hi Robin,

On 2017/11/1 19:24, Robin Murphy wrote:
>> + esb
>> +alternative_else_nop_endif
>> +1:
>> + .endm
> Having a branch in here is pretty horrible, and furthermore using label
> number 1 has a pretty high chance of subtly breaking code where this
> macro is inserted.
>
> Can we not somehow nest or combine the alternative conditions here?

I found it will report error if combine the alternative conditions here.

For example:

+ .macro error_synchronize
+alternative_if ARM64_HAS_IESB
+alternative_if ARM64_HAS_RAS_EXTN
+ esb
+alternative_else_nop_endif
+alternative_else_nop_endif
+ .endm

And even using b.eq/cbz instruction in the alternative instruction in arch/arm64/kernel/entry.S,
it will report Error.

For example below

alternative_if ARM64_HAS_PAN
xxxxxxxxxxxxxxxxxxxx
b.eq xxxxx
alternative_else_nop_endif

I do not dig it deeply, do you know the reason about it or good suggestion about that?
Thanks a lot in advance.


>
> Robin.
>
>> #endif /* __ASM_ASSEMBLER_H */


From 1582862752833507035@xxx Wed Nov 01 11:25:53 +0000 2017
X-GM-THRID: 1582861919438601873
X-Gmail-Labels: Inbox,Category Forums