[PATCH v8 14/20] commit and mirror: create new nodes using bdrv_get_aio_context, and not the job aiocontext

2022-06-29 Thread Emanuele Giuseppe Esposito
We are always using the given bs AioContext, so there is no need to take the job ones (which is identical anyways). This also reduces the point we need to check when protecting job.aio_context field. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- block/commit.c | 4 +

Re: [PATCH 12/14] aspeed: Make aspeed_board_init_flashes public

2022-06-29 Thread Alex Bennée
Cédric Le Goater writes: > On 6/24/22 18:50, Cédric Le Goater wrote: >> On 6/23/22 20:43, Peter Delevoryas wrote: >>> >>> On Jun 23, 2022, at 8:09 AM, Cédric Le Goater wrote: On 6/23/22 12:26, Peter Delevoryas wrote: > Signed-off-by: Peter Delevoryas Let's start s

[PATCH v8 09/20] blockjob: rename notifier callbacks as _locked

2022-06-29 Thread Emanuele Giuseppe Esposito
They all are called with job_lock held, in job_event_*_locked() Signed-off-by: Emanuele Giuseppe Esposito --- blockjob.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/blockjob.c b/blockjob.c index 0d59aba439..70952879d8 100644 --- a/blockjob.c ++

[PATCH v8 06/20] job.h: define functions called without job lock held

2022-06-29 Thread Emanuele Giuseppe Esposito
These functions don't need a _locked() counterpart, since they are all called outside job.c and take the lock only internally. Update also the comments in blockjob.c (and move them in job.c). Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. No functional change intende

[PATCH v8 16/20] jobs: protect job.aio_context with BQL and job_mutex

2022-06-29 Thread Emanuele Giuseppe Esposito
In order to make it thread safe, implement a "fake rwlock", where we allow reads under BQL *or* job_mutex held, but writes only under BQL *and* job_mutex. The only write we have is in child_job_set_aio_ctx, which always happens under drain (so the job is paused). For this reason, introduce job_set

[PATCH v8 20/20] job: remove unused functions

2022-06-29 Thread Emanuele Giuseppe Esposito
These public functions are not used anywhere, thus can be dropped. Also, since this is the final job API that doesn't use AioContext lock and replaces it with job_lock, adjust all remaining function documentation to clearly specify if the job lock is taken or not. Signed-off-by: Emanuele Giuseppe

[PATCH v8 02/20] job.h: categorize fields in struct Job

2022-06-29 Thread Emanuele Giuseppe Esposito
Categorize the fields in struct Job to understand which ones need to be protected by the job mutex and which don't. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/qemu/job.h | 61 +++--- 1 file changed, 36

[PATCH v8 08/20] blockjob.h: introduce block_job _locked() APIs

2022-06-29 Thread Emanuele Giuseppe Esposito
Just as done with job.h, create _locked() functions in blockjob.h These functions will be later useful when caller has already taken the lock. All blockjob _locked functions call job _locked functions. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. Signed-off-by: Ema

[PATCH v8 19/20] blockjob: remove unused functions

2022-06-29 Thread Emanuele Giuseppe Esposito
These public functions are not used anywhere, thus can be dropped. Signed-off-by: Emanuele Giuseppe Esposito --- blockjob.c | 30 -- include/block/blockjob.h | 33 + 2 files changed, 13 insertions(+), 50 deletions(-) diff

[PATCH v8 11/20] jobs: use job locks also in the unit tests

2022-06-29 Thread Emanuele Giuseppe Esposito
Add missing job synchronization in the unit tests, with explicit locks. We are deliberately using _locked functions wrapped by a guard instead of a normal call because the normal call will be removed in future, as the only usage is limited to the tests. In other words, if a function like job_paus

[PATCH v8 01/20] job.c: make job_mutex and job_lock/unlock() public

2022-06-29 Thread Emanuele Giuseppe Esposito
job mutex will be used to protect the job struct elements and list, replacing AioContext locks. Right now use a shared lock for all jobs, in order to keep things simple. Once the AioContext lock is gone, we can introduce per-job locks. To simplify the switch from aiocontext to job lock, introduce

[PATCH v8 07/20] job.h: add _locked public functions

2022-06-29 Thread Emanuele Giuseppe Esposito
These functions will be used later when we use the job lock. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/job.h | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/include/

[PATCH v8 18/20] block_job_query: remove atomic read

2022-06-29 Thread Emanuele Giuseppe Esposito
Not sure what the atomic here was supposed to do, since job.busy is protected by the job lock. Since the whole function is called under job_mutex, just remove the atomic. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- blockjob.c | 2 +- 1 file changed, 1 insertion(+)

[PATCH v8 05/20] job.c: add job_lock/unlock while keeping job.h intact

2022-06-29 Thread Emanuele Giuseppe Esposito
With "intact" we mean that all job.h functions implicitly take the lock. Therefore API callers are unmodified. This means that: - all static functions become _locked, and call _locked functions - all public functions take the lock internally, and call _locked functions - all public functions cal

