[PATCH 2/2] hw/virtio: Extract QMP QOM-specific functions to virtio-qmp.c

2022-12-22 Thread Philippe Mathieu-Daudé
virtio.c is big enough, extract more QMP related code to virtio-qmp.c. To do so, expose qmp_find_virtio_device() and declar virtio_list in the internal virtio-qmp.h header. Note we have to leave qmp_x_query_virtio_queue_status() and qmp_x_query_virtio_queue_element(), because they access VirtQueue

[PATCH 0/2] hw/virtio: Extract QMP QOM-specific functions to virtio-qmp.c

2022-12-22 Thread Philippe Mathieu-Daudé
Move more QMP code from virtio.c, as suggested by Jonah while reviewing "hw/virtio: Split ioconfig / qmp code from virtio.c" (https://lore.kernel.org/qemu-devel/20221213111707.34921-1-phi...@linaro.org/). Philippe Mathieu-Daudé (2): hw/virtio: Rename virtio_device_find() -> qmp_find_virtio_devic

Re: [PATCH v3 4/5] coroutine: Split qemu/coroutine-core.h off qemu/coroutine.h

2022-12-22 Thread Paolo Bonzini
On 12/21/22 14:14, Markus Armbruster wrote: +/** + * Mark a function that executes in coroutine context + * + * + * Functions that execute in coroutine context cannot be called + * directly from normal functions. Use @coroutine_fn to mark such + * functions. For example: + * + * static void c

[PATCH 1/2] hw/virtio: Rename virtio_device_find() -> qmp_find_virtio_device()

2022-12-22 Thread Philippe Mathieu-Daudé
To emphasize this function is QMP related, rename it. Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 289eb71045..a87007d22f 100644 --- a/hw/virtio/virtio.c +

Re: [PATCH] chardev: clean up chardev-parallel.c

2022-12-22 Thread Philippe Mathieu-Daudé
On 22/12/22 08:38, Paolo Bonzini wrote: Replace HAVE_CHARDEV_PARPORT with a Meson conditional, remove unnecessary defines, and close the file descriptor on FreeBSD/DragonFly. Signed-off-by: Paolo Bonzini --- chardev/char-parallel.c | 15 ++- chardev/meson.build | 5 - i

Re: [PATCH v2] MIPS: remove support for trap and emulate KVM

2022-12-22 Thread Philippe Mathieu-Daudé
On 21/12/22 10:17, Philippe Mathieu-Daudé wrote: From: Paolo Bonzini This support was limited to the Malta board, drop it. I do not have a machine that can run VZ KVM, so I am assuming that it works for -M malta as well. Signed-off-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH v3 10/10] libvduse: Fix assignment in vring_set_avail_event

2022-12-22 Thread Paolo Bonzini
On 12/21/22 14:10, Marcel Holtmann wrote: static inline void vring_set_avail_event(VduseVirtq *vq, uint16_t val) { -*((uint16_t *)&vq->vring.used->ring[vq->vring.num]) = htole16(val); +uint16_t *avail; + +avail = (uint16_t *)&vq->vring.used->ring[vq->vring.num]; +*avail = htol

Re: [PATCH v3 02/10] libvhost-user: Replace typeof with __typeof__

2022-12-22 Thread Paolo Bonzini
On 12/21/22 14:10, Marcel Holtmann wrote: Strictly speaking only -std=gnu99 support the usage of typeof and for easier inclusion in external projects, it is better to use __typeof__. CC libvhost-user.o libvhost-user.c: In function ‘vu_log_queue_fill’: libvhost-user.c:86:13: error: impli

Re: [PATCH v2] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Paolo Bonzini
On 12/21/22 17:36, Eric Auger wrote: To avoid compilation errors when -Werror=maybe-uninitialized is used, replace 'case 3' by 'default'. Otherwise we get: ../target/i386/ops_sse.h: In function ‘helper_vpermdq_ymm’: ../target/i386/ops_sse.h:2495:13: error: ‘r3’ may be used uninitialized in this

Re: [PATCH 0/2] gitlab: improve debuggability of jobs

2022-12-22 Thread Paolo Bonzini
Queued patch 1 while the second is figured out, thanks. Paolo

[PATCH] dockerfiles: update to Fedora 36

2022-12-22 Thread Paolo Bonzini
lcitool has removed the fedora-35 target, so let's follow suit. Signed-off-by: Paolo Bonzini --- tests/docker/dockerfiles/fedora-win32-cross.docker | 4 ++-- tests/docker/dockerfiles/fedora-win64-cross.docker | 4 ++-- tests/docker/dockerfiles/fedora.docker | 4 ++-- tests/lcitool/li

Re: [PATCH 0/6] enforce use of G_GNUC_PRINTF annotations

2022-12-22 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH] hw/display: avoid creating empty loadable modules

2022-12-22 Thread Paolo Bonzini
On 12/19/22 13:58, Daniel P. Berrangé wrote: When using --disable-virglrenderer, QEMU still creates hw-display-virtio-gpu-gl.so hw-display-virtio-vga-gl.so hw-display-virtio-gpu-pci-gl.so but when these are loaded, they provide no functionality as the code which registers types is not

Re: [PATCH v3 4/5] coroutine: Split qemu/coroutine-core.h off qemu/coroutine.h

2022-12-22 Thread Markus Armbruster
Paolo Bonzini writes: > On 12/21/22 14:14, Markus Armbruster wrote: >> +/** >> + * Mark a function that executes in coroutine context >> + * >> + * >> + * Functions that execute in coroutine context cannot be called >> + * directly from normal functions. Use @coroutine_fn to mark such >> + * fun

RE: [PATCH] hw/sd/sdhci: Block Size Register bits [14:12] is lost

2022-12-22 Thread Gao, Lu
Hello, Just want to check whether we can have it merged? Any other comments? Thanks a lot! B.R. -Original Message- From: Philippe Mathieu-Daudé [mailto:philippe.mathieu.da...@gmail.com] On Behalf Of Philippe Mathieu-Daudé Sent: Tuesday, May 31, 2022 6:09 PM To: Gao, Lu; qemu-devel@nongn

Re: [PATCH v2] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Philippe Mathieu-Daudé
On 22/12/22 09:18, Paolo Bonzini wrote: On 12/21/22 17:36, Eric Auger wrote: To avoid compilation errors when -Werror=maybe-uninitialized is used, replace 'case 3' by 'default'. Otherwise we get: ../target/i386/ops_sse.h: In function ‘helper_vpermdq_ymm’: ../target/i386/ops_sse.h:2495:13: erro

Re: [PATCH 4/5] include/hw/pci: Split pci_device.h off pci.h

2022-12-22 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Fri, Dec 09, 2022 at 02:48:01PM +0100, Markus Armbruster wrote: >> PCIDeviceClass and PCIDevice are defined in pci.h. Many users of the >> header don't actually need them. Similar structs live in their own >> headers: PCIBusClass and PCIBus in pci_bus.h, PCIBri

Re: [PATCH v3 0/5] coroutine: Clean up includes

2022-12-22 Thread Markus Armbruster
Markus Armbruster writes: > Philippe Mathieu-Daudé writes: > >> On 21/12/22 14:14, Markus Armbruster wrote: >>> v3: >>> * PATCH 4: Unnecessary hunks dropped >>> v2: >>> * Rebased >>> * PATCH 4: Rewritten [Paolo] >>> * PATCH 5: New >>> Markus Armbruster (5): >>>coroutine: Clean up superfluous

[PATCH v2 1/7] include/hw/pci: Break inclusion loop pci_bridge.h and cxl.h

2022-12-22 Thread Markus Armbruster
hw/pci/pci_bridge.h and hw/cxl/cxl.h include each other. Fortunately, breaking the loop is merely a matter of deleting unnecessary includes from headers, and adding them back in places where they are now missing. Signed-off-by: Markus Armbruster --- hw/alpha/alpha_sys.h | 1 - hw/r

[PATCH v2 5/7] include/hw/pci: Split pci_device.h off pci.h

2022-12-22 Thread Markus Armbruster
PCIDeviceClass and PCIDevice are defined in pci.h. Many users of the header don't actually need them. Similar structs live in their own headers: PCIBusClass and PCIBus in pci_bus.h, PCIBridge in pci_bridge.h, PCIHostBridgeClass and PCIHostState in pci_host.h, PCIExpressHost in pcie_host.h, and PC

[PATCH v2 0/7] include/hw/pci include/hw/cxl: Clean up includes

2022-12-22 Thread Markus Armbruster
Back in 2016, we discussed[1] rules for headers, and these were generally liked: 1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h. 2. Headers should normally include everything they need beyond osdep.h. If exceptions are need

[PATCH v2 6/7] include/hw/pci: Include hw/pci/pci.h where needed

2022-12-22 Thread Markus Armbruster
hw/pci/pcie_sriov.h needs PCI_NUM_REGIONS. Without the previous commit, this would close an inclusion loop: hw/pci/pci.h used to include hw/pci/pcie.h for PCIExpressDevice, which includes pcie_sriov.h for PCIESriovPF, which now includes hw/pci/pci.h for PCI_NUM_REGIONS. Signed-off-by: Markus Armb

[PATCH v2 4/7] include/hw/pci: Clean up a few things checkpatch.pl would flag

2022-12-22 Thread Markus Armbruster
Fix a few style violations so that checkpatch.pl won't complain when I move this code. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/hw/pci/pci.h b/incl

[PATCH v2 3/7] include/hw/cxl: Include hw/cxl/*.h where needed

2022-12-22 Thread Markus Armbruster
hw/cxl/cxl_component.h needs CDATObject from hw/cxl/cxl_cdat.h. hw/cxl/cxl_device.h needs CXLComponentState from hw/cxl/cxl_component.h. Signed-off-by: Markus Armbruster Acked-by: Jonathan Cameron --- include/hw/cxl/cxl_component.h | 1 + include/hw/cxl/cxl_device.h| 1 + 2 files changed,

[PATCH v2 2/7] include/hw/cxl: Move typedef PXBDev to cxl.h, and put it to use

2022-12-22 Thread Markus Armbruster
hw/cxl/cxl.h uses the PXBDev structure tag instead of the typedef name. The typedef name is defined in hw/pci/pci_bridge.h. Its inclusion was dropped in the previous commit to break an inclusion loop. Move the typedef to hw/cxl/cxl.h, and use it there. Delete an extra typedef in hw/pci-bridge/p

[PATCH v2 7/7] include/hw/cxl: Break inclusion loop cxl_pci.h and cxl_cdat_h

2022-12-22 Thread Markus Armbruster
hw/cxl/cxl_pci.h and hw/cxl/cxl_cdat.h include each other. The former doesn't actually need the latter, so drop that inclusion to break the loop. Signed-off-by: Markus Armbruster --- include/hw/cxl/cxl_pci.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/cxl/cxl_pci.h b/include/h

Re: [PATCH v2] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Eric Auger
Hi Philippe, On 12/22/22 10:01, Philippe Mathieu-Daudé wrote: > On 22/12/22 09:18, Paolo Bonzini wrote: >> On 12/21/22 17:36, Eric Auger wrote: >>> To avoid compilation errors when -Werror=maybe-uninitialized is used, >>> replace 'case 3' by 'default'. >>> >>> Otherwise we get: >>> >>> ../target/i

Re: [PATCH 01/15] tests/avocado: add RISC-V opensbi boot test

2022-12-22 Thread Bin Meng
On Thu, Dec 22, 2022 at 2:29 AM Daniel Henrique Barboza wrote: > > This test is used to do a quick sanity check to ensure that we're able > to run the existing QEMU FW image. > > 'sifive_u', 'spike' and 'virt' riscv64 machines, and 'sifive_u' and > 'virt' 32 bit machines are able to run the defaul

Re: [PATCH v2] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Philippe Mathieu-Daudé
On 22/12/22 11:07, Eric Auger wrote: Hi Philippe, On 12/22/22 10:01, Philippe Mathieu-Daudé wrote: On 22/12/22 09:18, Paolo Bonzini wrote: On 12/21/22 17:36, Eric Auger wrote: To avoid compilation errors when -Werror=maybe-uninitialized is used, replace 'case 3' by 'default'. Otherwise we ge

Re: [PATCH v2 0/7] include/hw/pci include/hw/cxl: Clean up includes

2022-12-22 Thread Bernhard Beschow
Am 22. Dezember 2022 10:03:23 UTC schrieb Markus Armbruster : >Back in 2016, we discussed[1] rules for headers, and these were >generally liked: > >1. Have a carefully curated header that's included everywhere first. We > got that already thanks to Peter: osdep.h. > >2. Headers should normall

Re: [PATCH 01/15] tests/avocado: add RISC-V opensbi boot test

2022-12-22 Thread Daniel Henrique Barboza
On 12/22/22 07:24, Bin Meng wrote: On Thu, Dec 22, 2022 at 2:29 AM Daniel Henrique Barboza wrote: This test is used to do a quick sanity check to ensure that we're able to run the existing QEMU FW image. 'sifive_u', 'spike' and 'virt' riscv64 machines, and 'sifive_u' and 'virt' 32 bit machi

[PATCH v2 2/4] include/hw/ppc: Supply a few missing includes

2022-12-22 Thread Markus Armbruster
A few headers neglect to include headers they need. They compile only if something else includes the required header(s) first. Fix that. Signed-off-by: Markus Armbruster Reviewed-by: Cédric Le Goater Reviewed-by: Daniel Henrique Barboza --- include/hw/ppc/pnv_lpc.h| 3 ++- include/hw/ppc

[PATCH v2 0/4] hw/ppc: Clean up includes

2022-12-22 Thread Markus Armbruster
Back in 2016, we discussed[1] rules for headers, and these were generally liked: 1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h. 2. Headers should normally include everything they need beyond osdep.h. If exceptions are need

Re: [PATCH v2 0/7] include/hw/pci include/hw/cxl: Clean up includes

2022-12-22 Thread Markus Armbruster
Bernhard Beschow writes: > Am 22. Dezember 2022 10:03:23 UTC schrieb Markus Armbruster > : >>Back in 2016, we discussed[1] rules for headers, and these were >>generally liked: >> >>1. Have a carefully curated header that's included everywhere first. We >> got that already thanks to Peter: osd

Re: [PATCH v2] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Bernhard Beschow
Am 22. Dezember 2022 09:01:34 UTC schrieb "Philippe Mathieu-Daudé" : >On 22/12/22 09:18, Paolo Bonzini wrote: >> On 12/21/22 17:36, Eric Auger wrote: >>> To avoid compilation errors when -Werror=maybe-uninitialized is used, >>> replace 'case 3' by 'default'. >>> >>> Otherwise we get: >>> >>>

[PATCH v2 4/4] include/hw/ppc include/hw/pci-host: Drop extra typedefs

2022-12-22 Thread Markus Armbruster
PnvChip is typedef'ed in five places, and PnvPhb4PecState in two. Keep one, drop the others. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Reviewed-by: Daniel Henrique Barboza --- hw/pci-host/pnv_phb.h | 2 +- include/hw/pci-host/p

[PATCH v3 4/6] virtio-mem: Fail if a memory backend with "prealloc=on" is specified

2022-12-22 Thread David Hildenbrand
"prealloc=on" for the memory backend does not work as expected, as virtio-mem will simply discard all preallocated memory immediately again. In the best case, it's an expensive NOP. In the worst case, it's an unexpected allocation error. Instead, "prealloc=on" should be specified for the virtio-me

[PATCH v2 1/4] include/hw/ppc: Split pnv_chip.h off pnv.h

2022-12-22 Thread Markus Armbruster
PnvChipClass, PnvChip, Pnv8Chip, Pnv9Chip, and Pnv10Chip are defined in pnv.h. Many users of the header don't actually need them. One instance is this inclusion loop: hw/ppc/pnv_homer.h includes hw/ppc/pnv.h for typedef PnvChip, and vice versa for struct PnvHomer. Similar structs live in their o

[PATCH v3 0/6] virtio-mem: Handle preallocation with migration

2022-12-22 Thread David Hildenbrand
While playing with migration of virtio-mem with an ordinary file backing, I realized that migration and prealloc doesn't currently work as expected for virtio-mem. Further, Jing Qi reported that setup issues (insufficient huge pages on the destination) result in QEMU getting killed with SIGBUS inst

[PATCH v3 5/6] virtio-mem: Migrate bitmap, size and sanity checks early

2022-12-22 Thread David Hildenbrand
The bitmap and the size are immutable while migration is active: see virtio_mem_is_busy(). We can migrate this information early, before migrating any actual RAM content. Having this information in place early will, for example, allow for properly preallocating memory before touching these memory

[PATCH v3 3/6] migration: Factor out checks for advised and listening incomming postcopy

2022-12-22 Thread David Hildenbrand
Let's factor out both checks, to be used in virtio-mem context next. While at it, fix a spelling error in a related comment. Signed-off-by: David Hildenbrand --- include/migration/misc.h | 6 +- migration/migration.c| 14 ++ migration/ram.c | 16 ++-- 3

[PATCH v3 1/6] migration: Allow immutable device state to be migrated early (i.e., before RAM)

2022-12-22 Thread David Hildenbrand
For virtio-mem, we want to have the plugged/unplugged state of memory blocks available before migrating any actual RAM content. This information is immutable on the migration source while migration is active, For example, we want to use this information for proper preallocation support with migrat

[PATCH v3 6/6] virtio-mem: Proper support for preallocation with migration

2022-12-22 Thread David Hildenbrand
Ordinary memory preallocation runs when QEMU starts up and creates the memory backends, before processing the incoming migration stream. With virtio-mem, we don't know which memory blocks to preallocate before migration started. Now that we migrate the virtio-mem bitmap early, before migrating any

[PATCH v3 2/6] migration/vmstate: Introduce VMSTATE_WITH_TMP_TEST() and VMSTATE_BITMAP_TEST()

2022-12-22 Thread David Hildenbrand
We'll make use of both next in the context of virtio-mem. Signed-off-by: David Hildenbrand --- include/migration/vmstate.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 79eb2409a2..73ad1ae0eb 1006

[PATCH v2 3/4] include/hw/ppc: Don't include hw/pci-host/pnv_phb.h from pnv.h

2022-12-22 Thread Markus Armbruster
The next commit needs to include hw/ppc/pnv.h from hw/pci-host/pnv_phb.h. Avoid an inclusion loop. Signed-off-by: Markus Armbruster Reviewed-by: Cédric Le Goater Reviewed-by: Daniel Henrique Barboza --- include/hw/pci-host/pnv_phb4.h | 3 ++- include/hw/ppc/pnv.h | 3 ++- hw/ppc/pnv

Re: [PATCH] dockerfiles: update to Fedora 36

2022-12-22 Thread Daniel P . Berrangé
On Thu, Dec 22, 2022 at 09:27:56AM +0100, Paolo Bonzini wrote: > lcitool has removed the fedora-35 target, so let's follow > suit. > > Signed-off-by: Paolo Bonzini > --- > tests/docker/dockerfiles/fedora-win32-cross.docker | 4 ++-- > tests/docker/dockerfiles/fedora-win64-cross.docker | 4 ++-- >

Re: [PATCH v2] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Daniel P . Berrangé
On Thu, Dec 22, 2022 at 11:07:31AM +0100, Eric Auger wrote: > Hi Philippe, > > On 12/22/22 10:01, Philippe Mathieu-Daudé wrote: > > On 22/12/22 09:18, Paolo Bonzini wrote: > >> On 12/21/22 17:36, Eric Auger wrote: > >>> To avoid compilation errors when -Werror=maybe-uninitialized is used, > >>> re

Re: [PULL 0/6] testing updates

2022-12-22 Thread Peter Maydell
On Wed, 21 Dec 2022 at 14:40, Alex Bennée wrote: > > The following changes since commit 8540a1f69578afb3b37866b1ce5bec46a9f6efbc: > > Merge tag 'hppa-fixes-pull-request' of https://github.com/hdeller/qemu-hppa > into staging (2022-12-20 15:32:27 +) > > are available in the Git repository at

Re: [PATCH v3 4/5] coroutine: Split qemu/coroutine-core.h off qemu/coroutine.h

2022-12-22 Thread Paolo Bonzini
On 12/22/22 09:56, Markus Armbruster wrote: +/** + * Mark a function that executes in coroutine context + * + * + * Functions that execute in coroutine context cannot be called + * directly from normal functions. Use @coroutine_fn to mark such + * functions. For example: + * + * static void c

Re: [PATCH v2] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Eric Auger
Hi All, On 12/22/22 12:09, Daniel P. Berrangé wrote: > On Thu, Dec 22, 2022 at 11:07:31AM +0100, Eric Auger wrote: >> Hi Philippe, >> >> On 12/22/22 10:01, Philippe Mathieu-Daudé wrote: >>> On 22/12/22 09:18, Paolo Bonzini wrote: On 12/21/22 17:36, Eric Auger wrote: > To avoid compilation

RE: [PULL 0/6] testing updates

2022-12-22 Thread Mukilan Thiyagarajan (QUIC)
I believe the error is caused by the QEMU_JOB_ONLY_FORKS: 1 line which needs to be removed from the definition of hexagon-cross-container. Alex, Peter, Shall I raise a patch to remove this line? Should the patch be created against the testing/next branch? Thanks, Mukilan -Original Message-

Re: [PATCH v2] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Philippe Mathieu-Daudé
On 22/12/22 12:18, Eric Auger wrote: Hi All, On 12/22/22 12:09, Daniel P. Berrangé wrote: On Thu, Dec 22, 2022 at 11:07:31AM +0100, Eric Auger wrote: Hi Philippe, On 12/22/22 10:01, Philippe Mathieu-Daudé wrote: On 22/12/22 09:18, Paolo Bonzini wrote: On 12/21/22 17:36, Eric Auger wrote: T

[PATCH v2 3/4] include: Don't include qemu/osdep.h

2022-12-22 Thread Markus Armbruster
docs/devel/style.rst mandates: The "qemu/osdep.h" header contains preprocessor macros that affect the behavior of core system headers like . It must be the first include so that core system headers included by external libraries get the preprocessor macros that QEMU depends on.

Re: [PATCH v2 0/4] Clean up includes

2022-12-22 Thread Markus Armbruster
Michael, I forgot to add your R-bys. I'll fix that in the next revision if I need one, else in the pull request.

[PATCH v2 4/4] docs/devel: Rules on #include in headers

2022-12-22 Thread Markus Armbruster
Rules for headers were proposed a long time ago, and generally liked: Message-ID: <87h9g8j57d@blackfin.pond.sub.org> https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html Wortk them into docs/devel/style.rst. Suggested-by: Bernhard Beschow Signed-off-by: Markus Armb

[PATCH v2 2/4] include: Include headers where needed

2022-12-22 Thread Markus Armbruster
A number of headers neglect to include everything they need. They compile only if the headers they need are already included from elsewhere. Fix that. Signed-off-by: Markus Armbruster Reviewed-by: Alistair Francis --- include/exec/plugin-gen.h | 1 + include/hw/acpi/erst.h

[PATCH v2 0/4] Clean up includes

2022-12-22 Thread Markus Armbruster
Back in 2016, we discussed[1] rules for headers, and these were generally liked: 1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h. 2. Headers should normally include everything they need beyond osdep.h. If exceptions are need

[PATCH v2 1/4] include/hw/virtio: Break inclusion loop

2022-12-22 Thread Markus Armbruster
hw/virtio/virtio.h and hw/virtio/vhost.h include each other. The former doesn't actually need the latter, so drop that inclusion to break the loop. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Stefano Garzarella --- include/h

Re: [PATCH v2] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Stefan Weil via
Am 22.12.22 um 12:51 schrieb Philippe Mathieu-Daudé: On 22/12/22 12:18, Eric Auger wrote: Hi All, On 12/22/22 12:09, Daniel P. Berrangé wrote: On Thu, Dec 22, 2022 at 11:07:31AM +0100, Eric Auger wrote: Hi Philippe, On 12/22/22 10:01, Philippe Mathieu-Daudé wrote: On 22/12/22 09:18, Paolo

Re: [PATCH v2] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Philippe Mathieu-Daudé
On 22/12/22 13:32, Stefan Weil wrote: Am 22.12.22 um 12:51 schrieb Philippe Mathieu-Daudé: On 22/12/22 12:18, Eric Auger wrote: Hi All, On 12/22/22 12:09, Daniel P. Berrangé wrote: On Thu, Dec 22, 2022 at 11:07:31AM +0100, Eric Auger wrote: Hi Philippe, On 12/22/22 10:01, Philippe Mathieu-

Re: [PATCH 01/15] tests/avocado: add RISC-V opensbi boot test

2022-12-22 Thread Bin Meng
On Thu, Dec 22, 2022 at 6:47 PM Daniel Henrique Barboza wrote: > > > > On 12/22/22 07:24, Bin Meng wrote: > > On Thu, Dec 22, 2022 at 2:29 AM Daniel Henrique Barboza > > wrote: > >> This test is used to do a quick sanity check to ensure that we're able > >> to run the existing QEMU FW image. > >>

Re: [PATCH] usbredir: Do not detach usb if backend chardev disconnect

2022-12-22 Thread Minglei Liu
ping ! please review this patch : [PATCH] usbredir: Do not detach usb if backend chardev disconnect - minglei.liu (kernel.org) minglei.liu 于2022年11月9日周三 19:56写道: > If the network between qemu and usbredirserver

[PATCH v3] target/i386: Remove compilation errors when -Werror=maybe-uninitialized

2022-12-22 Thread Eric Auger
To avoid compilation errors when -Werror=maybe-uninitialized is used, add a default case with g_assert_not_reached(). Otherwise with GCC 11.3.1 "cc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)" we get: ../target/i386/ops_sse.h: In function ‘helper_vpermdq_ymm’: ../target/i386/ops_sse.h:2495:13: error

Re: [PATCH 03/15] hw/riscv/sifive_u: use 'fdt' from MachineState

2022-12-22 Thread Philippe Mathieu-Daudé
On 21/12/22 19:22, Daniel Henrique Barboza wrote: The MachineState object provides a 'fdt' pointer that is already being used by other RISC-V machines, and it's also used by the 'dumpdtb' QMP command. Remove the 'fdt' pointer from SiFiveUState and use MachineState::fdt instead. Cc: Palmer Dabbe

Re: [PATCH 02/15] hw/riscv/spike: use 'fdt' from MachineState

2022-12-22 Thread Philippe Mathieu-Daudé
On 21/12/22 19:22, Daniel Henrique Barboza wrote: The MachineState object provides a 'fdt' pointer that is already being used by other RISC-V machines, and it's also used by the 'dumpdtb' QMP command. Remove the 'fdt' pointer from SpikeState and use MachineState::fdt instead. Signed-off-by: Dan

Re: [PATCH 04/15] hw/riscv/boot.c: make riscv_find_firmware() static

2022-12-22 Thread Philippe Mathieu-Daudé
On 21/12/22 19:22, Daniel Henrique Barboza wrote: The only caller is riscv_find_and_load_firmware(), which is in the same file. Signed-off-by: Daniel Henrique Barboza --- hw/riscv/boot.c | 44 - include/hw/riscv/boot.h | 1 - 2 files changed,

Re: [PATCH 06/15] hw/riscv/spike.c: load initrd right after riscv_load_kernel()

2022-12-22 Thread Philippe Mathieu-Daudé
On 21/12/22 19:22, Daniel Henrique Barboza wrote: This will make the code more in line with what the other boards are doing. We'll also avoid an extra check to machine->kernel_filename since we already checked that before executing riscv_load_kernel(). Signed-off-by: Daniel Henrique Barboza ---

Re: [PATCH 09/15] hw/riscv/boot.c: use MachineState in riscv_load_initrd()

2022-12-22 Thread Philippe Mathieu-Daudé
On 21/12/22 19:22, Daniel Henrique Barboza wrote: 'filename', 'mem_size' and 'fdt' from riscv_load_initrd() can all be retrieved by the MachineState object for all callers. Cc: Palmer Dabbelt Signed-off-by: Daniel Henrique Barboza --- hw/riscv/boot.c| 6 -- hw/riscv/microchi

Re: [PATCH 10/15] hw/riscv/boot.c: use MachineState in riscv_load_kernel()

2022-12-22 Thread Philippe Mathieu-Daudé
On 21/12/22 19:22, Daniel Henrique Barboza wrote: All callers are using kernel_filename as machine->kernel_filename. This will also simplify the changes in riscv_load_kernel() that we're going to do next. Cc: Palmer Dabbelt Signed-off-by: Daniel Henrique Barboza --- hw/riscv/boot.c

Re: [PATCH 12/15] hw/riscv/boot.c: make riscv_load_initrd() static

2022-12-22 Thread Philippe Mathieu-Daudé
On 21/12/22 19:22, Daniel Henrique Barboza wrote: The only remaining caller is riscv_load_kernel() which belongs to the same file. Signed-off-by: Daniel Henrique Barboza --- hw/riscv/boot.c | 76 - include/hw/riscv/boot.h | 1 - 2 files chang

[PATCH 5/5] hw/net/igb: build support for igb/igbvf devices

2022-12-22 Thread Sriram Yagnaraman
Signed-off-by: Sriram Yagnaraman --- hw/i386/Kconfig| 1 + hw/net/Kconfig | 5 + hw/net/igb_core.c | 4 +--- hw/net/meson.build | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index d22ac4a4b9..97a0b08842 100644 --- a/hw/i386/K

[PATCH 1/5] pcie: add helper function to get number of VFs

2022-12-22 Thread Sriram Yagnaraman
Signed-off-by: Sriram Yagnaraman --- hw/pci/pcie_sriov.c | 6 ++ include/hw/pci/pcie_sriov.h | 5 + 2 files changed, 11 insertions(+) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index 8e3faf1f59..88ba642a20 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@

[PATCH 3/5] hw/net/igb: register definitions

2022-12-22 Thread Sriram Yagnaraman
Signed-off-by: Sriram Yagnaraman --- hw/net/e1000_regs.h| 363 + hw/net/e1000x_common.c | 13 ++ hw/net/e1000x_common.h | 29 3 files changed, 376 insertions(+), 29 deletions(-) diff --git a/hw/net/e1000_regs.h b/hw/net/e1000_regs.h index 59e050

[PATCH 0/5] hw/net/igb: emulated network device with SR-IOV

2022-12-22 Thread Sriram Yagnaraman
A new attempt at adding support for Intel 82576 Gigabit Ethernet adapter with SR-IOV support. Start qemu with the following parameters. qemu-system-x86_64 -enable-kvm -M q35 \ ... -device pcie-root-port,slot=3,id=pcie_port.3 \ -netdev tap,id=net3,script=no,downscript=/tmp/rmtap,ifname=

[PATCH 2/5] hw/net/net_tx_pkt: helper function to get l2 hdr

2022-12-22 Thread Sriram Yagnaraman
Also add return value for to send functions Signed-off-by: Sriram Yagnaraman --- hw/net/net_tx_pkt.c | 17 +++-- hw/net/net_tx_pkt.h | 8 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index 1cb1125d9f..f2e14008b6 1

Re: [PATCH v9 08/14] hw/nvram: NPCM7xx OTP device model

2022-12-22 Thread Philippe Mathieu-Daudé
Hi, (old patch) On 11/9/20 07:20, Havard Skinnemoen wrote: This supports reading and writing OTP fuses and keys. Only fuse reading has been tested. Protection is not implemented. Reviewed-by: Avi Fishman Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Tested-by: Alexan

[PATCH v1 2/2] s390x/pv: Add support for asynchronous teardown for reboot

2022-12-22 Thread Claudio Imbrenda
This patch adds support for the asynchronous teardown for reboot for protected VMs. When attempting to tear down a protected VM, try to use the new asynchronous interface first. If that fails, fall back to the classic synchronous one. The asynchronous interface involves invoking the new KVM_PV_AS

[PATCH v1 0/2] s390x/pv: Add support for asynchronous teardown for reboot

2022-12-22 Thread Claudio Imbrenda
The first patch is just a minimal header update to compile the second patch; it can be safely discarded once the Linux headers are updated to 6.2. The second patch adds support for asynchronous teardown of protected guests when rebooting. First the existing guest is prepared for asynchronous teard

[PATCH v1 1/2] Linux header update

2022-12-22 Thread Claudio Imbrenda
Signed-off-by: Claudio Imbrenda --- linux-headers/linux/kvm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index ebdafa576d..122b273433 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -1175,6 +1175,7 @@ stru

Re: [PATCH 02/15] hw/riscv/spike: use 'fdt' from MachineState

2022-12-22 Thread Daniel Henrique Barboza
On 12/22/22 11:25, Philippe Mathieu-Daudé wrote: On 21/12/22 19:22, Daniel Henrique Barboza wrote: The MachineState object provides a 'fdt' pointer that is already being used by other RISC-V machines, and it's also used by the 'dumpdtb' QMP command. Remove the 'fdt' pointer from SpikeState a

Re: [PATCH 01/15] tests/avocado: add RISC-V opensbi boot test

2022-12-22 Thread Anup Patel
On Thu, Dec 22, 2022 at 6:27 PM Bin Meng wrote: > > On Thu, Dec 22, 2022 at 6:47 PM Daniel Henrique Barboza > wrote: > > > > > > > > On 12/22/22 07:24, Bin Meng wrote: > > > On Thu, Dec 22, 2022 at 2:29 AM Daniel Henrique Barboza > > > wrote: > > >> This test is used to do a quick sanity check t

[PATCH] nubus-device: fix memory leak in nubus_device_realize

2022-12-22 Thread Mauro Matteo Cascella
Local variable "name" is allocated through strdup_printf and should be freed with g_free() to avoid memory leak. Fixes: 3616f424 ("nubus-device: add romfile property for loading declaration ROMs") Signed-off-by: Mauro Matteo Cascella --- hw/nubus/nubus-device.c | 1 + 1 file changed, 1 insertio

Re: [PATCH] nubus-device: fix memory leak in nubus_device_realize

2022-12-22 Thread Laurent Vivier
Le 22/12/2022 à 18:29, Mauro Matteo Cascella a écrit : Local variable "name" is allocated through strdup_printf and should be freed with g_free() to avoid memory leak. Fixes: 3616f424 ("nubus-device: add romfile property for loading declaration ROMs") Signed-off-by: Mauro Matteo Cascella ---

Re: [PATCH v10 1/9] mm: Introduce memfd_restricted system call to create restricted user memory

2022-12-22 Thread Sean Christopherson
On Wed, Dec 21, 2022, Chao Peng wrote: > On Tue, Dec 20, 2022 at 08:33:05AM +, Huang, Kai wrote: > > On Tue, 2022-12-20 at 15:22 +0800, Chao Peng wrote: > > > On Mon, Dec 19, 2022 at 08:48:10AM +, Huang, Kai wrote: > > > > On Mon, 2022-12-19 at 15:53 +0800, Chao Peng wrote: > > But for non-

[PATCH] linux-user: Add strace for prlimit64() syscall

2022-12-22 Thread Helge Deller
Add proper prlimit64() strace output. Signed-off-by: Helge Deller --- linux-user/strace.c| 89 ++ linux-user/strace.list | 3 +- 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 3ea91084fb.

Re: [PATCH v2 0/7] include/hw/pci include/hw/cxl: Clean up includes

2022-12-22 Thread Michael S. Tsirkin
On Thu, Dec 22, 2022 at 11:48:25AM +0100, Markus Armbruster wrote: > Bernhard Beschow writes: > > > Am 22. Dezember 2022 10:03:23 UTC schrieb Markus Armbruster > > : > >>Back in 2016, we discussed[1] rules for headers, and these were > >>generally liked: > >> > >>1. Have a carefully curated head

Re: [PULL 0/6] testing updates

2022-12-22 Thread Alex Bennée
Peter Maydell writes: > On Wed, 21 Dec 2022 at 14:40, Alex Bennée wrote: >> >> The following changes since commit 8540a1f69578afb3b37866b1ce5bec46a9f6efbc: >> >> Merge tag 'hppa-fixes-pull-request' of >> https://github.com/hdeller/qemu-hppa into staging (2022-12-20 >> 15:32:27 +) >> >> a

Re: [PULL 0/6] testing updates

2022-12-22 Thread Alex Bennée
"Mukilan Thiyagarajan (QUIC)" writes: > I believe the error is caused by the QEMU_JOB_ONLY_FORKS: 1 line > which needs to be removed from the definition of hexagon-cross-container. > > Alex, Peter, > > Shall I raise a patch to remove this line? Should the patch be > created against the testing

[PATCH v4 06/12] libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant

2022-12-22 Thread Marcel Holtmann
The assignment of dev->postcopy_ufd can be moved into an else clause and then the code becomes C90 compliant. CC libvhost-user.o libvhost-user.c: In function ‘vu_set_postcopy_advise’: libvhost-user.c:1625:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-sta

[PATCH v4 01/12] libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU

2022-12-22 Thread Marcel Holtmann
Then the libvhost-user sources are used by another project, it can not be guaranteed that _GNU_SOURCE is set by the build system. If it is for example not set, errors like this show up. CC libvhost-user.o libvhost-user.c: In function ‘vu_panic’: libvhost-user.c:195:9: error: implicit decla

Re: [PATCH v3 02/10] libvhost-user: Replace typeof with __typeof__

2022-12-22 Thread Marcel Holtmann
Hi Paolo, >> Strictly speaking only -std=gnu99 support the usage of typeof and for >> easier inclusion in external projects, it is better to use __typeof__. >> CC libvhost-user.o >> libvhost-user.c: In function ‘vu_log_queue_fill’: >> libvhost-user.c:86:13: error: implicit declaration of f

[PATCH v4 10/12] libvhost-user: Fix assignment in vring_set_avail_event

2022-12-22 Thread Marcel Holtmann
Since it was proposed to change the code in libvduse.c to use memcpy instead of an assignment, the code in libvhost-user.c should also be changed to use memcpy. Signed-off-by: Marcel Holtmann Suggested-by: Paolo Bonzini --- subprojects/libvhost-user/libvhost-user.c | 5 ++--- 1 file changed, 2

[PATCH v4 11/12] libvhost-user: Add extra compiler warnings

2022-12-22 Thread Marcel Holtmann
In case libvhost-user is used externally, that projects compiler warnings might be more strict. Enforce an extra set of compiler warnings to catch issues early on. Signed-off-by: Marcel Holtmann Suggested-by: Paolo Bonzini --- subprojects/libvhost-user/meson.build | 8 +++- 1 file changed,

Re: [PATCH v3 10/10] libvduse: Fix assignment in vring_set_avail_event

2022-12-22 Thread Marcel Holtmann
Hi Paolo, >> static inline void vring_set_avail_event(VduseVirtq *vq, uint16_t val) >> { >> -*((uint16_t *)&vq->vring.used->ring[vq->vring.num]) = htole16(val); >> +uint16_t *avail; >> + >> +avail = (uint16_t *)&vq->vring.used->ring[vq->vring.num]; >> +*avail = htole16(val); > >

[PATCH v4 12/12] libvduse: Add extra compiler warnings

2022-12-22 Thread Marcel Holtmann
In case libvhost-user is used externally, that projects compiler warnings might be more strict. Enforce an extra set of compiler warnings to catch issues early on. Signed-off-by: Marcel Holtmann Suggested-by: Paolo Bonzini --- subprojects/libvduse/meson.build | 8 +++- 1 file changed, 7 ins

[PATCH v4 08/12] libvduse: Switch to unsigned int for inuse field in struct VduseVirtq

2022-12-22 Thread Marcel Holtmann
It seems there is no need to keep the inuse field signed and end up with compiler warnings for sign-compare. CC libvduse.o libvduse.c: In function ‘vduse_queue_pop’: libvduse.c:789:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign

[PATCH v4 09/12] libvduse: Fix assignment in vring_set_avail_event

2022-12-22 Thread Marcel Holtmann
Since the assignment is causing a compiler warning, fix it by using memcpy instead. CC libvduse.o libvduse.c: In function ‘vring_set_avail_event’: libvduse.c:603:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasin] 603 | *((uint16_t *

[PATCH v4 02/12] libvhost-user: Replace typeof with __typeof__

2022-12-22 Thread Marcel Holtmann
Strictly speaking only -std=gnu99 support the usage of typeof and for easier inclusion in external projects, it is better to use __typeof__. CC libvhost-user.o libvhost-user.c: In function ‘vu_log_queue_fill’: libvhost-user.c:86:13: error: implicit declaration of function ‘typeof’ [-Werro

[PATCH v4 03/12] libvhost-user: Cast rc variable to avoid compiler warning

2022-12-22 Thread Marcel Holtmann
The assert from recvmsg() return value against an uint32_t size field from a protocol struct throws a compiler warning. CC libvhost-user.o In file included from libvhost-user.c:27: libvhost-user.c: In function ‘vu_message_read_default’: libvhost-user.c:363:19: error: comparison of integer

[PATCH v4 05/12] libvhost-user: Declare uffdio_register early to make it C90 compliant

2022-12-22 Thread Marcel Holtmann
When using libvhost-user source in an external project that wants to comply with the C90 standard, it is best to declare variables before code. CC libvhost-user.o libvhost-user.c: In function ‘generate_faults’: libvhost-user.c:683:9: error: ISO C90 forbids mixed declarations and code [-We

  1   2   >