qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 3/5] target/s390x: introduce (test|set)_be_bi


From: Christian Borntraeger
Subject: Re: [Qemu-devel] [PATCH v1 3/5] target/s390x: introduce (test|set)_be_bit
Date: Wed, 19 Jul 2017 13:35:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

On 07/19/2017 11:50 AM, David Hildenbrand wrote:
> Using ordinary bitmap operations to set/test bits does not work properly
> on architectures !s390x. Let's drop (test|set)_bit_inv and introduce
> (test|set)_be_bit instead. These functions work on uint8_t array, not on
> unsigned longs arrays and are for now only used in the context of
> CPU features.
> 
> Signed-off-by: David Hildenbrand <address@hidden>
> ---
>  target/s390x/cpu_features.c |  8 ++++----
>  target/s390x/cpu_features.h |  8 ++++++++
>  target/s390x/kvm.c          | 14 ++------------
>  3 files changed, 14 insertions(+), 16 deletions(-)
> 
> diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
> index 8b14917..1d3a036 100644
> --- a/target/s390x/cpu_features.c
> +++ b/target/s390x/cpu_features.c
> @@ -340,8 +340,8 @@ void s390_fill_feat_block(const S390FeatBitmap features, 
> S390FeatType type,
>      case S390_FEAT_TYPE_STFL:
>          if (test_bit(S390_FEAT_ZARCH, features)) {
>              /* Features that are always active */
> -            data[0] |= 0x20;  /* z/Architecture */
> -            data[17] |= 0x20; /* Configuration-z-architectural-mode */
> +            set_be_bit(2, data);   /* z/Architecture */
> +            set_be_bit(138, data); /* Configuration-z-architectural-mode */

this looks much nicer, but as seen from patchew, please make this patch compile 
:-p




reply via email to

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