Re: [PATCH v3 3/4] tests: acpi: q35: add test for hmat nodes without initiators

2022-06-29 Thread Igor Mammedov
On Wed, 29 Jun 2022 11:35:10 +0200 Brice Goglin wrote: > Build a machine with 4 cores and 3 NUMA nodes. > 1st NUMA is local to cores #0-1. > 2nd NUMA is local to cores #2-3. > 3rd NUMA has no initiator. > HMAT SLLB says memory access performance of 3rd NUMA is lower, > but it's identical for all

Re: qemu-system-s390x hang in tcg

2022-06-29 Thread Sven Schnelle
Alex Bennée writes: > Sven Schnelle writes: > >> Hi, >> >> David Hildenbrand writes: >> >>> On 04.05.22 09:37, Janosch Frank wrote: I had a short look yesterday and the boot usually hangs in the raid6 code. Disabling vector instructions didn't make a difference but a few interr

[PATCH v8 10/20] jobs: add job lock in find_* functions

2022-06-29 Thread Emanuele Giuseppe Esposito
Both blockdev.c and job-qmp.c have TOC/TOU conditions, because they first search for the job and then perform an action on it. Therefore, we need to do the search + action under the same job mutex critical section. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. Signed

qemu-system-s390x hang in tcg (was: Re: [PATCH v8 23/70] mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap())

2022-06-29 Thread Sven Schnelle
Hi, David Hildenbrand writes: > On 04.05.22 09:37, Janosch Frank wrote: >> I had a short look yesterday and the boot usually hangs in the raid6 >> code. Disabling vector instructions didn't make a difference but a few >> interruptions via GDB solve the problem for some reason. >> >> CCing Dav

[PATCH v8 04/20] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED

2022-06-29 Thread Emanuele Giuseppe Esposito
Same as AIO_WAIT_WHILE macro, but if we are in the Main loop do not release and then acquire ctx_ 's aiocontext. Once all Aiocontext locks go away, this macro will replace AIO_WAIT_WHILE. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi Reviewed-by: Vladimir Sementsov-Ogie

Re: qemu-system-s390x hang in tcg

2022-06-29 Thread Sven Schnelle
Sven Schnelle writes: > Alex Bennée writes: > >> Sven Schnelle writes: >> >>> Hi, >>> >>> David Hildenbrand writes: >>> On 04.05.22 09:37, Janosch Frank wrote: > I had a short look yesterday and the boot usually hangs in the raid6 > code. Disabling vector instructions didn't make

Re: [PATCH v5 04/12] qapi: net: introduce a way to bypass qemu_opts_parse_noisily()

2022-06-29 Thread Markus Armbruster
Laurent Vivier writes: > As qemu_opts_parse_noisily() flattens the QAPI structures ("type" field > of Netdev structure can collides with "type" field of SocketAddress), > we introduce a way to bypass qemu_opts_parse_noisily() and use directly > visit_type_Netdev() to parse the backend parameters.

[PATCH] io_uring: fix short read slow path corruptions

2022-06-29 Thread Dominique Martinet
sqeq.off here is the offset to read within the disk image, so obviously not 'nread' (the amount we just read), but as the author meant to write its current value incremented by the amount we just read. Normally recent versions of linux will not issue short reads, but apparently btrfs with O_DIRECT

Re: [PATCH] io_uring: fix short read slow path corruptions

2022-06-29 Thread Dominique Martinet
Kevin Wolf wrote on Wed, Jun 29, 2022 at 10:46:08AM +0200: > I see this a few lines above: > > /* Update read position */ > luringcb->total_read = nread; > > Doesn't it have the same problem? Though maybe getting two short reads > is more of a theoretical case. Good catch, I'll send a v2

Re: [PATCH] microvm: turn off io reservations for pcie root ports

2022-06-29 Thread Michael S. Tsirkin
On Wed, Jun 29, 2022 at 02:20:50PM +0200, Gerd Hoffmann wrote: > On Wed, Jun 29, 2022 at 03:16:17AM -0400, Michael S. Tsirkin wrote: > > On Wed, Jun 29, 2022 at 09:10:23AM +0200, Gerd Hoffmann wrote: > > > On Mon, Jun 27, 2022 at 06:37:50PM -0400, Michael S. Tsirkin wrote: > > > > On Thu, Jun 09, 2

[PATCH] io_uring: fix short read slow path corruptions

2022-06-29 Thread Dominique Martinet
sqeq.off here is the offset to read within the disk image, so obviously not 'nread' (the amount we just read), but as the author meant to write its current value incremented by the amount we just read. Normally recent versions of linux will not issue short reads, but apparently btrfs with O_DIRECT

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Markus Armbruster
Yongji Xie writes: > On Wed, Jun 29, 2022 at 7:39 PM Markus Armbruster wrote: >> >> Yongji Xie writes: >> >> > On Wed, Jun 29, 2022 at 5:41 PM Markus Armbruster >> > wrote: >> >> >> >> Xie Yongji writes: >> >> >> >> > Coverity pointed out (CID 1490222, 1490227) that we called >> >> > ioctl s

