Re: [PATCH 1/5] include/hw/pci: Clean up superfluous inclusion of pci*/*.h cxl/*.h

2022-12-09 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Fri, Dec 09, 2022 at 02:47:58PM +0100, Markus Armbruster wrote: >> Signed-off-by: Markus Armbruster > > Thanks! > How can I verify this is correct, i.e. that none > of the headers that we remove is actually needed? I think the pragmatic way forward is to let

Re: [PATCH 6/5] include/hw/cxl: Break inclusion loop

2022-12-09 Thread Markus Armbruster
Markus Armbruster writes: > hw/cxl/cxl_pci.h and hw/cxl/cxl_cdat.h include each other. Neither > header actually needs the other one. Drop both #include directives. > > Signed-off-by: Markus Armbruster > --- > include/hw/cxl/cxl_cdat.h | 1 - > include/hw/cxl/cxl_pci.h | 1 - > 2 files

Re: Target-dependent include path, why?

2022-12-09 Thread Paolo Bonzini
Il ven 9 dic 2022, 20:54 Peter Maydell ha scritto: > > - placing pkg-config output directly in $(QEMU_CFLAGS) and $(LIBS). > > This caused binaries to have unnecessary dependencies at times. > > Yeah, this is what I think of as "the standard thing". > Got it, and it wasn't exactly what QEMU was

Re: CVMSEG Emulation

2022-12-09 Thread Jiaxun Yang
> 2022年12月9日 17:44,Christopher Wrogg 写道: > > I tried both. > > Option 1 > What I did: > #undef TARGET_VIRT_ADDR_SPACE_BITS and #define > TARGET_VIRT_ADDR_SPACE_BITS 64 > The Result: > perror reports "Cannot allocate memory" > Option 2: > What I did: >

[PATCH] s390x/pci: reset ISM passthrough devices on shutdown and system reset

2022-12-09 Thread Matthew Rosato
ISM device firmware stores unique state information that can can cause a wholesale unmap of the associated IOMMU (e.g. when we get a termination signal for QEMU) to trigger firmware errors because firmware believes we are attempting to invalidate entries that are still in-use by the guest OS (when

Re: Target-dependent include path, why?

2022-12-09 Thread Peter Maydell
On Fri, 9 Dec 2022 at 17:42, Paolo Bonzini wrote: > > On 12/9/22 17:52, Peter Maydell wrote: > >> Dependencies are usually added near the .c files that use them. That's > >> a bit messy of course if you have an "#include <>" in a heavily-included > >> QEMU header. You can consider it a way to

Re: [RFC PATCH] test-bdrv-drain: keep graph manipulations out of coroutines

2022-12-09 Thread Kevin Wolf
Am 09.12.2022 um 13:20 hat Emanuele Giuseppe Esposito geschrieben: > Am 09/12/2022 um 13:18 schrieb Emanuele Giuseppe Esposito: > > Am 05/12/2022 um 14:01 schrieb Kevin Wolf: > >> I wonder if we need a more general solution for this because this test > >> is not the only place that calls this kind

Re: [PATCH v1 23/24] vfio-user: add coalesced posted writes

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:45PM -0800, John Johnson wrote: > Add new message to send multiple writes to server LGTM - but maybe commit message could have some context as to why this is useful? Reviewed-by: John Levon regards john

Re: [PATCH v1 22/24] vfio-user: add 'x-msg-timeout' option that specifies msg wait times

2022-12-09 Thread John Levon
LGTM Reviewed-by: John Levon regards john

Re: [PATCH v1 21/24] vfio-user: pci reset

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:43PM -0800, John Johnson wrote: > Message to tell the server to reset the device. LGTM Reviewed-by: John Levon regards john

Re: [PATCH v1 20/24] vfio-user: dma read/write operations

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:42PM -0800, John Johnson wrote: > static void vfio_user_pci_process_req(void *opaque, VFIOUserMsg *msg) > { > +VFIOPCIDevice *vdev = opaque; > +VFIOUserHdr *hdr = msg->hdr; > + > +/* no incoming PCI requests pass FDs */ > +if (msg->fds != NULL) { >

Re: [PATCH v1 19/24] vfio-user: secure DMA support

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:41PM -0800, John Johnson wrote: > Secure DMA forces the remote process to use DMA r/w messages > instead of directly mapping guest memeory. I don't really get why this is called "secure" - shouldn't have an option name more closely resembling what it actually does?

Re: [PATCH v1 18/24] vfio-user: add dma_unmap_all

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:40PM -0800, John Johnson wrote: > Signed-off-by: John G Johnson > Signed-off-by: Elena Ufimtseva > Signed-off-by: Jagannathan Raman > --- > +static int vfio_user_io_dirty_bitmap(VFIOContainer *container, > +struct

Re: [PATCH v1 16/24] vfio-user: proxy container connect/disconnect

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:38PM -0800, John Johnson wrote: > +/* > + * The proxy uses a SW IOMMU in lieu of the HW one > + * used in the ioctl() version. Mascarade as TYPE1 > + * for maximum capatibility > + */ capability > @@ -3692,12 +3698,18 @@ static void

Re: CVMSEG Emulation

2022-12-09 Thread Christopher Wrogg
I tried both. Option 1 What I did: #undef TARGET_VIRT_ADDR_SPACE_BITS and #define TARGET_VIRT_ADDR_SPACE_BITS 64 The Result: perror reports "Cannot allocate memory" Option 2: What I did: TARGET_VIRT_ADDR_SPACE_BITS for me is 30 so I masked by 0x3FFF The

Re: [PATCH v1 15/24] vfio-user: forward msix BAR accesses to server

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:37PM -0800, John Johnson wrote: > Server holds device current device pending state > Use irq masking commands in socket case As far as I'm able to tell, this looks good to me regards john

Re: [PATCH-for-8.0 2/3] hw/intc: Move omap_lcdc.c out of target-specific source set

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 18:21, Thomas Huth wrote: On 09/12/2022 18.00, Philippe Mathieu-Daudé wrote: The Goldfish interrupt controller is not target specific. It's also only used by m68k which is only built once, so this does help reducing the compile time ... but I agree, it will be more helpful in the

Re: Target-dependent include path, why?

2022-12-09 Thread Paolo Bonzini
On 12/9/22 17:52, Peter Maydell wrote: Dependencies are usually added near the .c files that use them. That's a bit messy of course if you have an "#include <>" in a heavily-included QEMU header. You can consider it a way to discourage heavily-included headers. This has always seemed to me to

Re: [PATCH-for-8.0 3/3] hw/tpm: Move tpm_ppc.c out of target-specific source set

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 18:14, Thomas Huth wrote: On 09/12/2022 18.00, Philippe Mathieu-Daudé wrote: The TPM Physical Presence Interface is not target specific. Build this file once for all targets. Signed-off-by: Philippe Mathieu-Daudé ---   hw/tpm/meson.build | 4 ++--   1 file changed, 2 insertions(+),

Re: [PATCH v1 14/24] vfio-user: get and set IRQs

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:36PM -0800, John Johnson wrote: > +static int vfio_user_io_get_irq_info(VFIODevice *vbasedev, > + struct vfio_irq_info *irq) > +{ > +int ret; > + > +ret = vfio_user_get_irq_info(vbasedev->proxy, irq); > +if (ret) { > +

Re: [PATCH-for-8.0 2/3] hw/intc: Move omap_lcdc.c out of target-specific source set

2022-12-09 Thread Thomas Huth
On 09/12/2022 18.00, Philippe Mathieu-Daudé wrote: The Goldfish interrupt controller is not target specific. It's also only used by m68k which is only built once, so this does help reducing the compile time ... but I agree, it will be more helpful in the future the more code we move to

Re: [PATCH v1 13/24] vfio-user: pci_user_realize PCI setup

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:35PM -0800, John Johnson wrote: > PCI BARs read from remote device > PCI config reads/writes sent to remote server Reviewed-by: John Levon regards john

Re: [PATCH-for-8.0 3/3] hw/tpm: Move tpm_ppc.c out of target-specific source set

2022-12-09 Thread Thomas Huth
On 09/12/2022 18.00, Philippe Mathieu-Daudé wrote: The TPM Physical Presence Interface is not target specific. Build this file once for all targets. Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH v1 12/24] vfio-user: region read/write

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:34PM -0800, John Johnson wrote: > Add support for posted writes on remote devices LGTM Reviewed-by: John Levon regards john

Re: [PATCH v1 11/24] vfio-user: get region info

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:33PM -0800, John Johnson wrote: > Add per-region FD to support mmap() of remote device regions > > +/* > + * VFIO_USER_DEVICE_GET_REGION_INFO > + * imported from struct_vfio_region_info s/struct_vfio_region_info/struct vfio_region_info/ regards john

Re: [PATCH 1/5] include/hw/pci: Clean up superfluous inclusion of pci*/*.h cxl/*.h

2022-12-09 Thread Michael S. Tsirkin
On Fri, Dec 09, 2022 at 02:47:58PM +0100, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster Thanks! How can I verify this is correct, i.e. that none of the headers that we remove is actually needed? > --- > hw/alpha/alpha_sys.h | 1 - > hw/rdma/rdma_utils.h

[PATCH-for-8.0 2/3] hw/intc: Move omap_lcdc.c out of target-specific source set

2022-12-09 Thread Philippe Mathieu-Daudé
The Goldfish interrupt controller is not target specific. While the Exynos interrupt combiner is only used by the ARM targets, we can build this device once for all. Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH-for-8.0 3/3] hw/tpm: Move tpm_ppc.c out of target-specific source set

2022-12-09 Thread Philippe Mathieu-Daudé
The TPM Physical Presence Interface is not target specific. Build this file once for all targets. Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/tpm/meson.build b/hw/tpm/meson.build index

[PATCH-for-8.0 1/3] hw/display: Move omap_lcdc.c out of target-specific source set

2022-12-09 Thread Philippe Mathieu-Daudé
While only used by the ARM targets, this device can be built once for all. Signed-off-by: Philippe Mathieu-Daudé --- hw/display/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/meson.build b/hw/display/meson.build index 7a725ed80e..2cab7a8ff2 100644 ---

[PATCH-for-8.0 0/3] hw: Move few units out of the target-specific source set

2022-12-09 Thread Philippe Mathieu-Daudé
With this series my '--enable-tcg --enable-system' config reduced from 7713 to 7706 objects! Philippe Mathieu-Daudé (3): hw/display: Move omap_lcdc.c out of target-specific source set hw/intc: Move omap_lcdc.c out of target-specific source set hw/tpm: Move tpm_ppc.c out of target-specific

Re: [PATCH v2 14/15] block: Don't poll in bdrv_replace_child_noperm()

2022-12-09 Thread Paolo Bonzini
On 11/18/22 18:41, Kevin Wolf wrote: In order to make sure that bdrv_replace_child_noperm() doesn't have to poll any more, get rid of the bdrv_parent_drained_begin_single() call. This is possible now because we can require that the parent is already drained through the child in question when

Re: Target-dependent include path, why?

2022-12-09 Thread Peter Maydell
On Fri, 9 Dec 2022 at 16:49, Paolo Bonzini wrote: > > On 12/9/22 09:51, Markus Armbruster wrote: > >> Because of where [pixman] is added as a dependency in meson.build. > > > > Is it added where it is for a reason, or is it accidental? > > Dependencies are usually added near the .c files that use

Re: Target-dependent include path, why?

2022-12-09 Thread Paolo Bonzini
On 12/9/22 09:51, Markus Armbruster wrote: Because of where [pixman] is added as a dependency in meson.build. Is it added where it is for a reason, or is it accidental? Dependencies are usually added near the .c files that use them. That's a bit messy of course if you have an "#include <>"

[PATCH-for-8.0] tests/vm: Update get_default_jobs() to work on non-x86_64 non-KVM hosts

2022-12-09 Thread Philippe Mathieu-Daudé
On non-x86_64 host, if KVM is not available we get: Traceback (most recent call last): File "tests/vm/basevm.py", line 634, in main vm = vmcls(args, config=config) File "tests/vm/basevm.py", line 104, in __init__ mem = max(4, args.jobs) TypeError: '>' not supported between

Re: [PATCH 03/30] configure: remove useless test

2022-12-09 Thread Paolo Bonzini
On 12/9/22 12:34, Peter Maydell wrote: -# Using uname is really, really broken. Once we have the right set of checks -# we can eliminate its usage altogether. I note that the fallback if we match no #defines is still "use uname". We can only get rid of that if we're willing to say "must be a

[PATCH] hostmem: Honour multiple preferred nodes if possible

2022-12-09 Thread Michal Privoznik
If a memory-backend is configured with mode HOST_MEM_POLICY_PREFERRED then host_memory_backend_memory_complete() calls mbind() as: mbind(..., MPOL_PREFERRED, nodemask, ...); Here, 'nodemask' is a bitmap of host NUMA nodes and corresponds to the .host-nodes attribute. Therefore, there can be

Re: [PATCH 19/30] configure, meson: move --enable-debug-info to Meson

2022-12-09 Thread Paolo Bonzini
On 12/9/22 15:21, Philippe Mathieu-Daudé wrote: On 9/12/22 14:54, Paolo Bonzini wrote: On 12/9/22 13:55, Philippe Mathieu-Daudé wrote: +  printf "%s\n" '  --disable-debug-info Enable debug symbols and other information' We should get '--enable-debug-info' here, ...     printf "%s\n" ' 

Re: [PATCH 27/30] build: move compiler version check to meson

2022-12-09 Thread Paolo Bonzini
On 12/9/22 15:19, Peter Maydell wrote: I think really I just don't want a check that is "we happen to know that this particular option switch is supported only from these versions onward", because as soon as we say "OK, we can move forward to a clang 7 baseline" we either need to search around

Re: [PATCH v1 03/24] vfio-user: add container IO ops vector

2022-12-09 Thread Cédric Le Goater
Hello John, On 11/9/22 00:13, John Johnson wrote: Used for communication with VFIO driver (prep work for vfio-user, which will communicate over a socket) Signed-off-by: John G Johnson --- hw/vfio/common.c | 126 --

Re: [PATCH v1 02/24] vfio-user: add VFIO base abstract class

2022-12-09 Thread Cédric Le Goater
Hello John, On 11/9/22 00:13, John Johnson wrote: Add an abstract base class both the kernel driver and user socket implementations can use to share code. Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman I would help the reader if the header

Re: [RFC PATCH-for-8.0] target/arm: Keep "internals.h" internal to target/arm/

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 16:19, Richard Henderson wrote: On 12/9/22 05:17, Philippe Mathieu-Daudé wrote: +++ b/target/arm/machine.c @@ -6,6 +6,45 @@   #include "internals.h"   #include "migration/cpu.h" +/* This mapping is common between ID_AA64MMFR0.PARANGE and TCR_ELx.{I}PS. */ +static const uint8_t

Re: Target-dependent include path, why?

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 16:02, Richard Henderson wrote: On 12/9/22 02:51, Markus Armbruster wrote: Richard Henderson writes: On 12/8/22 23:12, Markus Armbruster wrote: I stumbled over this:   ../include/ui/qemu-pixman.h:12:10: fatal error: pixman.h: No such file or directory 12 | #include

Re: [PATCH v1 10/24] vfio-user: get device info

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:32PM -0800, John Johnson wrote: > +/* > + * VFIO_USER_DEVICE_GET_INFO > + * imported from struct_device_info > + */ > +typedef struct { > +VFIOUserHdr hdr; > +uint32_t argsz; > +uint32_t flags; > +uint32_t num_regions; > +uint32_t num_irqs; > +

Re: [PATCH v1 09/24] vfio-user: define socket send functions

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:31PM -0800, John Johnson wrote: > Also negotiate protocol version with remote server LGTM Reviewed-by: John Levon regards john

Re: [PATCH v13 2/7] s390x/cpu topology: reporting the CPU topology to the guest

2022-12-09 Thread Cédric Le Goater
On 12/8/22 10:44, Pierre Morel wrote: The guest uses the STSI instruction to get information on the CPU topology. Let us implement the STSI instruction for the basis CPU topology level, level 2. Signed-off-by: Pierre Morel --- target/s390x/cpu.h | 76 +

Re: [PATCH v1 08/24] vfio-user: define socket receive functions

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:30PM -0800, John Johnson wrote: > Add infrastructure needed to receive incoming messages > > +static void vfio_user_process(VFIOProxy *proxy, VFIOUserMsg *msg, bool > isreply) > +{ > + > +/* > + * Replies signal a waiter, if none just check for errors > +

Re: [PATCH-for-8.0] softmmu: Extract watchpoint API from physmem.c

2022-12-09 Thread Philippe Mathieu-Daudé
+Peter/Laurent On 9/12/22 15:12, Philippe Mathieu-Daudé wrote: The watchpoint API is specific to TCG system emulation. Move it to a new compile unit. The inlined stubs are used for user-mode and non-TCG accelerators. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 +

Re: [PATCH v2 0/3] Decouple INTx-to-LNKx routing from south bridges

2022-12-09 Thread Philippe Mathieu-Daudé
On 20/11/22 16:05, Bernhard Beschow wrote: v1: === During my PIIX consolidation work [1] I've noticed that both PIIX models have quite different pci_slot_get_pirq() implementations. These functions seem to map PCI INTx pins to input pins of a programmable interrupt router which is AFAIU

Re: [PATCH v1 07/24] vfio-user: connect vfio proxy to remote server

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:29PM -0800, John Johnson wrote: > add user.c & user.h files for vfio-user code > add proxy struct to handle comms with remote server LGTM Reviewed-by: John Levon regards john

Re: [PATCH v1 06/24] vfio-user: Define type vfio_user_pci_dev_info

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:28PM -0800, John Johnson wrote: > New class for vfio-user with its class and instance > constructors and destructors, and its pci ops. LGTM Reviewed-by: John Levon regards john

Re: [RFC PATCH-for-8.0] target/arm: Keep "internals.h" internal to target/arm/

2022-12-09 Thread Richard Henderson
On 12/9/22 05:17, Philippe Mathieu-Daudé wrote: +++ b/target/arm/machine.c @@ -6,6 +6,45 @@ #include "internals.h" #include "migration/cpu.h" +/* This mapping is common between ID_AA64MMFR0.PARANGE and TCR_ELx.{I}PS. */ +static const uint8_t pamax_map[] = { +[0] = 32, +[1] = 36,

[PATCH-for-8.0 3/7] hw/mips/gt64xxx_pci: Manage endian bits with the RegisterField API

2022-12-09 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/gt64xxx_pci.c | 37 + 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index 1b9ac7f792..8c9ec80f7c 100644 --- a/hw/mips/gt64xxx_pci.c +++

[PATCH-for-8.0 7/7] hw/mips/gt64xxx_pci: Move it to hw/pci-host/

2022-12-09 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé The GT-64120 is a north-bridge, and it is not MIPS specific. Move it with the other north-bridge devices. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 +- hw/mips/Kconfig | 6 --

[PATCH-for-8.0 0/7] hw/mips: Make gt64xxx_pci.c endian-agnostic

2022-12-09 Thread Philippe Mathieu-Daudé
Respining an old/unfinished series... Add the 'cpu-little-endian' qdev property to the GT64120 north bridge so [target-specific] machines can set its endianness, allowing it to be endian agnostic. Philippe Mathieu-Daudé (7): hw/mips/Kconfig: Introduce CONFIG_GT64120 to select gt64xxx_pci.c

[PATCH-for-8.0 6/7] hw/mips/meson: Make gt64xxx_pci.c endian-agnostic

2022-12-09 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé The single machine using this device explicitly sets its endianness. We don't need to set a default. This allow us to remove the target specificity from the build system. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/gt64xxx_pci.c | 2 +- hw/mips/meson.build

[PATCH-for-8.0 5/7] hw/mips/malta: Explicit GT64120 endianness upon device creation

2022-12-09 Thread Philippe Mathieu-Daudé
Propagate the controller endianess from the machine, setting the "cpu-little-endian" property. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/malta.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index ba92022f87..1f4e0c7acc 100644

[PATCH-for-8.0 4/7] hw/mips/gt64xxx_pci: Add a 'cpu-little-endian' qdev property

2022-12-09 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé This device does not have to be TARGET-dependent. Add a 'cpu_big_endian' property which sets the byte-swapping options if required. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/gt64xxx_pci.c | 19 ++- 1 file changed, 14 insertions(+), 5

[PATCH-for-8.0 2/7] hw/mips/gt64xxx_pci: Let the GT64120 manage the lower 512MiB hole

2022-12-09 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Per the comment in the Malta board, the [0x.-0x2000.] range is decoded by the GT64120, so move the "empty_slot" there. Signed-off-by: Philippe Mathieu-Daudé --- configs/devices/mips-softmmu/common.mak | 1 - hw/mips/Kconfig | 1

[PATCH-for-8.0 1/7] hw/mips/Kconfig: Introduce CONFIG_GT64120 to select gt64xxx_pci.c

2022-12-09 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/Kconfig | 6 ++ hw/mips/meson.build | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/mips/Kconfig b/hw/mips/Kconfig index 725525358d..d6bbbe7069 100644 --- a/hw/mips/Kconfig +++

[PATCH 6/5] include/hw/cxl: Break inclusion loop

2022-12-09 Thread Markus Armbruster
hw/cxl/cxl_pci.h and hw/cxl/cxl_cdat.h include each other. Neither header actually needs the other one. Drop both #include directives. Signed-off-by: Markus Armbruster --- include/hw/cxl/cxl_cdat.h | 1 - include/hw/cxl/cxl_pci.h | 1 - 2 files changed, 2 deletions(-) diff --git

Re: Target-dependent include path, why?

2022-12-09 Thread Richard Henderson
On 12/9/22 02:51, Markus Armbruster wrote: Richard Henderson writes: On 12/8/22 23:12, Markus Armbruster wrote: I stumbled over this: ../include/ui/qemu-pixman.h:12:10: fatal error: pixman.h: No such file or directory 12 | #include | ^~ Works

Re: [PATCH v13 4/7] s390x/cpu_topology: CPU topology migration

2022-12-09 Thread Cédric Le Goater
On 12/8/22 10:44, Pierre Morel wrote: The migration can only take place if both source and destination of the migration both use or both do not use the CPU topology facility. We indicate a change in topology during migration postload for the case the topology changed between source and

Re: [PATCH v13 1/7] s390x/cpu topology: Creating CPU topology device

2022-12-09 Thread Cédric Le Goater
On 12/8/22 10:44, Pierre Morel wrote: We will need a Topology device to transfer the topology during migration and to implement machine reset. The device creation is fenced by s390_has_topology(). Some of the info you gave in the cover letter would help the reader of this commit log.

Re: [PATCH v13 0/7] s390x: CPU Topology

2022-12-09 Thread Cédric Le Goater
On 12/8/22 10:44, Pierre Morel wrote: Hi, Implementation discussions == CPU models -- Since the S390_FEAT_CONFIGURATION_TOPOLOGY is already in the CPU model for old QEMU we could not activate it as usual from KVM but needed a KVM capability:

Re: [PATCH v1 05/24] vfio-user: add device IO ops vector

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:27PM -0800, John Johnson wrote: > Used for communication with VFIO driver > (prep work for vfio-user, which will communicate over a socket) > > @@ -1166,12 +1178,13 @@ uint32_t vfio_pci_read_config(PCIDevice *pdev, > uint32_t addr, int len) > if (~emu_bits &

Re: [External] Re: [RFC PATCH] migration: reduce time of loading non-iterable vmstate

2022-12-09 Thread Chuang Xu
Hi, Peter! This email is a supplement to my previous email 7 hours ago. On 2022/12/9 上午12:00, Peter Xu wrote: If the assert will work that'll be even better. I'm actually worried this can trigger like what you mentioned in the virtio path, I didn't expect it comes that soon. So if there's a

Re: [PATCH v2 for-8.0] hw/rtc/mc146818rtc: Make this rtc device target independent

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 12:15, Thomas Huth wrote: The only reason for this code being target dependent is the apic-related code in rtc_policy_slew_deliver_irq(). Since these apic functions are rather simple, we can easily move them into a new, separate file (apic_irqcount.c) which will always be compiled and

Re: [PATCH 19/30] configure, meson: move --enable-debug-info to Meson

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 14:54, Paolo Bonzini wrote: On 12/9/22 13:55, Philippe Mathieu-Daudé wrote: +  printf "%s\n" '  --disable-debug-info Enable debug symbols and other information' We should get '--enable-debug-info' here, ...     printf "%s\n" '  --disable-install-blobs  install provided

Re: [PATCH 27/30] build: move compiler version check to meson

2022-12-09 Thread Peter Maydell
On Fri, 9 Dec 2022 at 14:09, Paolo Bonzini wrote: > > On 12/9/22 12:52, Peter Maydell wrote: > > The new code makes it much harder to move our compiler version > > requirements forward in future, because there's no longer a simple > > "check for normal clang X or apple clang Y" test where we can

Re: [PATCH 5/5] include/hw/pci: Include hw/pci/pci.h where needed

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 14:48, Markus Armbruster wrote: 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

Re: [PATCH v1 04/24] vfio-user: add region cache

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:26PM -0800, John Johnson wrote: > cache VFIO_DEVICE_GET_REGION_INFO results to reduce > memory alloc/free cycles and as prep work for vfio-user LGTM Reviewed-by: John Levon regards john

Re: [PATCH 3/5] include/hw/pci: Clean up a few things checkpatch.pl would flag

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

[PATCH-for-8.0] softmmu: Extract watchpoint API from physmem.c

2022-12-09 Thread Philippe Mathieu-Daudé
The watchpoint API is specific to TCG system emulation. Move it to a new compile unit. The inlined stubs are used for user-mode and non-TCG accelerators. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + include/hw/core/cpu.h | 2 +- softmmu/meson.build | 3 +-

Re: [PATCH-for-8.0 v3 1/2] physmem: Remove unused "exec/translate-all.h"

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 12:43, Peter Maydell wrote: On Fri, 9 Dec 2022 at 11:07, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- softmmu/physmem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 1b606a3002..d562c0bb93 100644 ---

Re: [PATCH v1 03/24] vfio-user: add container IO ops vector

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:25PM -0800, John Johnson wrote: > Used for communication with VFIO driver > (prep work for vfio-user, which will communicate over a socket) > index e573f5a..6fd40f1 100644 > --- a/include/hw/vfio/vfio-common.h > +++ b/include/hw/vfio/vfio-common.h > + > +extern

Re: [PATCH 27/30] build: move compiler version check to meson

2022-12-09 Thread Paolo Bonzini
On 12/9/22 12:52, Peter Maydell wrote: The new code makes it much harder to move our compiler version requirements forward in future, because there's no longer a simple "check for normal clang X or apple clang Y" test where we can bump up X and Y based on what's provided in the various host

Re: [PATCH 19/30] configure, meson: move --enable-debug-info to Meson

2022-12-09 Thread Paolo Bonzini
On 12/9/22 13:55, Philippe Mathieu-Daudé wrote: +  printf "%s\n" '  --disable-debug-info Enable debug symbols and other information' We should get '--enable-debug-info' here, ...     printf "%s\n" '  --disable-install-blobs  install provided firmware blobs' ... and here. Do we have a

Re: [PATCH v1 02/24] vfio-user: add VFIO base abstract class

2022-12-09 Thread John Levon
On Tue, Nov 08, 2022 at 03:13:24PM -0800, John Johnson wrote: > Add an abstract base class both the kernel driver > and user socket implementations can use to share code. LGTM Reviewed-by: John Levon regards john

Re: [PATCH v13 1/7] s390x/cpu topology: Creating CPU topology device

2022-12-09 Thread Thomas Huth
On 08/12/2022 10.44, Pierre Morel wrote: We will need a Topology device to transfer the topology during migration and to implement machine reset. The device creation is fenced by s390_has_topology(). Signed-off-by: Pierre Morel --- [...] diff --git a/hw/s390x/cpu-topology.c

[PATCH 2/5] include/hw/cxl: Include hw/cxl/*.h where needed

2022-12-09 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 --- include/hw/cxl/cxl_component.h | 1 + include/hw/cxl/cxl_device.h| 1 + 2 files changed, 2 insertions(+) diff --git

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

2022-12-09 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

[PATCH 3/5] include/hw/pci: Clean up a few things checkpatch.pl would flag

2022-12-09 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 --- include/hw/pci/pci.h | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index

[PATCH 1/5] include/hw/pci: Clean up superfluous inclusion of pci*/*.h cxl/*.h

2022-12-09 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- hw/alpha/alpha_sys.h | 1 - hw/rdma/rdma_utils.h | 1 - hw/rdma/vmw/pvrdma.h | 1 - hw/usb/hcd-ehci.h | 1 - hw/xen/xen_pt.h | 1 - include/hw/cxl/cxl.h | 1 -

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

2022-12-09 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

[PATCH 5/5] include/hw/pci: Include hw/pci/pci.h where needed

2022-12-09 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

Re: [PATCH v13 0/7] s390x: CPU Topology

2022-12-09 Thread Thomas Huth
On 08/12/2022 10.44, Pierre Morel wrote: Hi, Implementation discussions == CPU models -- Since the S390_FEAT_CONFIGURATION_TOPOLOGY is already in the CPU model for old QEMU we could not activate it as usual from KVM but needed a KVM capability:

Re: [PATCH 08/30] meson: require 0.63.0

2022-12-09 Thread Thomas Huth
On 09/12/2022 12.23, Paolo Bonzini wrote: This allows cleanups cleanups in modinfo collection and supports the Scratch one "cleanups" ? equivalent of QEMU's --static option to configure. Signed-off-by: Paolo Bonzini --- configure | 2 +- meson | 2 +- meson.build | 2 +- 3

[PATCH] migration/rdma: fix return value for qio_channel_rdma_{readv, writev}

2022-12-09 Thread Fiona Ebner
upon errors. As the documentation in include/io/channel.h states, only -1 and QIO_CHANNEL_ERR_BLOCK should be returned upon error. Other values have the potential to confuse the call sites. error_setg is used rather than error_setg_errno, because there are certain code paths where -1 (as a

Re: How to best make include/hw/pci/pcie_sriov.h self-contained

2022-12-09 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Wed, Dec 07, 2022 at 07:25:49AM +0100, Markus Armbruster wrote: >> pcie_sriov.h needs PCI_NUM_REGIONS from pci.h, but doesn't include it. >> pci.h must be included before pcie_sriov.h or else compile fails. >> >> Adding #include "pci/pci.h" to pcie_sriov would

[PATCH v12 1/1] vhost-vdpa: add support for vIOMMU

2022-12-09 Thread Cindy Lu
1.Skip the check in vhost_vdpa_listener_skipped_section() while MR is IOMMU, Move this check to vhost_vdpa_iommu_map_notify() 2.Add support for vIOMMU. Add the new function to deal with iommu MR. - during iommu_region_add register a specific IOMMU notifier, and store all notifiers in a list. -

[PATCH v12 0/1] vhost-vdpa: add support for vIOMMU

2022-12-09 Thread Cindy Lu
These patches are to support vIOMMU in vdpa device Verified in vp_vdpa/vdpa_sim_net driverand intel_iommu virtio-iommu device changes in V3 1. Move function vfio_get_xlat_addr to memory.c 2. Use the existing memory listener, while the MR is iommu MR then call the function iommu_region_add/

Re: [PATCH 22/30] build: move SafeStack tests to meson

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 12:24, Paolo Bonzini wrote: This disables the old behavior of detecting SafeStack from environment CFLAGS. SafeStack is now enabled purely based on the configure arguments. Signed-off-by: Paolo Bonzini --- configure | 73 ---

Re: [PATCH 19/30] configure, meson: move --enable-debug-info to Meson

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 12:23, Paolo Bonzini wrote: Older versions of Meson had an unclear description of the -Ddebug option, but this is fixed in 0.63.0 that is required now. Signed-off-by: Paolo Bonzini --- configure | 5 - scripts/meson-buildoptions.py | 2 ++

Re: [PATCH 16/30] build: move glib detection and workarounds to meson

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 12:23, Paolo Bonzini wrote: QEMU adds the path to glib.h is added to all compilation commands. add/add/ not clear... Otherwise: Reviewed-by: Philippe Mathieu-Daudé This is simpler due to the pervasive use of static_library, and was grandfathered in from the previous Make-based

Re: [PATCH-for-8.0] target/arm: Restrict arm_cpu_exec_interrupt() to TCG accelerator

2022-12-09 Thread Fabiano Rosas
Philippe Mathieu-Daudé writes: > When building with --disable-tcg on Darwin we get: > > target/arm/cpu.c:725:16: error: incomplete definition of type 'struct > TCGCPUOps' > cc->tcg_ops->do_interrupt(cs); > ~~~^ > > Commit 083afd18a9 ("target/arm: Restrict cpu_exec_interrupt()

Re: [PATCH 14/30] configure: test all warnings

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 12:23, Paolo Bonzini wrote: Some warnings are hardcoded in QEMU_CFLAGS and not tested. There is no particular reason to single out these five, as many more -W flags are present on all the supported compilers. For homogeneity when moving the detection to meson, make them use the same

[PATCH] target/mips: Add nanoMIPS ISA support in QEMU

2022-12-09 Thread Milica Lazarevic
nanoMIPS ISA support is planned to be maintained. Signed-off-by: Milica Lazarevic --- MAINTAINERS | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 6966490c94..66e083b455 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -237,10 +237,16 @@ R:

Re: [RFC PATCH] test-bdrv-drain: keep graph manipulations out of coroutines

2022-12-09 Thread Emanuele Giuseppe Esposito
Am 09/12/2022 um 13:18 schrieb Emanuele Giuseppe Esposito: > > > Am 05/12/2022 um 14:01 schrieb Kevin Wolf: >> Am 02.12.2022 um 18:22 hat Paolo Bonzini geschrieben: >>> On 12/2/22 14:42, Emanuele Giuseppe Esposito wrote: Am 02/12/2022 um 14:27 schrieb Paolo Bonzini: >

Re: [RFC PATCH] test-bdrv-drain: keep graph manipulations out of coroutines

2022-12-09 Thread Emanuele Giuseppe Esposito
Am 05/12/2022 um 14:01 schrieb Kevin Wolf: > Am 02.12.2022 um 18:22 hat Paolo Bonzini geschrieben: >> On 12/2/22 14:42, Emanuele Giuseppe Esposito wrote: >>> >>> >>> Am 02/12/2022 um 14:27 schrieb Paolo Bonzini: Changes to the BlockDriverState graph will have to take the corresponding

Re: [PATCH 27/30] build: move compiler version check to meson

2022-12-09 Thread Peter Maydell
On Fri, 9 Dec 2022 at 11:40, Paolo Bonzini wrote: > > Instead of checking with preprocessor defines, use the Meson compiler object. > Because of the mess Apple does with its versioning scheme, check for an > option that was added in clang 6.0 instead of looking at the version number. > -# Check

  1   2   >