Re: [PATCH v2 1/1] virgl: Implement resource_query_layout

2024-01-02 Thread Marc-André Lureau
eson.build > +++ b/meson.build > @@ -1058,6 +1058,10 @@ if not get_option('virglrenderer').auto() or > have_system or have_vhost_user_gpu > > cc.has_function('virgl_renderer_resource_create_blob', > prefix: '#include > ', > dependencies: virgl)) > +config_host_data.set('HAVE_VIRGL_RESOURCE_QUERY_LAYOUT', > + > cc.has_function('virgl_renderer_resource_query_layout', > + prefix: '#include > ', > + dependencies: virgl)) >endif > endif > rutabaga = not_found > -- > 2.34.1 > > -- Marc-André Lureau

Re: [PATCH v6 10/11] virtio-gpu: Initialize Venus

2024-01-02 Thread Marc-André Lureau
ENDER_SERVER; > +#endif > + I wonder if it's a good idea to initialize venus by default. It doesn't seem to require vulkan during initialization, but this may evolve. Make it optional? > ret = virgl_renderer_init(g, flags, _gpu_3d_cbs); > if (ret != 0) { > error_report("virgl could not be initialized: %d", ret); > -- > 2.25.1 > -- Marc-André Lureau

Re: [PATCH v6 08/11] virtio-gpu: Resource UUID

2024-01-02 Thread Marc-André Lureau
IO_GPU_FLAG_CONTEXT_INIT_ENABLED)) > #define virtio_gpu_rutabaga_enabled(_cfg) \ > (_cfg.flags & (1 << VIRTIO_GPU_FLAG_RUTABAGA_ENABLED)) > +#define virtio_gpu_resource_uuid_enabled(_cfg) \ > +(_cfg.flags & (1 << VIRTIO_GPU_FLAG_RESOURCE_UUID_ENABLED)) > #define virtio_gpu_hostmem_enabled(_cfg) \ > (_cfg.hostmem > 0) > > @@ -209,6 +212,8 @@ struct VirtIOGPU { > QTAILQ_HEAD(, VGPUDMABuf) bufs; > VGPUDMABuf *primary[VIRTIO_GPU_MAX_SCANOUTS]; > } dmabuf; > + > +GHashTable *resource_uuids; > }; > > struct VirtIOGPUClass { > @@ -307,6 +312,8 @@ void virtio_gpu_cleanup_mapping_iov(VirtIOGPU *g, > struct iovec *iov, uint32_t count); > void virtio_gpu_cleanup_mapping(VirtIOGPU *g, > struct virtio_gpu_simple_resource *res); > +void virtio_gpu_resource_assign_uuid(VirtIOGPU *g, > + struct virtio_gpu_ctrl_command *cmd); > void virtio_gpu_process_cmdq(VirtIOGPU *g); > void virtio_gpu_device_realize(DeviceState *qdev, Error **errp); > void virtio_gpu_reset(VirtIODevice *vdev); > -- > 2.25.1 > -- Marc-André Lureau

Re: [PATCH v6 07/11] virtio-gpu: Handle resource blob commands

2024-01-02 Thread Marc-André Lureau
isplay/virtio-gpu.c b/hw/display/virtio-gpu.c > index 4c3ec9d0ea..8189c392dc 100644 > --- a/hw/display/virtio-gpu.c > +++ b/hw/display/virtio-gpu.c > @@ -1449,10 +1449,12 @@ void virtio_gpu_device_realize(DeviceState *qdev, > Error **errp) > return; > } > > +#ifndef HAVE_VIRGL_RESOURCE_BLOB > if (virtio_gpu_virgl_enabled(g->parent_obj.conf)) { > -error_setg(errp, "blobs and virgl are not compatible (yet)"); > +error_setg(errp, "Linked virglrenderer does not support blob > resources"); > return; > } > +#endif > } > > if (!virtio_gpu_base_device_realize(qdev, > diff --git a/meson.build b/meson.build > index ea52ef1b9c..629407128e 100644 > --- a/meson.build > +++ b/meson.build > @@ -1054,6 +1054,10 @@ if not get_option('virglrenderer').auto() or > have_system or have_vhost_user_gpu > > cc.has_function('virgl_renderer_context_create_with_flags', > prefix: '#include > ', > dependencies: virgl)) > +config_host_data.set('HAVE_VIRGL_RESOURCE_BLOB', > + > cc.has_function('virgl_renderer_resource_create_blob', > + prefix: '#include > ', > + dependencies: virgl)) >endif > endif > rutabaga = not_found > -- > 2.25.1 > -- Marc-André Lureau

Re: [PATCH v6 05/11] virtio-gpu: Introduce virgl_gpu_resource structure

2024-01-02 Thread Marc-André Lureau
irgl_gpu_resource *vres; > > VIRTIO_GPU_FILL_CMD(detach_rb); > trace_virtio_gpu_cmd_res_back_detach(detach_rb.resource_id); > > -virgl_renderer_resource_detach_iov(detach_rb.resource_id, > - _iovs, > - _iovs); > -if (res_iovs == NULL || num_iovs == 0) { > +vres = virgl_gpu_find_resource(g, detach_rb.resource_id); > +if (!vres) { > +cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID; > return; > } > -virtio_gpu_cleanup_mapping_iov(g, res_iovs, num_iovs); > + > +virgl_renderer_resource_detach_iov(detach_rb.resource_id, NULL, NULL); > +virtio_gpu_cleanup_mapping(g, >res); > } > > > -- > 2.25.1 > > -- Marc-André Lureau