[PATCH 40/40] pckbd: remove legacy i8042_mm_init() function

2022-06-29 Thread Mark Cave-Ayland
This legacy function is only used during the initialisation of the MIPS magnum machine, so inline its functionality directly into mips_jazz_init() and then remove it. Signed-off-by: Mark Cave-Ayland --- hw/input/pckbd.c | 16 hw/mips/jazz.c | 13 ++---

Re: [Qemu-devel] [PATCH 1/2] decodetree: Initial support for variable-length ISAs

2022-06-29 Thread Peter Maydell
On Thu, 31 Jan 2019 at 21:10, Richard Henderson wrote: > > Assuming that the ISA clearly describes how to determine > the length of the instruction, and the ISA has a reasonable > maximum instruction length, the input to the decoder can be > right-justified in an appropriate insn word. > > This is

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Yongji Xie
On Wed, Jun 29, 2022 at 9:22 PM Markus Armbruster wrote: > > Yongji Xie writes: > > > On Wed, Jun 29, 2022 at 7:39 PM Markus Armbruster wrote: > >> > >> Yongji Xie writes: > >> > >> > On Wed, Jun 29, 2022 at 5:41 PM Markus Armbruster > >> > wrote: > >> >> > >> >> Xie Yongji writes: > >> >> >

[PATCH 37/40] ps2: remove unused legacy ps2_kbd_init() function

2022-06-29 Thread Mark Cave-Ayland
Now that the legacy ps2_kbd_init() function is no longer used, it can be completely removed along with its associated trace-event. Signed-off-by: Mark Cave-Ayland --- hw/input/ps2.c | 13 - hw/input/trace-events | 1 - include/hw/input/ps2.h | 1 - 3 files changed, 15 del

Re: [PATCH v5 05/12] qapi: net: add stream and dgram netdevs

2022-06-29 Thread Markus Armbruster
Laurent Vivier writes: > Copied from socket netdev file and modified to use SocketAddress > to be able to introduce new features like unix socket. > > "udp" and "mcast" are squashed into dgram netdev, multicast is detected > according to the IP address type. > "listen" and "connect" modes are man

[PATCH 36/40] pckbd: don't use legacy ps2_kbd_init() function

2022-06-29 Thread Mark Cave-Ayland
Instantiate the PS2 keyboard device within KBDState using object_initialize_child() in i8042_initfn() and i8042_mmio_init() and realize it in i8042_realizefn() and i8042_mmio_realize() accordingly. Signed-off-by: Mark Cave-Ayland --- hw/input/pckbd.c | 29 + i

[PATCH 32/40] lasips2: don't use legacy ps2_kbd_init() function

2022-06-29 Thread Mark Cave-Ayland
Instantiate the PS2 keyboard device within LASIPS2KbdPort using object_initialize_child() in lasips2_kbd_port_init() and realize it in lasips2_kbd_port_realize() accordingly. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 10 +- include/hw/input/lasips2.h | 2 ++ 2 fil

[PATCH 39/40] ps2: remove unused legacy ps2_mouse_init() function

2022-06-29 Thread Mark Cave-Ayland
Now that the legacy ps2_mouse_init() function is no longer used, it can be completely removed along with its associated trace-event. Signed-off-by: Mark Cave-Ayland --- hw/input/ps2.c | 13 - hw/input/trace-events | 1 - include/hw/input/ps2.h | 1 - 3 files changed, 15 d

[PATCH 38/40] pckbd: don't use legacy ps2_mouse_init() function

2022-06-29 Thread Mark Cave-Ayland
Instantiate the PS2 mouse device within KBDState using object_initialize_child() in i8042_initfn() and i8042_mmio_init() and realize it in i8042_realizefn() and i8042_mmio_realize() accordingly. Signed-off-by: Mark Cave-Ayland --- hw/input/pckbd.c | 27 +++ includ

[PATCH 34/40] lasips2: update VMStateDescription for LASIPS2 device

2022-06-29 Thread Mark Cave-Ayland
Since this series has already introduced a migration break for the HPPA B160L machine, we can use this opportunity to improve the VMStateDescription for the LASIPS2 device. Add the new int_status field to the VMStateDescription and remodel the ports as separate VMSTATE_STRUCT instances. Signed-of

[PATCH 31/40] lasips2: switch register memory region to DEVICE_BIG_ENDIAN

2022-06-29 Thread Mark Cave-Ayland
The LASI device (and so also the LASIPS2 device) are only used for the HPPA B160L machine which is a big endian architecture. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 0

[PATCH 33/40] lasips2: don't use legacy ps2_mouse_init() function

2022-06-29 Thread Mark Cave-Ayland
Instantiate the PS2 mouse device within LASIPS2MousePort using object_initialize_child() in lasips2_mouse_port_init() and realize it in lasips2_mouse_port_realize() accordingly. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 10 +- include/hw/input/lasips2.h | 2 ++ 2

[PATCH 26/40] lasips2: add named input gpio to port for downstream PS2 device IRQ

