diff mbox

[v3,4/5] arm64: kvm: Adopt new alternative assembler macros

Message ID 1437564065-4356-5-git-send-email-daniel.thompson@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Thompson July 22, 2015, 11:21 a.m. UTC
Convert the dynamic patching for ARM64_HAS_SYSREG_GIC_CPUIF over to
the newly added alternative assembler macros.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
---
 arch/arm64/kvm/hyp.S | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Will Deacon July 22, 2015, 3:17 p.m. UTC | #1
Marc, Christoffer,

On Wed, Jul 22, 2015 at 12:21:04PM +0100, Daniel Thompson wrote:
> Convert the dynamic patching for ARM64_HAS_SYSREG_GIC_CPUIF over to
> the newly added alternative assembler macros.

Do you mind if I take this via the arm64 tree? It won't apply in
isolation and I'd expect conflicts to be small/trivial to resolve.

Cheers,

Will

> ---
>  arch/arm64/kvm/hyp.S | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
> index 17a8fb14f428..10915aaf0b01 100644
> --- a/arch/arm64/kvm/hyp.S
> +++ b/arch/arm64/kvm/hyp.S
> @@ -810,7 +810,11 @@
>   * Call into the vgic backend for state saving
>   */
>  .macro save_vgic_state
> -	alternative_insn "bl __save_vgic_v2_state", "bl __save_vgic_v3_state", ARM64_HAS_SYSREG_GIC_CPUIF
> +alternative_if_not ARM64_HAS_SYSREG_GIC_CPUIF
> +	bl	__save_vgic_v2_state
> +alternative_else
> +	bl	__save_vgic_v3_state
> +alternative_endif
>  	mrs	x24, hcr_el2
>  	mov	x25, #HCR_INT_OVERRIDE
>  	neg	x25, x25
> @@ -827,7 +831,11 @@
>  	orr	x24, x24, #HCR_INT_OVERRIDE
>  	orr	x24, x24, x25
>  	msr	hcr_el2, x24
> -	alternative_insn "bl __restore_vgic_v2_state", "bl __restore_vgic_v3_state", ARM64_HAS_SYSREG_GIC_CPUIF
> +alternative_if_not ARM64_HAS_SYSREG_GIC_CPUIF
> +	bl	__restore_vgic_v2_state
> +alternative_else
> +	bl	__restore_vgic_v3_state
> +alternative_endif
>  .endm
>  
>  .macro save_timer_state
> -- 
> 2.4.3
>
Marc Zyngier July 22, 2015, 3:55 p.m. UTC | #2
On 22/07/15 16:17, Will Deacon wrote:

Hi Will,

> On Wed, Jul 22, 2015 at 12:21:04PM +0100, Daniel Thompson wrote:
>> Convert the dynamic patching for ARM64_HAS_SYSREG_GIC_CPUIF over to
>> the newly added alternative assembler macros.
> 
> Do you mind if I take this via the arm64 tree? It won't apply in
> isolation and I'd expect conflicts to be small/trivial to resolve.

Looks perfectly sensible to me, and I'm happy for you to take this. I
don't believe we have anything queued for 4.3 that would clash with this
anyway.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
diff mbox

Patch

diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
index 17a8fb14f428..10915aaf0b01 100644
--- a/arch/arm64/kvm/hyp.S
+++ b/arch/arm64/kvm/hyp.S
@@ -810,7 +810,11 @@ 
  * Call into the vgic backend for state saving
  */
 .macro save_vgic_state
-	alternative_insn "bl __save_vgic_v2_state", "bl __save_vgic_v3_state", ARM64_HAS_SYSREG_GIC_CPUIF
+alternative_if_not ARM64_HAS_SYSREG_GIC_CPUIF
+	bl	__save_vgic_v2_state
+alternative_else
+	bl	__save_vgic_v3_state
+alternative_endif
 	mrs	x24, hcr_el2
 	mov	x25, #HCR_INT_OVERRIDE
 	neg	x25, x25
@@ -827,7 +831,11 @@ 
 	orr	x24, x24, #HCR_INT_OVERRIDE
 	orr	x24, x24, x25
 	msr	hcr_el2, x24
-	alternative_insn "bl __restore_vgic_v2_state", "bl __restore_vgic_v3_state", ARM64_HAS_SYSREG_GIC_CPUIF
+alternative_if_not ARM64_HAS_SYSREG_GIC_CPUIF
+	bl	__restore_vgic_v2_state
+alternative_else
+	bl	__restore_vgic_v3_state
+alternative_endif
 .endm
 
 .macro save_timer_state