Re: [PATCH v6 04/11] virtio-gpu: Don't require udmabuf when blobs and virgl are enabled

2024-01-02 Thread Marc-André Lureau
io Caggiano > Signed-off-by: Dmitry Osipenko > Signed-off-by: Huang Rui Reviewed-by: Marc-André Lureau > --- > > No change in v6. > > hw/display/virtio-gpu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu

Re: [PATCH v6 03/11] virtio-gpu: Support context init feature with virglrenderer

2024-01-02 Thread Marc-André Lureau
ot;context_init", VirtIOGPU, parent_obj.conf.flags, > +VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED, true), > +#endif Does it make sense to make this configurable? If the context to be created asked for a capset id but the one created doesn't respect it, what's the outcome? It looks like it should instead set cmd->error. -- Marc-André Lureau

Re: [PATCH v6 01/11] linux-headers: Update to kernel headers to add venus capset

2024-01-02 Thread Marc-André Lureau
t will still get into linux-next so we may retrieve headers from > linux-next. Or we may add the definition to > hw/display/virtio-gpu-virgl.c; the duplicate definition warning will > tell when the definition becomes no longer necessary. I'm fine with > either option. The second option seems better to me, as it can avoid pulling unwanted changes. thanks -- Marc-André Lureau

Re: [PATCH 2/3] vl: disable default serial when xen-console is enabled

2023-11-21 Thread Marc-André Lureau
Hi On Tue, Nov 21, 2023 at 2:57 PM Marc-André Lureau wrote: > > Hi > > On Wed, Nov 15, 2023 at 9:28 PM David Woodhouse wrote: > > > > From: David Woodhouse > > > > If a Xen console is configured on the command line, do not add a default > > serial po

Re: [PATCH 2/3] vl: disable default serial when xen-console is enabled

2023-11-21 Thread Marc-André Lureau
-console", .flag = _serial}, > { .driver = "isa-serial", .flag = _serial}, > { .driver = "isa-parallel", .flag = _parallel }, > { .driver = "isa-fdc", .flag = _floppy}, Consistent with

Re: [PATCH] ui/input: Constify QemuInputHandler structure

2023-10-17 Thread Marc-André Lureau
On Tue, Oct 17, 2023 at 5:13 PM Philippe Mathieu-Daudé wrote: > > Access to QemuInputHandlerState::handler are read-only. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau > --- > include/hw/virtio/virtio-input.h | 2 +- > include/ui/inpu

Re: [QEMU PATCH v5 11/13] virtio-gpu: Support Venus capset

2023-09-19 Thread Marc-André Lureau
_max_ver, > + _max_size); > +num_capsets += capset2_max_ver ? 1 : 0; > + > +virgl_renderer_get_cap_set(VIRTIO_GPU_CAPSET_VENUS, > + _max_ver, > + _max_size); > +num_capsets += capset2_max_size ? 1 : 0; > > -return capset2_max_ver ? 2 : 1; > +return num_capsets; > } > -- > 2.34.1 > > -- Marc-André Lureau

Re: [QEMU PATCH v5 10/13] virtio-gpu: Resource UUID