2022-06-29 Thread Mark Cave-Ayland
The named input gpio is to be connected to the IRQ output of the downstream PS2 device and used to drive the port IRQ. Initialise the named input gpio in lasips2_port_init() and add new lasips2_port_class_init() and lasips2_port_realize() functions to connect the PS2 device output gpio to the new n

[PATCH 28/40] lasips2: switch to using port-based IRQs

2022-06-29 Thread Mark Cave-Ayland
Now we can implement port-based IRQs by wiring the PS2 device IRQs to the LASI2Port named input gpios rather than directly to the LASIPS2 device, and generate the LASIPS2 output IRQ from the int_status bitmap representing the individual port IRQs instead of the birq boolean. This enables us to rem

[PATCH 35/40] pckbd: introduce new vmstate_kbd_mmio VMStateDescription for the I8042_MMIO device

2022-06-29 Thread Mark Cave-Ayland
This enables us to register the VMStateDescription using the DeviceClass vmsd property rather than having to call vmstate_register() from i8042_mmio_realize(). Note that this is a migration break for the MIPS jazz machine which is the only user of the I8042_MMIO device. Signed-off-by: Mark Cave-

[PATCH 27/40] lasips2: add named input gpio to handle incoming port IRQs

2022-06-29 Thread Mark Cave-Ayland
The LASIPS2 device named input gpio is soon to be connected to the port output IRQs. Add a new int_status field to LASIPS2State which is a bitmap representing the port input IRQ status. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 15 +++ include/hw/input/lasips2.

[PATCH 25/40] lasips2: introduce LASIPS2PortDeviceClass for the LASIPS2_PORT device

2022-06-29 Thread Mark Cave-Ayland
This will soon be used to store the reference to the LASIPS2_PORT parent device for LASIPS2_KBD_PORT and LASIPS2_MOUSE_PORT. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 2 ++ include/hw/input/lasips2.h | 6 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a

[PATCH 22/40] lasips2: introduce lasips2_mouse_port_class_init() and lasips2_mouse_port_realize()

2022-06-29 Thread Mark Cave-Ayland
Introduce a new lasips2_mouse_port_class_init() function which uses a new lasips2_mouse_port_realize() function to initialise the PS2 mouse device. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hw/input

[PATCH 29/40] lasips2: rename LASIPS2Port parent pointer to lasips2

2022-06-29 Thread Mark Cave-Ayland
This makes it clearer that the pointer is a reference to the LASIPS2 container device rather than an implied part of the QOM hierarchy. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 6 +++--- include/hw/input/lasips2.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)

[PATCH 16/40] lasips2: QOMify LASIPS2Port

2022-06-29 Thread Mark Cave-Ayland
This becomes an abstract QOM type which will be a parent type for separate keyboard and mouse port types. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 8 include/hw/input/lasips2.h | 14 ++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/

[PATCH 24/40] lasips2: introduce port IRQ and new lasips2_port_init() function

2022-06-29 Thread Mark Cave-Ayland
Introduce a new lasips2_port_init() QOM init function for the LASIPS2_PORT type and use it to initialise a new gpio for use as a port IRQ. Add a new qemu_irq representing the gpio as a new irq field within LASIPS2Port. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 8

[PATCH 30/40] lasips2: standardise on lp name for LASIPS2Port variables

2022-06-29 Thread Mark Cave-Ayland
This is shorter to type and keeps the naming convention consistent within the LASIPS2 device. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 52 +++--- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/

[PATCH 17/40] lasips2: introduce new LASIPS2_KBD_PORT QOM type

2022-06-29 Thread Mark Cave-Ayland
This will be soon be used to hold the underlying PS2_KBD_DEVICE object. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 7 +++ include/hw/input/lasips2.h | 7 +++ 2 files changed, 14 insertions(+) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 56bfd759af..b0

[PATCH 21/40] lasips2: introduce lasips2_kbd_port_class_init() and lasips2_kbd_port_realize()

2022-06-29 Thread Mark Cave-Ayland
Introduce a new lasips2_kbd_port_class_init() function which uses a new lasips2_kbd_port_realize() function to initialise the PS2 keyboard device. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hw/input/

[PATCH 13/40] lasips2: remove the qdev base property and the lasips2_properties array

2022-06-29 Thread Mark Cave-Ayland
The base property was only needed for use by vmstate_register() in order to preserve migration compatibility. Now that the lasips2 migration state is registered through the DeviceClass vmsd field, the base property and also the lasips2_properties array can be removed completely as they are no longe

[PATCH 10/40] pl050: don't use legacy ps2_kbd_init() function

2022-06-29 Thread Mark Cave-Ayland
Instantiate the PS2 keyboard device within PL050KbdState using object_initialize_child() in pl050_kbd_init() and realize it in pl050_kbd_realize() accordingly. Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 13 ++--- include/hw/input/pl050.h | 2 ++ 2 files changed, 12 i

[PATCH 23/40] lasips2: rename LASIPS2Port irq field to birq

