Re: [PATCH 06/18] vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add()

2021-06-24 Thread Eli Cohen
On Wed, Jun 23, 2021 at 05:00:16PM +0200, Stefano Garzarella wrote: > On Mon, Jun 21, 2021 at 12:16:38PM +0800, Jason Wang wrote: > > Fixes: 1e0a84ea49b68 ("vhost-vdpa: introduce vhost-vdpa net client") > > Signed-off-by: Jason Wang > > --- > > net/vhost-vdpa.c | 1 + > > 1 file changed, 1 insertio

Re: [PATCH 06/18] vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add()

2021-06-24 Thread Jason Wang
在 2021/6/24 下午3:06, Eli Cohen 写道: On Wed, Jun 23, 2021 at 05:00:16PM +0200, Stefano Garzarella wrote: On Mon, Jun 21, 2021 at 12:16:38PM +0800, Jason Wang wrote: Fixes: 1e0a84ea49b68 ("vhost-vdpa: introduce vhost-vdpa net client") Signed-off-by: Jason Wang --- net/vhost-vdpa.c | 1 + 1 file c

Re: [PATCH 06/18] vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add()

2021-06-24 Thread Eli Cohen
On Wed, Jun 23, 2021 at 05:00:16PM +0200, Stefano Garzarella wrote: > On Mon, Jun 21, 2021 at 12:16:38PM +0800, Jason Wang wrote: > > Fixes: 1e0a84ea49b68 ("vhost-vdpa: introduce vhost-vdpa net client") > > Signed-off-by: Jason Wang > > --- > > net/vhost-vdpa.c | 1 + > > 1 file changed, 1 insertio

[PATCH v5 0/5] block-copy: protect block-copy internal structures

2021-06-24 Thread Emanuele Giuseppe Esposito
This serie of patches aims to reduce the usage of the AioContexlock in block-copy, by introducing smaller granularity locks thus on making the block layer thread safe. This serie depends on my previous serie that brings thread safety to the smaller API used by block-copy, like ratelimit, progress

[PATCH v5 1/5] block-copy: small refactor in block_copy_task_entry and block_copy_common

2021-06-24 Thread Emanuele Giuseppe Esposito
Use a local variable instead of referencing BlockCopyState through a BlockCopyCallState or BlockCopyTask every time. This is in preparation for next patches. No functional change intended. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.

[PATCH v5 3/5] block-copy: move progress_set_remaining in block_copy_task_end

2021-06-24 Thread Emanuele Giuseppe Esposito
Moving this function in task_end ensures to update the progress anyways, even if there is an error. It also helps in next patch, allowing task_end to have only one critical section. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 6 +

[PATCH v5 2/5] block-copy: streamline choice of copy_range vs. read/write

2021-06-24 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for the possible methods of copying data from one BlockDriverState to the other. Use .method instead of .copy_range as in-out argument, and include also .zeroes as an addi

[PATCH v5 4/5] block-copy: add CoMutex lock

2021-06-24 Thread Emanuele Giuseppe Esposito
Group various structures fields, to better understand what we need to protect with a lock and what doesn't need it. Then, add a CoMutex to protect concurrent access of block-copy data structures. This mutex also protects .copy_bitmap, because its thread-safe API does not prevent it from assigning t

[PATCH v5 5/5] block-copy: atomic .cancelled and .finished fields in BlockCopyCallState

2021-06-24 Thread Emanuele Giuseppe Esposito
By adding acquire/release pairs, we ensure that .ret and .error_is_read fields are written by block_copy_dirty_clusters before .finished is true, and that they are read by API user after .finished is true. The atomic here are necessary because the fields are concurrently modified in coroutines, an

Re: [PATCH 06/18] vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add()

