On 14/03/2025 03.34, Nicholas Piggin wrote:
> On Thu Mar 13, 2025 at 8:49 PM AEST, Philippe Mathieu-Daudé wrote:
>> On 13/3/25 07:13, Thomas Huth wrote:
>>> On 13/03/2025 03.34, Stefan Hajnoczi wrote:
>>>> On Tue, Mar 11, 2025 at 8:59 PM Nicholas Piggin <npiggin@gmail.com>
>>>> wrote:
>>>>>
>>>>> The following changes since commit
>>>>> 825b96dbcee23d134b691fc75618b59c5f53da32:
>>>>>
>>>>> Merge tag 'migration-20250310-pull-request' of https://gitlab.com/
>>>>> farosas/qemu into staging (2025-03-11 09:32:07 +0800)
>>>>>
>>>>> are available in the Git repository at:
>>>>>
>>>>> https://gitlab.com/npiggin/qemu.git tags/pull-ppc-for-10.0-1-20250311
>>>>>
>>>>> for you to fetch changes up to 0f17ae24b53eaab4bbe9cfab267c536e2f7fdbd7:
>>>>>
>>>>> docs/system/ppc/amigang.rst: Update for NVRAM emulation
>>>>> (2025-03-11 22:43:32 +1000)
>>>>>
>>>>> ----------------------------------------------------------------
>>>>> * amigaone enhancements, NVRAM and kernel/initrd support
>>>>> * Next round of XIVE group/crowd changes
>>>>> * SPI updates for powernv
>>>>> * Power10 2nd DAWR support for powernv and spapr
>>>>> * powernv HOMER/OCC fixes and improvements for power management
>>>>> * powernv PNOR support
>>>>> * Big cleanup to move TCG code under ifdef or into its own file
>>>>> * Update SLOF and skiboot ROMs
>>>>> * Remove 405 boards and deprecate 405 CPU
>>>>> * Add support for nested KVM "hostwide state" data.
>>>>
>>>> I fixed a CI failure on FreeBSD 14 hosts because of the __packed macro
>>>> redefinition in hw/ppc/pnv_occ.c:
>>>> https://gitlab.com/qemu-project/qemu/-/jobs/9388495246#L5857
>>>>
>>>> Here is my fix in the merge commit, if you prefer a different fix,
>>>> please send a follow-up commit:
>>>> diff --git i/hw/ppc/pnv_occ.c w/hw/ppc/pnv_occ.c
>>>> index d9ce35a4d6..bda6b23ad3 100644
>>>> --- i/hw/ppc/pnv_occ.c
>>>> +++ w/hw/ppc/pnv_occ.c
>>>> @@ -394,7 +394,9 @@ type_init(pnv_occ_register_types);
>>>> #define s64 int64_t
>>>> #define __be16 uint16_t
>>>> #define __be32 uint32_t
>>>> +#ifndef __packed
>>>> #define __packed QEMU_PACKED
>>>> +#endif /* !__packed */
>>>
>>> We should never define such macros in userspace - everything with two
>>> underscores at the beginning is reserved for the system and the compiler
>>> and must not be created by the userspace code.
>>> Why doesn't this code use QEMU_PACKED directly instead?
>>
>> Similar question with __be16 / __be32.
>
> Okay these were just because the type definition is taken from
> skiboot firmware, so I added those defs just in the .c file to
> make it a bit less change. It's not too much to change if that
> is preferred.
Yes, I think that would be more solid. Otherwise, there is theoretically a
chance that a system header defines __packed to something different (e.g.
"#define __packed __attribute__((ms_struct, packed))"), and then we might
run into problems here.
Thomas