2022-06-29 Thread Mark Cave-Ayland
The existing boolean irq field in LASIPS2Port will soon be replaced by a proper qemu_irq, so rename the field to birq to allow the upcoming qemu_irq to use the irq name. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 24 include/hw/input/lasips2.h | 2

[PATCH 11/40] pl050: don't use legacy ps2_mouse_init() function

2022-06-29 Thread Mark Cave-Ayland
Instantiate the PS2 mouse device within PL050MouseState using object_initialize_child() in pl050_mouse_init() and realize it in pl050_mouse_realize() accordingly. Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 13 ++--- include/hw/input/pl050.h | 2 ++ 2 files changed, 1

[PATCH 20/40] lasips2: move mouse port initialisation to new lasips2_mouse_port_init() function

2022-06-29 Thread Mark Cave-Ayland
Move the initialisation of the mouse port from lasips2_init() to a new lasips2_mouse_port_init() function which will be invoked using object_initialize_child() during the LASIPS2 device init. Update LASIPS2State so that it now holds the new LASIPS2MousePort child object and ensure that it is real

[PATCH 07/40] pl050: introduce PL050DeviceClass for the PL050 device

2022-06-29 Thread Mark Cave-Ayland
This will soon be used to store the reference to the PL050 parent device for PL050_KBD_DEVICE and PL050_MOUSE_DEVICE. Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 2 ++ include/hw/input/pl050.h | 8 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/input

[PATCH 19/40] lasips2: move keyboard port initialisation to new lasips2_kbd_port_init() function

2022-06-29 Thread Mark Cave-Ayland
Move the initialisation of the keyboard port from lasips2_init() to a new lasips2_kbd_port_init() function which will be invoked using object_initialize_child() during the LASIPS2 device init. Update LASIPS2State so that it now holds the new LASIPS2KbdPort child object and ensure that it is realis

[PATCH 15/40] lasips2: change LASIPS2State dev pointer from void to PS2State

2022-06-29 Thread Mark Cave-Ayland
This allows the compiler to enforce that the PS2 device pointer is always of type PS2State. Update the name of the pointer from dev to ps2dev to emphasise this type change. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 16 include/hw/input/lasips2.h | 3 ++-

[PATCH 12/40] lasips2: don't use vmstate_register() in lasips2_realize()

2022-06-29 Thread Mark Cave-Ayland
Since lasips2 is a qdev device then vmstate_ps2_mouse can be registered using the DeviceClass vmsd field instead. Note that due to the use of the base parameter in the original vmstate_register() function call, this is actually a migration break for the HPPA B160L machine. Signed-off-by: Mark Ca

[PATCH 18/40] lasips2: introduce new LASIPS2_MOUSE_PORT QOM type

2022-06-29 Thread Mark Cave-Ayland
This will be soon be used to hold the underlying PS2_MOUSE_DEVICE object. Signed-off-by: Mark Cave-Ayland --- hw/input/lasips2.c | 7 +++ include/hw/input/lasips2.h | 7 +++ 2 files changed, 14 insertions(+) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index b043f2e264..

[PATCH 06/40] pl050: move logic from pl050_realize() to pl050_init()

2022-06-29 Thread Mark Cave-Ayland
The logic for initialising the register memory region and the sysbus output IRQ does not depend upon any device properties and so can be moved from pl050_realize() to pl050_init(). Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions

[PATCH 04/40] pl050: introduce new PL050_KBD_DEVICE QOM type

2022-06-29 Thread Mark Cave-Ayland
This will be soon be used to hold the underlying PS2_KBD_DEVICE object. Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 3 ++- include/hw/input/pl050.h | 7 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 0d91b0eaea..

[PATCH 09/40] pl050: introduce pl050_mouse_class_init() and pl050_mouse_realize()

2022-06-29 Thread Mark Cave-Ayland
Introduce a new pl050_mouse_class_init() function containing a call to device_class_set_parent_realize() which calls a new pl050_mouse_realize() function to initialise the PS2 mouse device. Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 23 +++ 1 file changed, 19 inse

[PATCH 05/40] pl050: introduce new PL050_MOUSE_DEVICE QOM type

2022-06-29 Thread Mark Cave-Ayland
This will be soon be used to hold the underlying PS2_MOUSE_DEVICE object. Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 3 ++- include/hw/input/pl050.h | 7 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 7f4ac99081

[PATCH 14/40] lasips2: remove legacy lasips2_initfn() function

2022-06-29 Thread Mark Cave-Ayland
There is only one user of the legacy lasips2_initfn() function which is in machine_hppa_init(), so inline its functionality into machine_hppa_init() and then remove it. Signed-off-by: Mark Cave-Ayland --- hw/hppa/machine.c | 6 -- hw/input/lasips2.c | 12 inclu

[PATCH 08/40] pl050: introduce pl050_kbd_class_init() and pl050_kbd_realize()

2022-06-29 Thread Mark Cave-Ayland
Introduce a new pl050_kbd_class_init() function containing a call to device_class_set_parent_realize() which calls a new pl050_kbd_realize() function to initialise the PS2 keyboard device. Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 21 +++-- 1 file changed, 19 inserti

