Patchwork powerpc/kvm: fix build with older toolchains

login
register
mail settings
Submitter Nishanth Aravamudan
Date Nov. 7, 2011, 11:36 p.m.
Message ID <20111107233656.GB20208@us.ibm.com>
Download mbox | patch
Permalink /patch/124218/
State Accepted
Headers show

Comments

Nishanth Aravamudan - Nov. 7, 2011, 11:36 p.m.
Fix KVM build for older toolchains (found with .powerpc64-unknown-linux-gnu-gcc
(crosstool-NG-1.8.1) 4.3.2):

  AS      arch/powerpc/kvm/book3s_hv_rmhandlers.o
arch/powerpc/kvm/book3s_hv_rmhandlers.S: Assembler messages:
arch/powerpc/kvm/book3s_hv_rmhandlers.S:1388: Error: Unrecognized opcode: `popcntw'
make[1]: *** [arch/powerpc/kvm/book3s_hv_rmhandlers.o] Error 1
make: *** [_module_arch/powerpc/kvm] Error 2
    
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Alexander Graf - Nov. 10, 2011, 5:11 p.m.
On 11/08/2011 12:36 AM, Nishanth Aravamudan wrote:
> Fix KVM build for older toolchains (found with .powerpc64-unknown-linux-gnu-gcc
> (crosstool-NG-1.8.1) 4.3.2):
>
>    AS      arch/powerpc/kvm/book3s_hv_rmhandlers.o
> arch/powerpc/kvm/book3s_hv_rmhandlers.S: Assembler messages:
> arch/powerpc/kvm/book3s_hv_rmhandlers.S:1388: Error: Unrecognized opcode: `popcntw'
> make[1]: *** [arch/powerpc/kvm/book3s_hv_rmhandlers.o] Error 1
> make: *** [_module_arch/powerpc/kvm] Error 2
>
> Signed-off-by: Nishanth Aravamudan<nacc@us.ibm.com>

Thanks, applied to kvm-ppc-next.


Alex

> diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> index 0607909..a053db1 100644
> --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> @@ -1385,7 +1385,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_206)
>   	addi	r6,r5,VCORE_NAPPING_THREADS
>   31:	lwarx	r4,0,r6
>   	or	r4,r4,r0
> -	popcntw	r7,r4
> +	PPC_POPCNTW(r7,r4)
>   	cmpw	r7,r8
>   	bge	2f
>   	stwcx.	r4,0,r6
>

Patch

diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 0607909..a053db1 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -1385,7 +1385,7 @@  END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_206)
 	addi	r6,r5,VCORE_NAPPING_THREADS
 31:	lwarx	r4,0,r6
 	or	r4,r4,r0
-	popcntw	r7,r4
+	PPC_POPCNTW(r7,r4)
 	cmpw	r7,r8
 	bge	2f
 	stwcx.	r4,0,r6