2021-06-24 Thread Eli Cohen
On Thu, Jun 24, 2021 at 03:10:46PM +0800, Jason Wang wrote: > > 在 2021/6/24 下午3:06, Eli Cohen 写道: > > On Wed, Jun 23, 2021 at 05:00:16PM +0200, Stefano Garzarella wrote: > > > On Mon, Jun 21, 2021 at 12:16:38PM +0800, Jason Wang wrote: > > > > Fixes: 1e0a84ea49b68 ("vhost-vdpa: introduce vhost-vdp

Re: [PATCH v4 1/7] file-posix: fix max_iov for /dev/sg devices

2021-06-24 Thread Vladimir Sementsov-Ogievskiy
23.06.2021 18:42, Max Reitz wrote: On 08.06.21 21:14, Vladimir Sementsov-Ogievskiy wrote: 08.06.2021 16:16, Paolo Bonzini wrote: Even though it was only called for devices that have bs->sg set (which must be character devices), sg_get_max_segments looked at /sys/dev/block which only works for b

Re: [PATCH 06/18] vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add()

2021-06-24 Thread Jason Wang
在 2021/6/24 下午3:14, Eli Cohen 写道: On Wed, Jun 23, 2021 at 05:00:16PM +0200, Stefano Garzarella wrote: On Mon, Jun 21, 2021 at 12:16:38PM +0800, Jason Wang wrote: Fixes: 1e0a84ea49b68 ("vhost-vdpa: introduce vhost-vdpa net client") Signed-off-by: Jason Wang --- net/vhost-vdpa.c | 1 + 1 file c

Re: [PATCH 03/18] vhost_net: do not assume nvqs is always 2

2021-06-24 Thread Jason Wang
在 2021/6/24 下午2:22, Eli Cohen 写道: On Mon, Jun 21, 2021 at 12:16:35PM +0800, Jason Wang wrote: This patch switches to initialize dev.nvqs from the VhostNetOptions instead of assuming it was 2. This is useful for implementing control virtqueue support which will be a single vhost_net structure w

Re: [PATCH 15/18] vhost-net: control virtqueue support

2021-06-24 Thread Eli Cohen
On Mon, Jun 21, 2021 at 12:16:47PM +0800, Jason Wang wrote: > We assume there's no cvq in the past, this is not true when we need > control virtqueue support for vhost-user backends. So this patch > implements the control virtqueue support for vhost-net. As datapath, > the control virtqueue is also

Re: [PATCH 01/18] vhost_net: remove the meaningless assignment in vhost_net_start_one()

2021-06-24 Thread Jason Wang
在 2021/6/21 下午7:45, Eli Cohen 写道: On Mon, Jun 21, 2021 at 12:16:33PM +0800, Jason Wang wrote: The nvqs and vqs has been initialized during vhost_net_init() and is I suggest "nvqs and vqs have been initialized during vhost_net_init() and are not..." Other than that Reviewed-by: Eli Cohen W

Re: [PATCH 15/18] vhost-net: control virtqueue support

2021-06-24 Thread Jason Wang
在 2021/6/24 下午3:42, Eli Cohen 写道: -int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, int total_queues); -void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, int total_queues); This breaks compilation of hw/net/vhost_net-stub.c Right, will fix. Thanks

Re: [PATCH 04/18] vhost-vdpa: remove the unnecessary check in vhost_vdpa_add()

2021-06-24 Thread Jason Wang
在 2021/6/23 下午10:53, Stefano Garzarella 写道: On Mon, Jun 21, 2021 at 12:16:36PM +0800, Jason Wang wrote: The VhostVDPAState is just allocated by qemu_new_net_client() via g_malloc0() in net_vhost_vdpa_init(). So s->vhost_net is NULL for sure, let's remove this unnecessary check in vhost_vdpa_ad

Re: [PATCH v2 03/23] qapi/misc-target: Group SEV QAPI definitions

2021-06-24 Thread Philippe Mathieu-Daudé
On 6/24/21 8:13 AM, Dov Murik wrote: > Phil, > > > On 16/06/2021 23:43, Philippe Mathieu-Daudé wrote: >> There is already a section with various SEV commands / types, >> so move the SEV guest attestation together. >> > > I have two questions (regarding several qapi patches in this series): > >

Re: [PATCH v3 2/4] fuzz: add an instrumentation filter

2021-06-24 Thread Philippe Mathieu-Daudé
On 6/24/21 5:45 AM, Alexander Bulekov wrote: > By default, -fsanitize=fuzzer instruments all code with coverage > information. However, this means that libfuzzer will track coverage over > hundreds of source files that are unrelated to virtual-devices. This > means that libfuzzer will optimize inpu

Re: [RFC v1 1/1] ui: Add a plain Wayland backend for Qemu UI

2021-06-24 Thread Philippe Mathieu-Daudé
On 6/24/21 6:10 AM, Vivek Kasireddy wrote: > Cc: Gerd Hoffmann > Signed-off-by: Vivek Kasireddy > --- > configure | 17 ++ > meson.build | 25 +++ > meson_options.txt | 2 + > qapi/ui.json | 19 ++- > ui/meson.build| 52 ++ > ui/wayland.c | 402 +

Re: [RFC PATCH 0/9] hw/sd: Allow card size not power of 2 again

2021-06-24 Thread Philippe Mathieu-Daudé
On 6/24/21 4:50 AM, Alexander Bulekov wrote: > On 210623 2000, Philippe Mathieu-Daudé wrote: >> Hi Ubi-Wan Kenubi and Tom, >> >> In commit a9bcedd (SD card size has to be power of 2) we decided >> to restrict SD card size to avoid security problems (CVE-2020-13253) >> but this became not practical

Re: Difficulties to access guest memory in TCG plugins

2021-06-24 Thread Philippe Mathieu-Daudé
Cc'ing the maintainer: Alex. On 6/23/21 5:08 PM, Kevin Mambu wrote: > Hi, everyone, > I need to put in place a plugin which is able to modify memory for a > specific project, and until now I managed to do so using > cpu_memory_rw_debug(). > However, the function happens to fail at times, and when

Re: [RFC v1 0/1] ui: Add a Wayland backend for Qemu UI