[PATCH 01/40] pl050: move PL050State from pl050.c to new pl050.h header file

2022-06-29 Thread Mark Cave-Ayland
This allows the QOM types in pl050.c to be used elsewhere by simply including pl050.h. Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 16 +--- include/hw/input/pl050.h | 35 +++ 2 files changed, 36 insertions(+), 15 deletions(-) create

[PATCH 02/40] pl050: rename pl050_keyboard_init() to pl050_kbd_init()

2022-06-29 Thread Mark Cave-Ayland
This is for consistency with all of the other devices that use the PS2 keyboard device. Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index c7980b6ed7..8e32b8ed46 100644 --- a/hw/in

[PATCH 00/40] PS2 device QOMification - part 2

2022-06-29 Thread Mark Cave-Ayland
Here is the follow-on series from part 1 which completes the work to remove the legacy global device init functions for PS2 devices. Now that part 1 has been applied, the hard part to remove the PS2 function callback and argument has been completed and all that remains is to improve the PS2 device

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Yongji Xie
On Wed, Jun 29, 2022 at 7:39 PM Markus Armbruster wrote: > > Yongji Xie writes: > > > On Wed, Jun 29, 2022 at 5:41 PM Markus Armbruster wrote: > >> > >> Xie Yongji writes: > >> > >> > Coverity pointed out (CID 1490222, 1490227) that we called > >> > ioctl somewhere without checking the return v

[PATCH 03/40] pl050: change PL050State dev pointer from void to PS2State

2022-06-29 Thread Mark Cave-Ayland
This allows the compiler to enforce that the PS2 device pointer is always of type PS2State. Update the name of the pointer from dev to ps2dev to emphasise this type change. Signed-off-by: Mark Cave-Ayland --- hw/input/pl050.c | 13 +++-- include/hw/input/pl050.h | 2 +- 2 files

Re: [RFC PATCH] tests/9p: introduce declarative function calls

2022-06-29 Thread Christian Schoenebeck
On Mittwoch, 29. Juni 2022 09:35:02 CEST Greg Kurz wrote: > Hi Christian, Hi Greg, first off, this RFC patch was really just yet intended for discussing the high aspect coding style idea of using named function arguments in general (with a random example), i.e. checking acceptance, but also to se

Re: [PATCH] microvm: turn off io reservations for pcie root ports

2022-06-29 Thread Gerd Hoffmann
On Wed, Jun 29, 2022 at 03:16:17AM -0400, Michael S. Tsirkin wrote: > On Wed, Jun 29, 2022 at 09:10:23AM +0200, Gerd Hoffmann wrote: > > On Mon, Jun 27, 2022 at 06:37:50PM -0400, Michael S. Tsirkin wrote: > > > On Thu, Jun 09, 2022 at 09:28:38AM +0200, Gerd Hoffmann wrote: > > > > On Wed, Jun 08, 2

Re: [PATCH v8 3/4] target/riscv: Update [m|h]tinst CSR in riscv_cpu_do_interrupt()

2022-06-29 Thread dramforever
On 6/28/22 18:17, Anup Patel wrote: > We should write transformed instruction encoding of the trapped > instruction in [m|h]tinst CSR at time of taking trap as defined > by the RISC-V privileged specification v1.12. > > Reviewed-by: Alistair Francis > Signed-off-by: Anup Patel > --- > target/r

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Markus Armbruster
Yongji Xie writes: > On Wed, Jun 29, 2022 at 5:41 PM Markus Armbruster wrote: >> >> Xie Yongji writes: >> >> > Coverity pointed out (CID 1490222, 1490227) that we called >> > ioctl somewhere without checking the return value. This >> > patch fixes these issues. >> > >> > Fixes: Coverity CID 149

Re: [PATCH] hw/arm/virt: dt: add rng-seed property

2022-06-29 Thread Jason A. Donenfeld
On Wed, Jun 29, 2022 at 11:18:23AM +0100, Alex Bennée wrote: > > Peter Maydell writes: > > > On Tue, 28 Jun 2022 at 19:45, Jason A. Donenfeld wrote: > >> > >> On 6/27/22, Jason A. Donenfeld wrote: > >> > On 6/27/22, Peter Maydell wrote: > >> >> On Mon, 27 Jun 2022 at 17:07, Jason A. Donenfeld

Re: [RFC PATCH v4 10/11] qemu-sockets: introduce socket_uri()

2022-06-29 Thread Markus Armbruster
Laurent Vivier writes: > Format a string URI from a SocketAddress. > > Original code from hmp-cmds.c:SocketAddress_to_str() > > Replace 'tcp:' by 'inet:' (because 'inet' can be also 'udp'). This one's merely misleading. > Replace 'tcp:' by 'vsock:' with vsock socket type. This one's positively

Re: [PATCH v5 05/12] qapi: net: add stream and dgram netdevs

