[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1] s390x/kvm: fix and cleanup storing CPU statu
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v1] s390x/kvm: fix and cleanup storing CPU status |
Date: |
Fri, 22 Sep 2017 08:12:19 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/21/2017 04:30 PM, David Hildenbrand wrote:
> +struct sigp_save_area {
> + uint64_t fprs[16]; /* 0x0000 */
> + uint64_t grs[16]; /* 0x0080 */
> + PSW psw; /* 0x0100 */
> + uint8_t pad_0x0110[0x0118 - 0x0110]; /* 0x0110 */
> + uint32_t prefix; /* 0x0118 */
> + uint32_t fpc; /* 0x011c */
> + uint8_t pad_0x0120[0x0124 - 0x0120]; /* 0x0120 */
> + uint32_t todpr; /* 0x0124 */
> + uint64_t cputm; /* 0x0128 */
> + uint64_t ckc; /* 0x0130 */
> + uint8_t pad_0x0138[0x0140 - 0x0138]; /* 0x0138 */
> + uint32_t ars[16]; /* 0x0140 */
> + uint64_t crs[16]; /* 0x0384 */
> +} QEMU_PACKED;
I don't believe you need to use QEMU_PACKED. Unless the "addr" that's passed
in can really be arbitrary? (If so, the memory returned by
cpu_physical_memory_map will be unaligned and so we do need the PACKED to force
the compiler to generate unaligned stores into the structure.)
> QEMU_BUILD_BUG_ON(sizeof(*sa) != 512);
Put this right next to the structure?
r~