2023-09-19 Thread Marc-André Lureau
include/hw/virtio/virtio-gpu.h > @@ -63,6 +63,8 @@ struct virtio_gpu_simple_resource { > MemoryRegion *region; > #endif > > +bool has_uuid; > + > QTAILQ_ENTRY(virtio_gpu_simple_resource) next; > }; > > @@ -208,6 +210,8 @@ struct VirtIOGPU { > QTAILQ_HEAD(, VGPUDMABuf) bufs; > VGPUDMABuf *primary[VIRTIO_GPU_MAX_SCANOUTS]; > } dmabuf; > + > +GHashTable *resource_uuids; > }; > > struct VirtIOGPUClass { > @@ -285,6 +289,8 @@ void virtio_gpu_cleanup_mapping_iov(VirtIOGPU *g, > struct iovec *iov, uint32_t count); > void virtio_gpu_cleanup_mapping(VirtIOGPU *g, > struct virtio_gpu_simple_resource *res); > +void virtio_gpu_resource_assign_uuid(VirtIOGPU *g, > + struct virtio_gpu_ctrl_command *cmd); > void virtio_gpu_process_cmdq(VirtIOGPU *g); > void virtio_gpu_device_realize(DeviceState *qdev, Error **errp); > void virtio_gpu_reset(VirtIODevice *vdev); > -- > 2.34.1 > > -- Marc-André Lureau

Re: [QEMU PATCH v5 09/13] virtio-gpu: Handle resource blob commands

2023-09-19 Thread Marc-André Lureau
pu_base_device_realize(qdev, > diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h > index 55973e112f..b9adc28071 100644 > --- a/include/hw/virtio/virtio-gpu.h > +++ b/include/hw/virtio/virtio-gpu.h > @@ -58,6 +58,11 @@ struct virtio_gpu_simple_resource { > int dmabuf_fd; > uint8_t *remapped; > > +#ifdef HAVE_VIRGL_RESOURCE_BLOB > +/* only blob resource needs this region to be mapped as guest mmio */ > +MemoryRegion *region; > +#endif > + > QTAILQ_ENTRY(virtio_gpu_simple_resource) next; > }; > > diff --git a/meson.build b/meson.build > index ff20d3c249..f7b744ab82 100644 > --- a/meson.build > +++ b/meson.build > @@ -1072,6 +1072,10 @@ if not get_option('virglrenderer').auto() or > have_system or have_vhost_user_gpu > > cc.has_function('virgl_renderer_context_create_with_flags', > prefix: '#include ', > dependencies: virgl)) > + config_host_data.set('HAVE_VIRGL_RESOURCE_BLOB', > + cc.has_function('virgl_renderer_resource_create_blob', > + prefix: '#include ', > + dependencies: virgl)) better moved under the if virgl.found() block > endif > blkio = not_found > if not get_option('blkio').auto() or have_block > -- > 2.34.1 > > -- Marc-André Lureau

Re: [QEMU PATCH v5 05/13] virtio-gpu: Configure context init for virglrenderer

2023-09-19 Thread Marc-André Lureau
t is actually checked: HAVE_VIRGL_CONTEXT_CREATE_WITH_FLAGS for ex > endif > blkio = not_found > if not get_option('blkio').auto() or have_block > -- > 2.34.1 > > -- Marc-André Lureau

Re: [QEMU PATCH 1/1] virtgpu: do not destroy resources when guest suspend

2023-06-12 Thread Marc-André Lureau
need a new message at the virtio-gpu level. Gerd, wdyt? Maybe it's not a good place to reset all GPU resources during QEMU reset() after all, if it's called during s3 and there is no mechanism to restore it. Damien? thanks ... > enum virtio_gpu_shm_id { > @@ -453,4 +456,10 @@ struct virtio_gpu_resource_unmap_blob { > uint32_t padding; > }; > > +/* VIRTIO_GPU_CMD_STATUS_FREEZING */ > +struct virtio_gpu_status_freezing { > + struct virtio_gpu_ctrl_hdr hdr; > + __u32 freezing; > +}; > + > #endif > -- > 2.34.1 > > > -- Marc-André Lureau

Re: [PATCH v14 13/17] qemu-sockets: move and rename SocketAddress_to_str()

2022-10-21 Thread Marc-André Lureau
case SOCKET_ADDRESS_TYPE_FD: > + return g_strdup_printf("fd:%s", addr->u.fd.str); > +case SOCKET_ADDRESS_TYPE_VSOCK: > +return g_strdup_printf("tcp:%s:%s", > + addr->u.vsock.cid, > + addr->u.vsock.port); > +default: > +return g_strdup("unknown address type"); > +} > +} > > SocketAddress *socket_parse(const char *str, Error **errp) > { > -- > 2.37.3 > > > -- Marc-André Lureau

Re: [PATCH 07/27] Replace GCC_FMT_ATTR with G_GNUC_PRINTF

2022-03-16 Thread Marc-André Lureau
Hi On Wed, Mar 16, 2022 at 5:28 PM Thomas Huth wrote: > > On 16/03/2022 14.16, Philippe Mathieu-Daudé wrote: > > On 16/3/22 10:52, marcandre.lur...@redhat.com wrote: > >> From: Marc-André Lureau > >> > >> One less qemu-specific macro. It also helps to m

Re: [PATCH 07/27] Replace GCC_FMT_ATTR with G_GNUC_PRINTF

2022-03-16 Thread Marc-André Lureau
Hi On Wed, Mar 16, 2022 at 5:30 PM Daniel P. Berrangé wrote: > > On Wed, Mar 16, 2022 at 01:52:48PM +0400, marcandre.lur...@redhat.com wrote: > > diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h > > index 3baa5e3790f7..f2bd050e3b9a 100644 > > --- a/include/qemu/compiler.h > > +++

Re: [PATCH v3 13/13] compiler.h: remove QEMU_GNUC_PREREQ

2020-12-14 Thread Marc-André Lureau
Hi On Thu, Dec 10, 2020 at 6:07 PM wrote: > From: Marc-André Lureau > > When needed, the G_GNUC_CHECK_VERSION() glib macro can be used instead. > > Signed-off-by: Marc-André Lureau > --- > include/qemu/compiler.h| 11 --- > scripts/cocci-macro-file.h | 1

Re: [PATCH v3 11/13] compiler: remove GNUC check

2020-12-12 Thread Marc-André Lureau
On Thu, Dec 10, 2020 at 6:14 PM wrote: > From: Marc-André Lureau > > QEMU requires Clang or GCC, that define and support __GNUC__ extensions. > > Signed-off-by: Marc-André Lureau > --- > include/qemu/compiler.h | 8 +--- > 1 file changed, 1 insertion(+), 7 del

Re: [PATCH v3 08/13] audio: remove GNUC & MSVC check

2020-12-10 Thread Marc-André Lureau
Hi On Thu, Dec 10, 2020 at 6:35 PM Philippe Mathieu-Daudé wrote: > > On 12/10/20 3:27 PM, Peter Maydell wrote: > > On Thu, 10 Dec 2020 at 14:26, Philippe Mathieu-Daudé > > wrote: > >> > >> On 12/10/20 2:47 PM, marcandre.lur...@redhat.com wrote: > >&g

Re: [PATCH v3 03/13] compiler.h: remove GCC < 3 __builtin_expect fallback

2020-12-10 Thread Marc-André Lureau
Hi On Thu, Dec 10, 2020 at 6:47 PM Peter Maydell wrote: > > On Thu, 10 Dec 2020 at 14:32, Philippe Mathieu-Daudé > wrote: > > > > On 12/10/20 2:47 PM, marcandre.lur...@redhat.com wrote: > > > From: Marc-André Lureau > > > > > > Since commit

Re: [PATCH 14/36] qdev: Move dev->realized check to qdev_property_set()

2020-10-30 Thread Marc-André Lureau
rop_allow_set()) because it will become a callback later. > > Signed-off-by: Eduardo Habkost > nice Reviewed-by: Marc-André Lureau -- Marc-André Lureau

Re: [PATCH 09/36] qdev: Make qdev_get_prop_ptr() get Object* arg

2020-10-30 Thread Marc-André Lureau
On Fri, Oct 30, 2020 at 11:29 AM Marc-André Lureau < marcandre.lur...@gmail.com> wrote: > > > On Fri, Oct 30, 2020 at 2:07 AM Eduardo Habkost > wrote: > >> Make the code more generic and not specific to TYPE_DEVICE. >> >> Signed-off-by: Eduardo Habkost &

Re: [PATCH 09/36] qdev: Make qdev_get_prop_ptr() get Object* arg

2020-10-30 Thread Marc-André Lureau
did you mean ‘vdev’? 403 | if (dev->realized) { -- Marc-André Lureau

Re: [Xen-devel] [RFC v5 026/126] python: add commit-per-subsystem.py

2019-11-08 Thread Marc-André Lureau
Blake > CC: "Denis V. Lunev" > CC: Markus Armbruster > CC: Alberto Garcia > CC: Jason Dillaman > CC: Wen Congyang > CC: Xie Changlong > CC: Liu Yuan > CC: "Richard W.M. Jones" > CC: Jeff Cody > CC: "Marc-André Lureau" > CC:

Re: [Xen-devel] [RFC v5 024/126] error: auto propagated local_err

2019-11-08 Thread Marc-André Lureau
> CC: Pavel Dovgalyuk > CC: Paolo Bonzini > CC: Stefan Hajnoczi > CC: Fam Zheng > CC: Stefan Weil > CC: Ronnie Sahlberg > CC: Peter Lieven > CC: Eric Blake > CC: "Denis V. Lunev" > CC: Markus Armbruster > CC: Alberto Garcia > CC: Jason Dillaman &g

Re: [Xen-devel] [RFC v5 000/126] error: auto propagated local_err

2019-11-08 Thread Marc-André Lureau
dline: introduce ERRP_AUTO_PROPAGATE > >Dump: introduce ERRP_AUTO_PROPAGATE > >Memory API: introduce ERRP_AUTO_PROPAGATE > >SPICE: introduce ERRP_AUTO_PROPAGATE > >Graphics: introduce ERRP_AUTO_PROPAGATE > >Main loop: introduce ERRP_AUTO_PROPAGAT

Re: [Xen-devel] [PATCH v3 24/25] chardev: Let qemu_chr_fe_write[_all] use size_t type argument

2019-02-20 Thread Marc-André Lureau
> Suggested-by: Paolo Bonzini > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau > --- > chardev/char-fe.c | 4 ++-- > chardev/char-mux.c| 3 ++- > include/chardev/char-fe.h | 4 ++-- > 3 files changed, 6 insertions(+), 5 deletions(-) >

Re: [Xen-devel] [PATCH v3 23/25] hw/ipmi: Assert outlen > outpos

2019-02-20 Thread Marc-André Lureau
Hi On Wed, Feb 20, 2019 at 2:08 AM Philippe Mathieu-Daudé wrote: > > A througfull audit show that all time data is added to outbuf[], througfull? :) thorough? > 'outlen' is incremented. Then at creation and each time > continue_send() returns it pass thru check_reset which resets > 'outpos',

Re: [Xen-devel] [PATCH v3 04/25] chardev: Let qemu_chr_be_can_write() return a size_t types

2019-02-20 Thread Marc-André Lureau
Hi On Wed, Feb 20, 2019 at 12:26 PM Philippe Mathieu-Daudé wrote: > > On 2/20/19 11:40 AM, Marc-André Lureau wrote: > > Hi > > > > On Wed, Feb 20, 2019 at 2:04 AM Philippe Mathieu-Daudé > > wrote: > >> > >> In the previous commit we added an a

Re: [Xen-devel] [PATCH v3 17/25] net/filter-mirror: Use size_t

2019-02-20 Thread Marc-André Lureau
Hi On Wed, Feb 20, 2019 at 2:07 AM Philippe Mathieu-Daudé wrote: > > Since iov_size() returns a size_t, no need to use a signed type. And it is the variable only purpose. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau > --- > net/filter-mi

Re: [Xen-devel] [PATCH v3 16/25] tpm: Use size_t to hold sizes

2019-02-20 Thread Marc-André Lureau
On Wed, Feb 20, 2019 at 2:06 AM Philippe Mathieu-Daudé wrote: > > Avoid to use a signed type to hold an unsigned value. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau > --- > hw/tpm/tpm_emulator.c | 7 --- > 1 file changed, 4 inser

Re: [Xen-devel] [PATCH v3 14/25] virtio-serial: Let VirtIOSerialPortClass::have_data() use size_t

2019-02-20 Thread Marc-André Lureau
ippe Mathieu-Daudé Reviewed-by: Marc-André Lureau > --- > It is funny/scary that there are big comments about how to treat > errors to set the return value, then the return value is simply > ignored by the caller. have_data() return value? yes, the code may have change and the comment does

Re: [Xen-devel] [PATCH v3 12/25] xen: Let buffer_append() return the size consumed

2019-02-20 Thread Marc-André Lureau
Hi On Wed, Feb 20, 2019 at 2:06 AM Philippe Mathieu-Daudé wrote: > > The buffer.size and buffer.consumed fields are only updated within the > buffer_append() body. We can simply let buffer_append() return the > difference (the buffer consumed). > > Signed-off-by: Philippe Mathieu-Daudé This is

Re: [Xen-devel] [PATCH v3 11/25] xen: Let xencons_send() take a 'size' argument

2019-02-20 Thread Marc-André Lureau
athieu-Daudé Reviewed-by: Marc-André Lureau > --- > hw/char/xen_console.c | 12 +++- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c > index 91f34ef06c..083b2c8e2a 100644 > --- a/hw/char/xen_console

Re: [Xen-devel] [PATCH v3 09/25] vhost-user: Express sizeof with size_t

2019-02-20 Thread Marc-André Lureau
On Wed, Feb 20, 2019 at 2:05 AM Philippe Mathieu-Daudé wrote: > > VHOST_USER_HDR_SIZE uses offsetof(), thus is an expression of type > size_t. Update the format string accordingly. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau > --- > hw/vir

Re: [Xen-devel] [PATCH v3 07/25] gdbstub: Let put_buffer() use size_t

2019-02-20 Thread Marc-André Lureau
On Wed, Feb 20, 2019 at 2:04 AM Philippe Mathieu-Daudé wrote: > > All callers provide a size_t argument, we can safely use size_t > for this function. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau > --- > gdbstub.c | 4 ++-- > 1 file cha

Re: [Xen-devel] [PATCH v3 06/25] gdbstub: Use size_t to hold GDBState::last_packet_len

2019-02-20 Thread Marc-André Lureau
positive. > > The few other places where s->last_packet_len is set is with constant > positive values. > > It makes sense to use size_t to hold last_packet_len values. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau > --- > gdbstub.c

Re: [Xen-devel] [PATCH v3 05/25] gdbstub: Use size_t for strlen() return value

2019-02-20 Thread Marc-André Lureau
On Wed, Feb 20, 2019 at 2:04 AM Philippe Mathieu-Daudé wrote: > > Since strlen() returns an unsigned value, it is pointless to > convert it to a signed one. Use size_t to hold its return value. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau

Re: [Xen-devel] [PATCH v3 00/25] chardev: Convert qemu_chr_write() to take a size_t argument

2019-02-20 Thread Marc-André Lureau
Hi On Wed, Feb 20, 2019 at 2:02 AM Philippe Mathieu-Daudé wrote: > > Hi, > > This series convert the chardev::qemu_chr_write() to take unsigned > length argument. To do so I went through all caller and checked if > there are no negative value possible. Changing signedness is problematic and

Re: [Xen-devel] [Qemu-devel] [PATCH v3 25/25] chardev: Let qemu_chr_write[_all] use size_t

2019-02-20 Thread Marc-André Lureau
Hi On Wed, Feb 20, 2019 at 11:39 AM Daniel P. Berrangé wrote: > > On Wed, Feb 20, 2019 at 02:02:32AM +0100, Philippe Mathieu-Daudé wrote: > > > diff --git a/include/chardev/char.h b/include/chardev/char.h > > index 0341dd1ba2..2e3b5a15ca 100644 > > --- a/include/chardev/char.h > > +++

Re: [Xen-devel] [PATCH v3 04/25] chardev: Let qemu_chr_be_can_write() return a size_t types

2019-02-20 Thread Marc-André Lureau
_write(Chardev *s); > > /** > * qemu_chr_be_write: > diff --git a/ui/console.c b/ui/console.c > index 6d2282d3e9..42f04e2b37 100644 > --- a/ui/console.c > +++ b/ui/console.c > @@ -61,8 +61,8 @@ enum TTYState { > > typedef struct QEMUFIFO { > uint8_t *buf; > -int buf_size; > -int count, wptr, rptr; > +size_t buf_size, count; > +int wptr, rptr; Only used as non-negative buffer size, ack > } QEMUFIFO; > > static int qemu_fifo_write(QEMUFIFO *f, const uint8_t *buf, int len1) > @@ -1110,7 +1110,7 @@ static int vc_chr_write(Chardev *chr, const uint8_t > *buf, int len) > static void kbd_send_chars(void *opaque) > { > QemuConsole *s = opaque; > -int len; > +size_t len; Only used as non-negative buffer size, ack > uint8_t buf[16]; > > len = qemu_chr_be_can_write(s->chr); > -- > 2.20.1 > That was painful, hopefully I didn't miss something... Reviewed-by: Marc-André Lureau ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v3 03/25] chardev/wctablet: Use unsigned type to hold unsigned value

2019-02-20 Thread Marc-André Lureau
Hi On Wed, Feb 20, 2019 at 2:03 AM Philippe Mathieu-Daudé wrote: > > TabletChardev::query is an array of uint8_t. > Use the same type to hold it (this also silent a -Wsign-conversion > warning in the trace function). > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by:

Re: [Xen-devel] [PATCH v3 02/25] chardev: Assert IOCanReadHandler can not be negative

2019-02-20 Thread Marc-André Lureau
Hi On Wed, Feb 20, 2019 at 2:03 AM Philippe Mathieu-Daudé wrote: > > The backend should not return a negative length to read. > We will later change the prototype of IOCanReadHandler to return an > unsigned length. Meanwhile make sure the return length is positive. > > Suggested-by: Paolo

Re: [Xen-devel] [PATCH v3 01/25] chardev: Simplify IOWatchPoll::fd_can_read as a GSourceFunc

2019-02-20 Thread Marc-André Lureau
ted-by: Paolo Bonzini > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau > --- > chardev/char-fd.c | 4 ++-- > chardev/char-io.c | 6 +++--- > chardev/char-pty.c| 4 ++-- > chardev/char-socket.c | 6 +++--- > chardev/char-udp.c

Re: [Xen-devel] [Qemu-devel] [PATCH 3/3] machine: Use shorter format for GlobalProperty arrays

2019-01-07 Thread Marc-André Lureau
ccw.c | 75 +--- > hw/xen/xen-common.c| 18 +- > 7 files changed, 265 insertions(+), 1168 deletions(-) Nice diff state, hopefully I didn't miss any before/after difference: Reviewed-by: Marc-André Lureau > > diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h > index

Re: [Xen-devel] [Qemu-devel] [PATCH 1/3] spapr: Eliminate SPAPR_PCI_2_7_MMIO_WIN_SIZE macro

2019-01-07 Thread Marc-André Lureau
On Mon, Jan 7, 2019 at 11:34 PM Eduardo Habkost wrote: > > The macro is only used in one place, where the purpose of the > value is obvious. Eliminate the macro so we don't need to rely > on stringify(). > > Signed-off-by: Eduardo Habkost Reviewed-by: Marc-André Lureau &

Re: [Xen-devel] [Qemu-devel] [PATCH 2/3] machine: Eliminate unnecessary stringify() usage

2019-01-07 Thread Marc-André Lureau
number literal. > > Replace stringify() with string literals when appropriate. > > Signed-off-by: Eduardo Habkost Reviewed-by: Marc-André Lureau > --- > hw/core/machine.c | 8 ++-- > hw/i386/pc.c | 94 +++ > hw/i386/p

Re: [Xen-devel] [Qemu-devel] [PATCH for-3.2 v5 07/19] hw: apply accel compat properties without touching globals

2018-12-12 Thread Marc-André Lureau
Hi On Mon, Dec 10, 2018 at 8:55 PM Igor Mammedov wrote: > > On Mon, 10 Dec 2018 17:45:22 +0100 > Igor Mammedov wrote: > > > On Tue, 4 Dec 2018 18:20:11 +0400 > > Marc-André Lureau wrote: > > > > > Instead of registering compat properties as globals, l

[Xen-devel] [PATCH for-3.2 v5 07/19] hw: apply accel compat properties without touching globals

2018-12-04 Thread Marc-André Lureau
Instead of registering compat properties as globals, let's keep them in their own array, to avoid mixing with user globals. Introduce object_apply_global_props() function, to apply compatibility properties from a GPtrArray. Signed-off-by: Marc-André Lureau --- include/hw/qdev-core.h | 10

Re: [Xen-devel] [Qemu-devel] [PATCH for-3.2 v4 15/28] hw: apply accel compat properties without touching globals

2018-11-27 Thread Marc-André Lureau
Hi On Tue, Nov 27, 2018 at 11:40 PM Eduardo Habkost wrote: > > On Tue, Nov 27, 2018 at 01:27:48PM +0400, Marc-André Lureau wrote: > > Introduce object_apply_global_props() function, to apply compatibility > > properties from a GPtrArray. > > > > For accel compat

[Xen-devel] [PATCH for-3.2 v4 15/28] hw: apply accel compat properties without touching globals

2018-11-27 Thread Marc-André Lureau
generic version of SET_MACHINE_COMPAT() that can set compat properties on other objects than Machine, and using GPtrArray. Signed-off-by: Marc-André Lureau --- include/hw/qdev-core.h | 13 + include/qom/object.h | 3 +++ include/sysemu/accel.h | 4 +--- accel/accel.c

Re: [Xen-devel] [Qemu-devel] [PATCH for-3.2 v3 10/14] qdev-props: call object_apply_global_props()

2018-11-26 Thread Marc-André Lureau
Hi On Mon, Nov 26, 2018 at 5:27 PM Igor Mammedov wrote: > > On Wed, 7 Nov 2018 16:36:48 +0400 > Marc-André Lureau wrote: > > > It's now possible to use the common function. > > > > Teach object_apply_global_props() to warn if Error argument is NULL. > >

Re: [Xen-devel] [Qemu-devel] [PATCH for-3.2 v3 13/14] hw/i386: add pc-i440fx-3.2 & pc-q35-3.2

2018-11-07 Thread Marc-André Lureau
Hi On Wed, Nov 7, 2018 at 4:49 PM Marc-André Lureau wrote: > > The following patch is going to add compatiblity parameters for > qemu <= 3.1. > I realize this may be good enough for x86 i440/q35 machines, but what about other machines & architectures? What do we

[Xen-devel] [PATCH for-3.2 v3 14/14] hostmem: use object id for memory region name with >= 3.1

2018-11-07 Thread Marc-André Lureau
ing allow to migrate to different hostmem backends. Signed-off-by: Marc-André Lureau --- include/hw/compat.h | 10 +- include/sysemu/hostmem.h | 3 ++- backends/hostmem-file.c | 8 backends/hostmem-memfd.c | 2 +- backends/hostmem-ram.c | 9 - backends/hostme

[Xen-devel] [PATCH for-3.2 v3 09/14] qdev-props: remove errp from GlobalProperty

2018-11-07 Thread Marc-André Lureau
All qdev_prop_register_global() set _fatal for errp, except '-rtc driftfix=slew', which arguably should also use _fatal, as otherwise failing to apply the property would only report a warning. Signed-off-by: Marc-André Lureau --- include/hw/qdev-core.h| 6 -- hw/core/qdev-properties.c

[Xen-devel] [PATCH for-3.2 v3 11/14] qom: teach interfaces to implement post-init

2018-11-07 Thread Marc-André Lureau
The following patches are going to implement post_init callbacks for settings properties. The interface post_init are called before the instance post_init, so the default interface behaviour can be overriden if necessary. Signed-off-by: Marc-André Lureau --- qom/object.c| 8

[Xen-devel] [PATCH for-3.2 v3 10/14] qdev-props: call object_apply_global_props()

2018-11-07 Thread Marc-André Lureau
It's now possible to use the common function. Teach object_apply_global_props() to warn if Error argument is NULL. Signed-off-by: Marc-André Lureau --- hw/core/qdev-properties.c | 24 ++-- qom/object.c | 6 +- 2 files changed, 7 insertions(+), 23 deletions

[Xen-devel] [PATCH for-3.2 v3 13/14] hw/i386: add pc-i440fx-3.2 & pc-q35-3.2

2018-11-07 Thread Marc-André Lureau
The following patch is going to add compatiblity parameters for qemu <= 3.1. Signed-off-by: Marc-André Lureau --- include/hw/compat.h | 3 +++ include/hw/i386/pc.h | 3 +++ hw/i386/pc_piix.c| 21 ++--- hw/i386/pc_q35.c | 19 +-- 4 files changed,

[Xen-devel] [PATCH for-3.2 v3 12/14] machine: add compat-props interface

2018-11-07 Thread Marc-André Lureau
Let's make compatiblity properties an interface, so that objects other than QDev can benefit from having machine compatiblity properties. Signed-off-by: Marc-André Lureau --- include/hw/boards.h| 2 ++ hw/core/compat-props.c | 43 ++ hw/core/qdev.c

[Xen-devel] [PATCH for-3.2 v3 07/14] qdev: all globals are now user-provided

2018-11-07 Thread Marc-André Lureau
Considering that CPU features are provided via command line, the global_props are now all user-provided globals. No need to track this anymore for qdev_prop_check_globals(). Signed-off-by: Marc-André Lureau --- include/hw/qdev-core.h | 3 -- hw/core/qdev-properties.c | 4

[Xen-devel] [PATCH for-3.2 v3 08/14] qdev-props: convert global_props to GArray

2018-11-07 Thread Marc-André Lureau
A step towards being able to call object_apply_global_props(). Signed-off-by: Marc-André Lureau --- hw/core/qdev-properties.c | 29 - 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 43c30a57f4

[Xen-devel] [PATCH for-3.2 v3 02/14] qom: make interface types abstract

2018-11-07 Thread Marc-André Lureau
Interfaces don't have instance, let's make the interface type really abstract to avoid confusion. Signed-off-by: Marc-André Lureau --- include/hw/acpi/acpi_dev_interface.h | 6 +- include/hw/arm/linux-boot-if.h | 5 + include/hw/fw-path-provider.h| 4 +--- include/hw

[Xen-devel] [PATCH for-3.2 v3 05/14] qdev: move qdev_prop_register_global_list() to tests

2018-11-07 Thread Marc-André Lureau
The function is only used by a test, move it there. Signed-off-by: Marc-André Lureau Reviewed-by: Eduardo Habkost --- include/hw/qdev-properties.h | 1 - hw/core/qdev-properties.c | 9 - tests/test-qdev-global-props.c | 18 ++ 3 files changed, 14 insertions

[Xen-devel] [PATCH for-3.2 v3 06/14] qdev: do not mix compat props with global props

2018-11-07 Thread Marc-André Lureau
QDev. The following patches is going to reuse object_apply_global_props() for qdev globals. Signed-off-by: Marc-André Lureau --- include/hw/boards.h| 1 - include/qom/object.h | 2 ++ include/sysemu/accel.h | 4 +--- accel/accel.c | 12 hw/

[Xen-devel] [PATCH for-3.2 v3 00/14] Generalize machine compatibility properties

2018-11-07 Thread Marc-André Lureau
ot; - rename register_global_list() to register_global_properties() - call object_property_set_globals() after post-init - add and use a ObjectClass.set_globals flag, instead of dynamically check object class in object_property_set_globals() - use object "id" in >= 3.1 instea

[Xen-devel] [PATCH for-3.2 v3 03/14] qom: make user_creatable_complete() specific to UserCreatable

2018-11-07 Thread Marc-André Lureau
Instead of accepting any Object*, change user_creatable_complete() to require a UserCreatable*. Modify the callers to pass the appropriate argument, removing redundant dynamic cast checks in object creation. Signed-off-by: Marc-André Lureau Reviewed-by: Igor Mammedov --- include/qom

[Xen-devel] [PATCH for-3.2 v3 04/14] accel: register global_props like machine globals

2018-11-07 Thread Marc-André Lureau
global_props is only used for Xen xen_compat_props. It's a static array of GlobalProperty, like machine globals in SET_MACHINE_COMPAT(). Let's register the globals the same way, without extra copy allocation. Signed-off-by: Marc-André Lureau Reviewed-by: Igor Mammedov --- include/hw/qdev

[Xen-devel] [PATCH for-3.2 v3 01/14] tests: qdev_prop_check_globals() doesn't return "all_used"

2018-11-07 Thread Marc-André Lureau
Clarify the function return value. Signed-off-by: Marc-André Lureau --- tests/test-qdev-global-props.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c index d81b0862d5..ccdf6c57c1 100644 --- a/tests/test

Re: [Xen-devel] [Qemu-devel] [PATCH] RFC: chardev: mark the calls that allow an implicit mux monitor

2018-08-27 Thread Marc-André Lureau
Hi On Mon, Aug 27, 2018 at 10:10 AM Markus Armbruster wrote: > > Marc-André Lureau writes: > > > Hi > > On Fri, Aug 24, 2018 at 9:37 AM Markus Armbruster wrote: > >> > >> Marc-André Lureau writes: > >> > >> > This is mostly for reada

Re: [Xen-devel] [Qemu-devel] [PATCH] RFC: chardev: mark the calls that allow an implicit mux monitor

2018-08-24 Thread Marc-André Lureau
Hi On Fri, Aug 24, 2018 at 9:37 AM Markus Armbruster wrote: > > Marc-André Lureau writes: > > > This is mostly for readability of the code. Let's make it clear which > > callers can create an implicit monitor when the chardev is muxed. > > > > This will also

[Xen-devel] [PATCH] RFC: chardev: mark the calls that allow an implicit mux monitor

2018-08-22 Thread Marc-André Lureau
an HMP monitor. - -mon command line option From this short study, I would like to think that a monitor may only be created in the main thread today, though I remain skeptical :) Signed-off-by: Marc-André Lureau --- include/chardev/char.h | 18 +- chardev/char.

Re: [Xen-devel] [Qemu-devel] [PATCH v2 5/6] xen: Add only xen-sysdev to dynamic sysbus device list

2017-12-22 Thread Marc-André Lureau
e_class_allow_dynamic_sysbus_dev(mc, TYPE_SYS_BUS_DEVICE); > +machine_class_allow_dynamic_sysbus_dev(mc, TYPE_XENSYSDEV); It looks like it's the last patch in the series without review. It would be nice if a Xen maintainer could look at it, or test it, as I dont know how to test it tbh. Review

Re: [Xen-devel] [Qemu-devel] [PATCH v2 1/6] machine: Replace has_dynamic_sysbus with list of allowed devices

2017-11-28 Thread Marc-André Lureau
bson.dropbear.id.au> > Cc: Stefano Stabellini <sstabell...@kernel.org> > Cc: Anthony Perard <anthony.per...@citrix.com> > Cc: qemu-...@nongnu.org > Cc: qemu-...@nongnu.org > Cc: xen-devel@lists.xenproject.org > Signed-off-by: Eduardo Habkost <ehabk...@redhat.com&