2022-06-29 Thread Markus Armbruster
Laurent Vivier writes: > Copied from socket netdev file and modified to use SocketAddress > to be able to introduce new features like unix socket. > > "udp" and "mcast" are squashed into dgram netdev, multicast is detected > according to the IP address type. > "listen" and "connect" modes are man

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Yongji Xie
On Wed, Jun 29, 2022 at 5:41 PM Markus Armbruster wrote: > > Xie Yongji writes: > > > Coverity pointed out (CID 1490222, 1490227) that we called > > ioctl somewhere without checking the return value. This > > patch fixes these issues. > > > > Fixes: Coverity CID 1490222, 1490227 > > Signed-off-by

Re: [RFC PATCH v4 04/11] qapi: net: add stream and dgram netdevs

2022-06-29 Thread Markus Armbruster
Laurent Vivier writes: > On 24/06/2022 11:41, Markus Armbruster wrote: >> Laurent Vivier writes: >> >>> Copied from socket netdev file and modified to use SocketAddress >>> to be able to introduce new features like unix socket. >>> >>> "udp" and "mcast" are squashed into dgram netdev, multicast

Re: [PATCH 0/2] python/qemu/machine: fix potential hang in QMP accept

2022-06-29 Thread Marc-André Lureau
Hi On Tue, Jun 28, 2022 at 9:08 PM John Snow wrote: > > On Tue, Jun 28, 2022 at 9:49 AM wrote: > > > > From: Marc-André Lureau > > > > Hi, > > > > As reported earlier by Richard Henderson ("virgl avocado hang" thread), > > avocado > > tests may hang when QEMU exits before the QMP connection is

Re: [PATCH v5 03/12] net: simplify net_client_parse() error management

2022-06-29 Thread Markus Armbruster
Laurent Vivier writes: > All net_client_parse() callers exit in case of error. > > Move exit(1) to net_client_parse() and remove error checking from > the callers. > > Suggested-by: Markus Armbruster > Signed-off-by: Laurent Vivier Reviewed-by: Markus Armbruster

Re: [RFC PATCH 00/12] Introduce QEMU userspace ebpf support

2022-06-29 Thread Andrew Melnichenko
Hi all, Nice idea. It would be great if future patches would add the BPF map support(if uBPF allows it). On Fri, Jun 17, 2022 at 10:51 AM Zhang Chen wrote: > > Hi All, > > The goal of this series is to bring the power of ebpf to QEMU. > It makes QEMU have the ability to extend the capabilitie

Re: [PATCH v5 2/2] target/xtensa: Use semihosting/syscalls.h

2022-06-29 Thread Max Filippov
On Wed, Jun 29, 2022 at 3:14 AM Alex Bennée wrote: > Max Filippov writes: > > There's no notion of 'serial hardware' for the xtensa-sim, all it has is > > the three standard stdio file descriptors. > > Which are accessed via semihosting calls? Yes. > Are they implicitly mapped to > 3 chardev d

Re: [PATCH RFC 1/2] arm/kvm: enable MTE if available

2022-06-29 Thread Eric Auger
Hi Connie, On 6/14/22 10:40, Cornelia Huck wrote: > On Fri, Jun 10 2022, Eric Auger wrote: > >> Hi Connie, >> On 5/12/22 15:11, Cornelia Huck wrote: >>> We need to disable migration, as we do not yet have a way to migrate >>> the tags as well. >> >> This patch does much more than adding a migrat

Re: [PATCH RFC 0/2] arm: enable MTE for QEMU + kvm

