qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH] linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP
Date: Tue, 20 Sep 2016 12:23:42 +1000
User-agent: Mutt/1.7.0 (2016-08-17)

On Tue, Aug 16, 2016 at 03:40:50PM +0200, Michael Walle wrote:
> Only the POWER[789] CPUs should have the ARCH_206 bit set. This is what the
> linux kernel does. I guess this was also the intention of commit 0e019746.
> We have to make sure all *206 bits are set.

Hrm.. it's not clear to me how this patch fixes things.  What was
incorrect with the previous logic?

> 
> Signed-off-by: Michael Walle <address@hidden>
> ---
> checkpatch.pl flags one warning, but I think this is a false positive.

Yes, I think so to, but..

>  linux-user/elfload.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index f807baf..4945d48 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -742,7 +742,8 @@ static uint32_t get_elf_hwcap(void)
>  #define GET_FEATURE(flag, feature)                                      \
>      do { if (cpu->env.insns_flags & flag) { features |= feature; } } while 
> (0)
>  #define GET_FEATURE2(flag, feature)                                      \
> -    do { if (cpu->env.insns_flags2 & flag) { features |= feature; } } while 
> (0)
> +    do { if ((cpu->env.insns_flags2 & flag) == flag) \
> +         { features |= feature; } } while (0)

..given that you're splitting this to >1 line, I think you might as
well expand it fully into a more normal indent style, which should also
shut up the stylebot.

>      GET_FEATURE(PPC_64B, QEMU_PPC_FEATURE_64);
>      GET_FEATURE(PPC_FLOAT, QEMU_PPC_FEATURE_HAS_FPU);
>      GET_FEATURE(PPC_ALTIVEC, QEMU_PPC_FEATURE_HAS_ALTIVEC);

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]