2021-06-24 Thread Gerd Hoffmann
On Wed, Jun 23, 2021 at 09:10:39PM -0700, Vivek Kasireddy wrote: > Why does Qemu need a new Wayland UI backend? > The main reason why there needs to be a plain and simple Wayland backend > for Qemu UI is to eliminate the Blit (aka GPU copy) that happens if using > a toolkit like GTK or SDL (because

Re: [RFC v1 1/1] ui: Add a plain Wayland backend for Qemu UI

2021-06-24 Thread Thomas Huth
On 24/06/2021 06.10, Vivek Kasireddy wrote: Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy --- configure | 17 ++ meson.build | 25 +++ meson_options.txt | 2 + qapi/ui.json | 19 ++- ui/meson.build| 52 ++ ui/wayland.c | 402 ++

[PULL 1/5] ui/cocoa: Set UI information

2021-06-24 Thread Gerd Hoffmann
From: Akihiko Odaki Signed-off-by: Akihiko Odaki Message-Id: <20210616141910.54188-1-akihiko.od...@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/cocoa.m | 49 + 1 file changed, 49 insertions(+) diff --git a/ui/cocoa.m b/ui/cocoa.m index 37e1fb5

[PULL 0/5] Ui 20210624 patches

2021-06-24 Thread Gerd Hoffmann
The following changes since commit b22726abdfa54592d6ad88f65b0297c0e8b363e2: Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.1-pull-request' into staging (2021-06-22 16:07:53 +0100) are available in the Git repository at: git://git.kraxel.org/qemu tags/ui-202

[PULL 5/5] ui: Make the DisplayType enum entries conditional

2021-06-24 Thread Gerd Hoffmann
From: Thomas Huth Libvirt's "domcapabilities" command has a way to state whether certain graphic frontends are available in QEMU or not. Originally, libvirt looked at the "--help" output of the QEMU binary to determine whether SDL was available or not (by looking for the "-sdl" parameter in the h

[PULL 4/5] Add display suboptions to man pages

2021-06-24 Thread Gerd Hoffmann
From: Ahmed Abouzied Updates man pages with the suboptions for the `-display`. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/128 Buglink: https://bugs.launchpad.net/qemu/+bug/1620660 Signed-off-by: Ahmed Abouzied Message-Id: <20210601174117.661-1-em...@aabouzied.com> Signed-off-by: Ge

[PULL 3/5] input: Add lang1 and lang2 to QKeyCode

2021-06-24 Thread Gerd Hoffmann
From: Akihiko Odaki lang1 and lang2 represents the keys with the same names in the keyboard/keypad usage page (0x07) included in the "HID Usage Tables for Universal Serial Bus (USB)" version 1.22. Although the keys are described as "Hangul/English toggle key" and "Hanja conversion key" in the spe

[PULL 2/5] ui/cocoa: Add clipboard support

2021-06-24 Thread Gerd Hoffmann
From: Akihiko Odaki Signed-off-by: Akihiko Odaki Message-Id: <20210616141954.54291-1-akihiko.od...@gmail.com> Signed-off-by: Gerd Hoffmann --- include/ui/clipboard.h | 2 +- ui/clipboard.c | 2 +- ui/cocoa.m | 109 + 3 files chang

[PATCH v2 1/2] block/export: Conditionally ignore set-context error

2021-06-24 Thread Max Reitz
When invoking block-export-add with some iothread and fixed-iothread=false, and changing the node's iothread fails, the error is supposed to be ignored. However, it is still stored in *errp, which is wrong. If a second error occurs, the "*errp must be NULL" assertion in error_setv() fails: qem

[PATCH v2 0/2] block/export: Conditionally ignore set-context error

2021-06-24 Thread Max Reitz
Hi, I had this v2 lying around for quite some time but for some reason never sent it. I probably just forgot. Sorry. v1: https://lists.nongnu.org/archive/html/qemu-block/2021-04/msg00584.html Changes in v2: - Letting `bdrv_try_set_aio_context()` return an error and then just discarding it co

[PATCH v2 2/2] iotests/307: Test iothread conflict for exports

2021-06-24 Thread Max Reitz
Passing fixed-iothread=true should make iothread conflicts fatal, whereas fixed-iothread=false should not. Combine the second case with an error condition that is checked after the iothread is handled, to verify that qemu does not crash if there is such an error after changing the iothread failed.

Re: [PATCH v3 3/5] ui: Create sync objects and fences only for blobs

2021-06-24 Thread Gerd Hoffmann
> > Hi, > > > > > dmabuf->buf.fd = res->dmabuf_fd; > > > +dmabuf->buf.blob = true; > > > > Do you actually need the 'blob' field? > > I think checking 'fd' instead should work too. > [Kasireddy, Vivek] I want these changes to be limited to blob resources only > as I do not > know how

Re: [PATCH] hw/audio/sb16: Restrict I/O sampling rate range for command 41h/42h

2021-06-24 Thread Gerd Hoffmann
On Thu, Jun 24, 2021 at 10:11:35AM +0800, Qiang Liu wrote: > Hi > > > This looks like your mailer mangled the patch. > > Can you resent using 'git send-email`? > Yes, I can. I finally figure it out how to config my Gmail. I should > send a new email > and this thread is supposed to be closed, righ

Re: [PATCH 1/3] hw/timer: Add renesas_timer.

2021-06-24 Thread Philippe Mathieu-Daudé
Hi Yoshinori, On 6/23/21 2:34 PM, Yoshinori Sato wrote: > Renesas MCU / SoC have timer modules with similar functionality. > SH4-TMU 32bit count down timer. > RX-CMT 16bit compare match timer. > > Signed-off-by: Yoshinori Sato > --- > include/hw/timer/renesas_timer.h | 89 ++ > hw/timer/re

Re: [PATCH v3] ui/gtk: New -display gtk option 'full-screen-on-monitor'.

2021-06-24 Thread Gerd Hoffmann
On Thu, Jun 24, 2021 at 12:56:28AM +, Khor, Swee Aun wrote: > Hi Gerd, > I am able to compile the code without error with my v3 patch. I don't see my > patch showing up in https://patchew.org/QEMU/ , is it due to this compilation > error? > > I tried to change from %ld -> %lld but I encounte

RE: [PATCH v3] ui/gtk: New -display gtk option 'full-screen-on-monitor'.

2021-06-24 Thread Khor, Swee Aun
Thanks Gerd. I will submit another patch using PRId64 In warn_report. Regards, SweeAun -Original Message- From: Gerd Hoffmann Sent: Thursday, June 24, 2021 4:49 PM To: Khor, Swee Aun Cc: qemu-devel@nongnu.org; arm...@redhat.com; ebl...@redhat.com; Romli, Khairul Anuar ; Kasireddy, Vi

Re: [PATCH 2/3] hw/rx: rx62n switch renesas_timer.

2021-06-24 Thread Philippe Mathieu-Daudé
Hi Yoshinori, On 6/23/21 2:34 PM, Yoshinori Sato wrote: > Signed-off-by: Yoshinori Sato > --- > include/hw/rx/rx62n.h | 4 ++-- > hw/rx/Kconfig | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/hw/rx/rx62n.h b/include/hw/rx/rx62n.h > index 3ed80dba0d..c

Re: [PATCH v2 3/6] block: Clarify that @bytes is no limit on *pnum

2021-06-24 Thread Vladimir Sementsov-Ogievskiy
23.06.2021 18:01, Max Reitz wrote: .bdrv_co_block_status() implementations are free to return a *pnum that exceeds @bytes, because bdrv_co_block_status() in block/io.c will clamp *pnum as necessary. On the other hand, if drivers' implementations return values for *pnum that are as large as possi

Re: [PULL 04/21] acpi: ged: add control regs

2021-06-24 Thread Peter Maydell
On Thu, 17 Sept 2020 at 14:53, Gerd Hoffmann wrote: > > Add control regs (sleep, reset) for hw-reduced acpi. > > Signed-off-by: Gerd Hoffmann > Reviewed-by: Igor Mammedov > Message-id: 20200915120909.20838-5-kra...@redhat.com > --- > include/hw/acpi/generic_event_device.h | 12 +++ > hw/acp

Re: [PATCH v3 3/4] fuzz: fix the AC97 generic-fuzzer config.

2021-06-24 Thread Darren Kenny
Hi Alex, Given that 2 of the patches here are simply adding a capitalized version of the string, I wonder if this is something that should be case insensitive, and thus the code should change instead? Hypothetically, how likely is it that there are unrelated objects with the same name but differe

Re: [PATCH RFC 0/6] i386/pc: Fix creation of >= 1Tb guests on AMD systems with IOMMU

2021-06-24 Thread Dr. David Alan Gilbert
* Alex Williamson (alex.william...@redhat.com) wrote: > On Wed, 23 Jun 2021 10:30:29 +0100 > Joao Martins wrote: > > > On 6/22/21 10:16 PM, Alex Williamson wrote: > > > On Tue, 22 Jun 2021 16:48:59 +0100 > > > Joao Martins wrote: > > > > > >> Hey, > > >> > > >> This series lets Qemu properly

[PATCH 0/4] Integrate renesas MCU/SoC timer module [part 2 from review]

2021-06-24 Thread Philippe Mathieu-Daudé
Patches wrote while reviewing Yoshinory's series. I'm not reposting his patches with the fixup squashed because I made various comment on his v1 while reviewing. So posting with !fixup for easier integration while addressing review comments. Based-on: <20210623123416.60038-1-ys...@users.sourcefor

[PATCH 3/4] hw/timer: Remove RENESAS_TMR / RENESAS_CMT

2021-06-24 Thread Philippe Mathieu-Daudé
Both RENESAS_TMR / RENESAS_CMT have been replaced by the generic RENESAS_TIMER. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/timer/renesas_cmt.h | 43 --- include/hw/timer/renesas_tmr.h | 58 hw/timer/renesas_cmt.c | 283 --- hw/timer/renesas_tmr.c

Re: [PATCH v3 1/4] fuzz: adjust timeout to allow for longer inputs

2021-06-24 Thread Darren Kenny
On Wednesday, 2021-06-23 at 23:45:00 -04, Alexander Bulekov wrote: > Using a custom timeout is useful to continue fuzzing complex devices, > even after we run into some slow code-path. However, simply adding a > fixed timeout to each input effectively caps the maximum input > length/number of opera

[PATCH 1/4] !fixup hw/timer: Add renesas_timer.

2021-06-24 Thread Philippe Mathieu-Daudé
Fixup while reviewing. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/timer/renesas_timer.h | 1 + hw/timer/Kconfig | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/hw/timer/renesas_timer.h b/include/hw/timer/renesas_timer.h index dc0711ba832..ccf2e64b702 100

[PATCH 4/4] hw/timer: Remove SH_TIMER

2021-06-24 Thread Philippe Mathieu-Daudé
SH_TIMER has been replaced by the generic RENESAS_TIMER. Signed-off-by: Philippe Mathieu-Daudé --- hw/timer/sh_timer.c | 368 --- MAINTAINERS | 1 - hw/timer/Kconfig | 4 - hw/timer/meson.build | 1 - 4 files changed, 374 deletions(-)

[RFC PATCH 2/4] !fixup hw/rx: rx62n switch renesas_timer.

2021-06-24 Thread Philippe Mathieu-Daudé
Fixup while reviewing. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/rx/rx62n.h | 3 +-- hw/rx/rx62n.c | 6 +++--- hw/rx/Kconfig | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/hw/rx/rx62n.h b/include/hw/rx/rx62n.h index c35bf3998c7..a34b845e1

Re: [PATCH v2] hw/audio/sb16: Restrict I/O sampling rate range for command 41h/42h

2021-06-24 Thread Philippe Mathieu-Daudé
On 6/24/21 4:44 AM, Qiang Liu wrote: > The I/O sampling rate range is enforced to 5000 to 45000HZ according to > commit a2cd86a9. Setting I/O sampling rate with command 41h/42h, a guest > user can break this assumption and trigger an assertion in audio_calloc > via command 0xd4. This patch restrict

Re: [PATCH RFC 1/6] i386/pc: Account IOVA reserved ranges above 4G boundary

2021-06-24 Thread Dr. David Alan Gilbert
* Igor Mammedov (imamm...@redhat.com) wrote: > On Tue, 22 Jun 2021 16:49:00 +0100 > Joao Martins wrote: > > > It is assumed that the whole GPA space is available to be > > DMA addressable, within a given address space limit. Since > > v5.4 based that is not true, and VFIO will validate whether >

Re: [PULL 04/21] acpi: ged: add control regs

2021-06-24 Thread Gerd Hoffmann
Hi, > > +switch (addr) { > > +case ACPI_GED_REG_SLEEP_CTL: > > +slp_typ = (data >> 2) & 0x07; > > +slp_en = (data >> 5) & 0x01; > > +if (slp_en && slp_typ == 5) { > > +qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); > > +} > > +

Re: [PATCH v2 2/6] block: block-status cache for data regions

2021-06-24 Thread Vladimir Sementsov-Ogievskiy
23.06.2021 18:01, Max Reitz wrote: As we have attempted before (https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg06451.html, "file-posix: Cache lseek result for data regions"; https://lists.nongnu.org/archive/html/qemu-block/2021-02/msg00934.html, "file-posix: Cache next hole"), this patc

Re: [PATCH v2 3/6] block: Clarify that @bytes is no limit on *pnum

2021-06-24 Thread Max Reitz
On 24.06.21 11:15, Vladimir Sementsov-Ogievskiy wrote: 23.06.2021 18:01, Max Reitz wrote: .bdrv_co_block_status() implementations are free to return a *pnum that exceeds @bytes, because bdrv_co_block_status() in block/io.c will clamp *pnum as necessary. On the other hand, if drivers' implementa

Re: [RFC PATCH 9/9] hw/sd: Allow card size not power of 2 again

2021-06-24 Thread Daniel P . Berrangé
On Wed, Jun 23, 2021 at 08:00:21PM +0200, Philippe Mathieu-Daudé wrote: > In commit a9bcedd15a5 ("hw/sd/sdcard: Do not allow invalid SD card > sizes") we tried to protect us from CVE-2020-13253 by only allowing > card with power-of-2 sizes. However doing so we disrupted valid user > cases. As a com

[PATCH v2] virtiofsd: Don't allow file creation with FUSE_OPEN

2021-06-24 Thread Greg Kurz
A well behaved FUSE client uses FUSE_CREATE to create files. It isn't supposed to pass O_CREAT along a FUSE_OPEN request, as documented in the "fuse_lowlevel.h" header : /** * Open a file * * Open flags are available in fi->flags. The following rules * apply. * *

[PATCH v3 0/2] x86/sev: Measured Linux SEV guest with kernel/initrd/cmdline

2021-06-24 Thread Dov Murik
Currently booting with -kernel/-initrd/-append is not supported in SEV confidential guests, because the content of these blobs is not measured and therefore not trusted by the SEV guest. However, in some cases the kernel, initrd, and cmdline are not secret but should not be modified by the host.

[PATCH v3 1/2] sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot

2021-06-24 Thread Dov Murik
Add the sev_add_kernel_loader_hashes function to calculate the hashes of the kernel/initrd/cmdline and fill a designated OVMF encrypted hash table area. For this to work, OVMF must support an encrypted area to place the data which is advertised via a special GUID in the OVMF reset table. The hash

[PATCH v3 2/2] x86/sev: generate SEV kernel loader hashes in x86_load_linux

2021-06-24 Thread Dov Murik
If SEV is enabled and a kernel is passed via -kernel, pass the hashes of kernel/initrd/cmdline in an encrypted guest page to OVMF for SEV measured boot. Co-developed-by: James Bottomley Signed-off-by: James Bottomley Signed-off-by: Dov Murik Reviewed-by: Connor Kuehl --- hw/i386/x86.c | 25 ++

Re: [PATCH v2 1/2] block/export: Conditionally ignore set-context error

2021-06-24 Thread Vladimir Sementsov-Ogievskiy
24.06.2021 11:38, Max Reitz wrote: When invoking block-export-add with some iothread and fixed-iothread=false, and changing the node's iothread fails, the error is supposed to be ignored. However, it is still stored in *errp, which is wrong. If a second error occurs, the "*errp must be NULL" as

Re: [RFC PATCH 9/9] hw/sd: Allow card size not power of 2 again

2021-06-24 Thread Tom Yan
Hi, On Thu, 24 Jun 2021 at 02:01, Philippe Mathieu-Daudé wrote: > > In commit a9bcedd15a5 ("hw/sd/sdcard: Do not allow invalid SD card > sizes") we tried to protect us from CVE-2020-13253 by only allowing > card with power-of-2 sizes. However doing so we disrupted valid user > cases. As a comprom

Re: [PATCH v2 3/6] block: Clarify that @bytes is no limit on *pnum

2021-06-24 Thread Vladimir Sementsov-Ogievskiy
24.06.2021 13:16, Max Reitz wrote: On 24.06.21 11:15, Vladimir Sementsov-Ogievskiy wrote: 23.06.2021 18:01, Max Reitz wrote: .bdrv_co_block_status() implementations are free to return a *pnum that exceeds @bytes, because bdrv_co_block_status() in block/io.c will clamp *pnum as necessary. On th

[PATCH v4 01/34] modules: add modinfo macros

2021-06-24 Thread Gerd Hoffmann
Add macros for module info annotations. Instead of having that module meta-data stored in lists in util/module.c place directly in the module source code. Signed-off-by: Gerd Hoffmann --- include/qemu/module.h | 25 + 1 file changed, 25 insertions(+) diff --git a/includ

[PATCH v4 03/34] modules: generate modinfo.c

2021-06-24 Thread Gerd Hoffmann
Add script to generate C source with a small database containing the module meta-data. Signed-off-by: Gerd Hoffmann --- scripts/modinfo-generate.py | 84 + include/qemu/module.h | 17 softmmu/vl.c| 4 ++ util/module.c

Re: [PATCH v2 2/2] iotests/307: Test iothread conflict for exports

2021-06-24 Thread Vladimir Sementsov-Ogievskiy
24.06.2021 11:38, Max Reitz wrote: Passing fixed-iothread=true should make iothread conflicts fatal, whereas fixed-iothread=false should not. Combine the second case with an error condition that is checked after the iothread is handled, to verify that qemu does not crash if there is such an erro

[PATCH v4 00/34] modules: add meta-data database

2021-06-24 Thread Gerd Hoffmann
This patch series adds support for module meta-data. Today this is either hard-coded in qemu (see qemu_load_module_for_opts) or handled with manually maintained lists in util/module (see module_deps[] and qom_modules[]). This series replaced that scheme with annotation macros, so the meta-data ca

[PATCH v4 05/34] modules: add qxl module annotations

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/display/qxl.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 6e1f8ff1b2a7..84f99088e0a0 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -2522,6 +2522,7 @@ static const TypeInfo qxl_primary_info = {

[PATCH v4 07/34] modules: add chardev module annotations

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- chardev/baum.c | 1 + chardev/spice.c | 4 2 files changed, 5 insertions(+) diff --git a/chardev/baum.c b/chardev/baum.c index 5deca778bc44..79d618e35045 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -680,6 +680,7 @@ static const TypeInfo char_braille

[PATCH v4 04/34] modules: check if all dependencies can be satisfied

2021-06-24 Thread Gerd Hoffmann
From: "Jose R. Ziviani" Verifies if all dependencies are correctly listed in the modinfo.c too and stop the builds if they're not. Signed-off-by: Jose R. Ziviani Signed-off-by: Gerd Hoffmann --- scripts/modinfo-generate.py | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-)

[PATCH v4 08/34] modules: add audio module annotations

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- audio/spiceaudio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index 999bfbde47c5..a8d370fe6f31 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -317,3 +317,5 @@ static void register_audio_spice(void)

[PATCH v4 02/34] modules: collect module meta-data

2021-06-24 Thread Gerd Hoffmann
Add script to collect the module meta-data from the source code, store the results in *.modinfo files. Signed-off-by: Gerd Hoffmann --- scripts/modinfo-collect.py | 67 ++ meson.build| 16 + 2 files changed, 83 insertions(+) create mod

[PATCH v4 14/34] modules: use modinfo for dependencies

2021-06-24 Thread Gerd Hoffmann
Use module database for module dependencies. Drop hard-coded dependency list. Signed-off-by: Gerd Hoffmann Reviewed-by: Paolo Bonzini --- util/module.c | 55 --- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/util/module.c b/util/

[PATCH v4 06/34] modules: add virtio-gpu module annotations

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/display/vhost-user-gpu-pci.c | 1 + hw/display/vhost-user-gpu.c | 1 + hw/display/vhost-user-vga.c | 1 + hw/display/virtio-gpu-base.c| 1 + hw/display/virtio-gpu-gl.c | 3 +++ hw/display/virtio-gpu-pci-gl.c | 3 +++ hw/display/virtio-gpu-pci.

[PATCH v4 11/34] modules: add ui module annotations

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- ui/egl-headless.c | 4 ui/gtk.c | 4 ui/sdl2.c | 4 ui/spice-app.c| 3 +++ ui/spice-core.c | 5 + 5 files changed, 20 insertions(+) diff --git a/ui/egl-headless.c b/ui/egl-headless.c index da377a74af69..75404e0e8700 10064

[PATCH v4 10/34] modules: add ccid module annotations

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/ccid-card-emulated.c | 1 + hw/usb/ccid-card-passthru.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 5c76bed77aa0..6c8c0355e099 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/cc

[PATCH v4 09/34] modules: add usb-redir module annotations

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/redirect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 6a75b0dc4ab2..4ec9326e0582 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -2608,6 +2608,7 @@ static const TypeInfo usbredir_dev_info = {

[PATCH v4 15/34] modules: use modinfo for qom load

2021-06-24 Thread Gerd Hoffmann
Use module database to figure which module implements a given QOM type. Drop hard-coded object list. Signed-off-by: Gerd Hoffmann Reviewed-by: Paolo Bonzini --- util/module.c | 77 --- 1 file changed, 24 insertions(+), 53 deletions(-) diff --git

[PATCH v4 13/34] modules: add block module annotations

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- block/iscsi-opts.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/iscsi-opts.c b/block/iscsi-opts.c index afaf8837d6c1..4f2da405e645 100644 --- a/block/iscsi-opts.c +++ b/block/iscsi-opts.c @@ -68,3 +68,4 @@ static void iscsi_block_opts_init(void) }

[PATCH v4 12/34] modules: add s390x module annotations

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/s390x/virtio-ccw-gpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/s390x/virtio-ccw-gpu.c b/hw/s390x/virtio-ccw-gpu.c index 75a9e4bb3908..5868a2a07093 100644 --- a/hw/s390x/virtio-ccw-gpu.c +++ b/hw/s390x/virtio-ccw-gpu.c @@ -59,6 +59,7 @@ static

[PATCH v4 17/34] modules: add tracepoints

2021-06-24 Thread Gerd Hoffmann
One for module load and one for qom type lookup. Signed-off-by: Gerd Hoffmann --- util/module.c | 3 +++ util/trace-events | 4 2 files changed, 7 insertions(+) diff --git a/util/module.c b/util/module.c index a9ec2da9972e..acaaecad56c9 100644 --- a/util/module.c +++ b/util/module.c @@

[PATCH v4 22/34] modules: add module_obj() note to QOM docs

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Paolo Bonzini --- docs/devel/qom.rst | 8 1 file changed, 8 insertions(+) diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index 42d0dc4f4da8..e5fe3597cd82 100644 --- a/docs/devel/qom.rst +++ b/docs/devel/qom.rst @@ -87,6 +87,14 @@ specific

[PATCH v4 20/34] modules: target-specific module build infrastructure

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- meson.build | 37 + 1 file changed, 37 insertions(+) diff --git a/meson.build b/meson.build index 6ae2b9ab9443..76020b43fb32 100644 --- a/meson.build +++ b/meson.build @@ -1781,6 +1781,7 @@ user_ss = ss.source_set() util_ss =

[PATCH v4 21/34] modules: add documentation for module sourcesets

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Paolo Bonzini --- docs/devel/build-system.rst | 17 + 1 file changed, 17 insertions(+) diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst index 7ef36f42d0f5..fd1650442ecc 100644 --- a/docs/devel/build-system.rst +++ b

[PATCH v4 16/34] modules: use modinfo for qemu opts load

2021-06-24 Thread Gerd Hoffmann
Use module database to figure which module adds given QemuOpts group. Signed-off-by: Gerd Hoffmann Reviewed-by: Paolo Bonzini --- softmmu/vl.c| 17 - stubs/module-opts.c | 4 util/module.c | 19 +++ 3 files changed, 19 insertions(+), 21 deleti

[PATCH v4 24/34] modules: hook up modules.h to docs build

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Paolo Bonzini --- docs/devel/index.rst | 1 + docs/devel/modules.rst | 5 + 2 files changed, 6 insertions(+) create mode 100644 docs/devel/modules.rst diff --git a/docs/devel/index.rst b/docs/devel/index.rst index 977c3893bdaf..ba90badbbd6d 10064

[PATCH v4 34/34] monitor/tcg: move tcg hmp commands to accel/tcg, register them dynamically

2021-06-24 Thread Gerd Hoffmann
One more little step towards modular tcg ... Signed-off-by: Gerd Hoffmann --- accel/tcg/hmp.c | 29 + monitor/misc.c| 18 -- accel/tcg/meson.build | 1 + hmp-commands-info.hx | 2 -- 4 files changed, 30 insertions(+), 20 deletions(-)

[PATCH v4 27/34] accel: build qtest modular

2021-06-24 Thread Gerd Hoffmann
Allow building accelerators as module. Start with qtest as first user. Signed-off-by: Gerd Hoffmann --- accel/qtest/meson.build | 8 ++-- meson.build | 6 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/accel/qtest/meson.build b/accel/qtest/meson.build index

[PATCH v4 18/34] modules: check arch and block load on mismatch

2021-06-24 Thread Gerd Hoffmann
Add module_allow_arch() to set the target architecture. In case a module is limited to some arch verify arches match and ignore the module if not. Signed-off-by: Gerd Hoffmann --- include/qemu/module.h | 1 + softmmu/vl.c | 3 +++ util/module.c | 29 +++

[PATCH v4 25/34] accel: autoload modules

2021-06-24 Thread Gerd Hoffmann
Call module_object_class_by_name() instead of object_class_by_name() for objects possibly implemented as module Signed-off-by: Gerd Hoffmann --- accel/accel-common.c | 2 +- accel/accel-softmmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/accel-common.c b/accel

[PATCH v4 28/34] accel: add tcg module annotations

2021-06-24 Thread Gerd Hoffmann
Add module annotations for tcg so autoloading works. Signed-off-by: Gerd Hoffmann --- accel/tcg/tcg-accel-ops.c | 1 + accel/tcg/tcg-all.c | 1 + 2 files changed, 2 insertions(+) diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 7191315aeed4..1a8e8390bd60 100644 ---

[PATCH 3/5] tcg: Add tcg_gen_vec_shl{shr}{sar}16i_i32

2021-06-24 Thread LIU Zhiwei
Implement tcg_gen_vec_shl{shr}{sar}16i_tl by adding corresponging i32 OP. Signed-off-by: LIU Zhiwei --- include/tcg/tcg-op-gvec.h | 10 ++ tcg/tcg-op-gvec.c | 28 2 files changed, 38 insertions(+) diff --git a/include/tcg/tcg-op-gvec.h b/include/tcg/

[PATCH v4 19/34] modules: check arch on qom lookup

2021-06-24 Thread Gerd Hoffmann
With target-specific modules we can have multiple modules implementing the same object. Therefore we have to check the target arch on lookup to find the correct module. Signed-off-by: Gerd Hoffmann --- util/module.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/util/module.c b/util/

[PATCH v4 31/34] usb: drop usb_host_dev_is_scsi_storage hook

2021-06-24 Thread Gerd Hoffmann
Introduce an usb device flag instead, set it when usb-host looks at the device descriptors anyway. Also set it for emulated storage devices, for consistency. Add an inline helper function to check the flag. Signed-off-by: Gerd Hoffmann Acked-by: David Gibson --- include/hw/usb.h |

[PATCH v4 30/34] monitor: allow register hmp commands

2021-06-24 Thread Gerd Hoffmann
Allow commands having a NULL cmd pointer, add a function to set the pointer later. Use case: allow modules implement hmp commands. Signed-off-by: Gerd Hoffmann --- include/monitor/monitor.h | 3 +++ monitor/hmp.c | 7 +++ monitor/misc.c| 16 3 file

[PATCH 2/5] tcg: Add tcg_gen_vec_add{sub}8_i32

2021-06-24 Thread LIU Zhiwei
Implement tcg_gen_vec_add{sub}8_tl by adding corresponging i32 OP. Signed-off-by: LIU Zhiwei --- include/tcg/tcg-op-gvec.h | 6 ++ tcg/tcg-op-gvec.c | 38 ++ 2 files changed, 44 insertions(+) diff --git a/include/tcg/tcg-op-gvec.h b/include/tcg/t

[PATCH v4 23/34] modules: module.h kerneldoc annotations

2021-06-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Paolo Bonzini --- include/qemu/module.h | 59 +-- 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/include/qemu/module.h b/include/qemu/module.h index 7f4b1af8198c..8bc80535a4d4 100644 --- a/include/

[PATCH v3 01/37] target/riscv: implementation-defined constant parameters

2021-06-24 Thread LIU Zhiwei
ext_psfoperand is whether to support Zpsfoperand sub-extension. pext_ver is the packed specification version, default value is v0.9.4. Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 31 +++ target/riscv/cpu.h | 6 ++

[PATCH v4 33/34] usb: build usb-host as module

2021-06-24 Thread Gerd Hoffmann
Drop one more shared library dependency (libusb) from core qemu. Signed-off-by: Gerd Hoffmann --- hw/usb/host-libusb.c | 1 + hw/usb/meson.build | 8 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 2b7f87872ce3..c0f31446

[PATCH 1/5] tcg: Add tcg_gen_vec_add{sub}16_i32

2021-06-24 Thread LIU Zhiwei
Implement tcg_gen_vec_add{sub}16_tl by adding corresponding i32 OP. Signed-off-by: LIU Zhiwei --- include/tcg/tcg-op-gvec.h | 13 + tcg/tcg-op-gvec.c | 28 2 files changed, 41 insertions(+) diff --git a/include/tcg/tcg-op-gvec.h b/include/tcg/tcg

[PATCH v4 26/34] accel: add qtest module annotations

2021-06-24 Thread Gerd Hoffmann
Add module annotations for qtest so autoloading works. Signed-off-by: Gerd Hoffmann --- accel/qtest/qtest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index edb29f6fa4c0..7e6b8110d52b 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c

  1   2   3   4   >