2022-06-29 Thread Eric Auger
Hi Connie, On 6/13/22 18:02, Cornelia Huck wrote: > On Fri, Jun 10 2022, Eric Auger wrote: > >> Hi Connie, >> >> On 5/12/22 15:11, Cornelia Huck wrote: >>> This series enables MTE for kvm guests, if the kernel supports it. >>> Lightly tested while running under the simulator (the arm64/mte/ >>>

Re: [PATCH] hw/arm/virt: dt: add rng-seed property

2022-06-29 Thread Alex Bennée
Peter Maydell writes: > On Tue, 28 Jun 2022 at 19:45, Jason A. Donenfeld wrote: >> >> On 6/27/22, Jason A. Donenfeld wrote: >> > On 6/27/22, Peter Maydell wrote: >> >> On Mon, 27 Jun 2022 at 17:07, Jason A. Donenfeld wrote: >> >>> >> >>> In 60592cfed2 ("hw/arm/virt: dt: add kaslr-seed prope

Re: [PATCH] hw/arm/virt: dt: add rng-seed property

2022-06-29 Thread Alex Bennée
Peter Maydell writes: > On Tue, 28 Jun 2022 at 19:45, Jason A. Donenfeld wrote: >> >> On 6/27/22, Jason A. Donenfeld wrote: >> > On 6/27/22, Peter Maydell wrote: >> >> On Mon, 27 Jun 2022 at 17:07, Jason A. Donenfeld wrote: >> >>> >> >>> In 60592cfed2 ("hw/arm/virt: dt: add kaslr-seed prope

Re: [PATCH v5 2/2] target/xtensa: Use semihosting/syscalls.h

2022-06-29 Thread Alex Bennée
Max Filippov writes: > On Wed, Jun 29, 2022 at 1:09 AM Alex Bennée wrote: >> Richard Henderson writes: >> > On 6/28/22 19:08, Max Filippov wrote: >> >> On Tue, Jun 28, 2022 at 4:43 AM Richard Henderson >> >> wrote: > >> >>> } >> >>> -if (serial_hd(0)) { >> >>> -xtensa_sim_o

Re: [RESEND PATCH] hw/dma: fix crash caused by race condition

2022-06-29 Thread David Hildenbrand
On 29.06.22 10:31, Tong Zhang wrote: > > > On Wed, Jun 29, 2022 at 12:29 AM David Hildenbrand > wrote: > > On 06.05.22 18:31, Tong Zhang wrote: > > assert(dbs->acb) is meant to check the return value of io_func per > > documented in commit 6bee44ea34 ("dma:

[PATCH] e1000: set RX descriptor status in a separate operation

2022-06-29 Thread Ding Hui
The code of setting RX descriptor status field maybe work fine in previously, however with the update of glibc version, it shows two issues when guest using dpdk receive packets: 1. The dpdk has a certain probability getting wrong buffer_addr this impact may be not obvious, such as lost a

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Markus Armbruster
Xie Yongji writes: > Coverity pointed out (CID 1490222, 1490227) that we called > ioctl somewhere without checking the return value. This > patch fixes these issues. > > Fixes: Coverity CID 1490222, 1490227 > Signed-off-by: Xie Yongji > --- > subprojects/libvduse/libvduse.c | 10 -- > 1

Re: [PATCH] hw/arm/virt: dt: add rng-seed property

2022-06-29 Thread Peter Maydell
On Tue, 28 Jun 2022 at 19:45, Jason A. Donenfeld wrote: > > On 6/27/22, Jason A. Donenfeld wrote: > > On 6/27/22, Peter Maydell wrote: > >> On Mon, 27 Jun 2022 at 17:07, Jason A. Donenfeld wrote: > >>> > >>> In 60592cfed2 ("hw/arm/virt: dt: add kaslr-seed property"), the > >>> kaslr-seed proper

Re: [PATCH 2/4] libvduse: Replace strcpy() with strncpy()

2022-06-29 Thread Markus Armbruster
Xie Yongji writes: > Coverity reported a string overflow issue since we copied > "name" to "dev_config->name" without checking the length. > This should be a false positive since we already checked > the length of "name" in vduse_name_is_invalid(). But anyway, > let's replace strcpy() with strncp

Re: [PATCH 3/4] libvduse: Pass positive value to strerror()

2022-06-29 Thread Markus Armbruster
Xie Yongji writes: > The value passed to strerror() should be positive. > So let's fix it. > > Fixes: Coverity CID 1490226, 1490223 > Signed-off-by: Xie Yongji Reviewed-by: Markus Armbruster

[PATCH v3 1/4] hmat acpi: Don't require initiator value in -numa

2022-06-29 Thread Brice Goglin
The "Memory Proximity Domain Attributes" structure of the ACPI HMAT has a "Processor Proximity Domain Valid" flag that is currently always set because Qemu -numa requires an initiator=X value when hmat=on. Unsetting this flag allows to create more complex memory topologies by having multiple best

[PATCH v3 4/4] tests: acpi: q35: update expected blobs *.hmat-noinitiators

2022-06-29 Thread Brice Goglin
expected HMAT: [000h 4]Signature : "HMAT"[Heterogeneous Memory Attributes Table] [004h 0004 4] Table Length : 0120 [008h 0008 1] Revision : 02 [009h 0009 1] Checksum : 4F [00Ah 0010 6]

Re: [PATCH 1/4] libvduse: Fix the incorrect function name

2022-06-29 Thread Markus Armbruster
Xie Yongji writes: > In vduse_name_is_valid(), we actually check whether > the name is invalid or not. So let's change the > function name to vduse_name_is_invalid() to match > the behavior. > > Signed-off-by: Xie Yongji Reviewed-by: Markus Armbruster

[PATCH v3 3/4] tests: acpi: q35: add test for hmat nodes without initiators

2022-06-29 Thread Brice Goglin
Build a machine with 4 cores and 3 NUMA nodes. 1st NUMA is local to cores #0-1. 2nd NUMA is local to cores #2-3. 3rd NUMA has no initiator. HMAT SLLB says memory access performance of 3rd NUMA is lower, but it's identical for all cores hence all cores are its best initiator. Expected HMAT: [000h

[PATCH v3 2/4] tests: acpi: add and whitelist *.hmat-noinitiator expected blobs

2022-06-29 Thread Brice Goglin
.. which will be used by follow up hmat-noinitiator test-case. Signed-off-by: Brice Goglin Reviewed-by: Jonathan Cameron --- tests/data/acpi/q35/APIC.acpihmat-noinitiator | 0 tests/data/acpi/q35/DSDT.acpihmat-noinitiator | 0 tests/data/acpi/q35/FACP.acpihmat-noinitiator | 0 tests/data/acpi/

<    1   2   3   >