[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes
From: |
Peter Maydell |
Subject: |
Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes |
Date: |
Tue, 15 Mar 2022 18:41:22 +0000 |
On Tue, 15 Mar 2022 at 18:35, Philippe Mathieu-Daudé
<philippe.mathieu.daude@gmail.com> wrote:
> On 8/3/22 12:18, Peter Maydell wrote:
> > Using 'unsigned long' in a cast (or anything else) is often
> > the wrong thing in QEMU...
>
> $ git grep -F '(unsigned long)' | wc -l
> 273
>
> Ouch :/
Only "often", not "always" :-) We have some APIs that work on
'long', usually because they're generic APIs borrowed from the
Linux kernel like the clear_bit/set_bit functions. And sometimes
you're interfacing to a host OS API whose types are 'long'.
So it's only one of those things that I tend to have in the
back of my head during code review, rather than something I think
we could enforce automatically.
The stuff in sev.c you list does look a bit suspicious, but
it's not actually buggy because that's all KVM code so we
know 'unsigned long' and pointers are the same size.
'uintptr_t' would be better, though.
thanks
-- PMM
- [PULL v2 45/47] hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table, (continued)
- [PULL v2 45/47] hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table, Michael S. Tsirkin, 2022/03/07
- [PULL v2 46/47] tests/acpi: i386: update FACP table differences, Michael S. Tsirkin, 2022/03/07
- Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes, Peter Maydell, 2022/03/07
- Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes, Peter Maydell, 2022/03/07
- Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes, Michael S. Tsirkin, 2022/03/07
- Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes, Peter Maydell, 2022/03/08
- Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes, Michael S. Tsirkin, 2022/03/08
- Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes, Peter Maydell, 2022/03/08
- Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes, Michael S. Tsirkin, 2022/03/08
- Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes, Philippe Mathieu-Daudé, 2022/03/15
- Re: [PULL v2 00/47] virtio,pc,pci: features, cleanups, fixes,
Peter Maydell <=