qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 07/10] target-s390: Fix STIDP


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 07/10] target-s390: Fix STIDP
Date: Tue, 01 Oct 2013 08:54:15 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

On 10/01/2013 08:52 AM, Alexander Graf wrote:
> On 09/30/2013 09:48 PM, Richard Henderson wrote:
>> On 09/30/2013 11:13 AM, Alexander Graf wrote:
>>>> -    int cpu_num;
>>>> +    union {
>>>> +        uint64_t cpuid;
>>>> +        struct {
>>>> +#ifdef HOST_WORDS_BIGENDIAN
>>>> +            uint32_t cpu_num;
>>>> +            uint32_t machine_type;
>>>> +#else
>>>> +            uint32_t machine_type;
>>>> +            uint32_t cpu_num;
>>>> +#endif
>>> Are we guaranteed that we don't need to pack? Also anonymous unions/structs 
>>> are
>>> a gcc extension IIRC. And why do you swap endianness here, but not above 
>>> when
>>> defining the machine_type value?
>> (1) I can't imagine that we would; such struct/unions are used all over.
> 
> *shrug* you're the expert :).
> 
>> (2) Sure, but we've so many other gcc extensions I figured it didn't matter.
> 
> Avi complained about it to me in Linux patches. Not sure how much we care in 
> QEMU.
> 
>> (3) Of course.  I want host endianness, not target endianness.
> 
> Phew. I think I'm slowly starting to grasp what you're trying to do here. Any
> way you could make this more explicit through shifts and ors and other 
> explicit
> operations? This feels like too much magic to "just understand on a glimpse" 
> to
> me.

Yes, I could arrange for it to be two loads and assembled at runtime.

It's not like this insn is used on any hot path... or indeed, apparently
more than once in the whole lifetime of the system.


r~



reply via email to

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