Re: [RFC PATCH v9 03/23] vdpa: delay set_vring_ready after DRIVER_OK

2022-07-12 Thread Michael S. Tsirkin
On Wed, Jul 06, 2022 at 08:39:48PM +0200, Eugenio Pérez wrote: > To restore the device in the destination of a live migration we send the > commands through control virtqueue. For a device to read CVQ it must > have received DRIVER_OK status bit. > > However this open a window where the device

RE: [Virtio-fs] [Qemu] how to use viriofs in qemu without NUMA

2022-07-12 Thread Zhao, Shirley
Get it, thanks for our information. Vivek. Thanks. - Shirley -Original Message- From: Vivek Goyal Sent: Tuesday, July 12, 2022 8:33 PM To: Zhao, Shirley Cc: Dr. David Alan Gilbert ; virtio...@redhat.com; Thomas Huth ; qemu-devel@nongnu.org Subject: Re: [Virtio-fs] [Qemu] how to

Re: [PATCH v2] target/ppc/kvm: Skip current and parent directories in kvmppc_find_cpu_dt

2022-07-12 Thread David Gibson
On Tue, Jul 12, 2022 at 06:08:10PM -0300, Murilo Opsfelder Araujo wrote: > Some systems have /proc/device-tree/cpus/../clock-frequency. However, > this is not the expected path for a CPU device tree directory. > > Signed-off-by: Murilo Opsfelder Araujo > Signed-off-by: Fabiano Rosas

Re: [RFC PATCH] target/ppc: don't print TB in ppc_cpu_dump_state if it's not initialized

2022-07-12 Thread David Gibson
On Tue, Jul 12, 2022 at 06:13:44PM -0300, Daniel Henrique Barboza wrote: > > > On 7/12/22 16:25, Matheus Ferst wrote: > > When using "-machine none", env->tb_env is not allocated, causing the > > segmentation fault reported in issue #85 (launchpad bug #811683). To > > avoid this problem, check

[PATCH 2/2] target/arm: Fix aarch64_sve_change_el for SME

2022-07-12 Thread Richard Henderson
We were only checking for SVE disabled and not taking into account PSTATE.SM to check SME disabled, which resulted in vectors being incorrectly truncated. Signed-off-by: Richard Henderson --- target/arm/helper.c | 31 +-- 1 file changed, 25 insertions(+), 6

[PATCH 1/2] target/arm: Fill in VL for tbflags when SME enabled and SVE disabled

2022-07-12 Thread Richard Henderson
When PSTATE.SM, VL = SVL even if SVE is disabled. This is visible in kselftest ssve-test. Reported-by: Mark Brown Signed-off-by: Richard Henderson --- target/arm/helper.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c

[PATCH 0/2] target/arm: Two SME fixes

2022-07-12 Thread Richard Henderson
Ho hum. Let a feature loose on users and they find bugs. Mark noticed that the wrong value was being picked up for VL when SVE is disabled. I had run the same test but failed to notice the vector length wasn't as expected, though the test otherwise produced expected results. r~ Richard

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-07-12 Thread Gupta, Pankaj
This is the v7 of this series which tries to implement the fd-based KVM guest private memory. The patches are based on latest kvm/queue branch commit: b9b71f43683a (kvm/queue) KVM: x86/mmu: Buffer nested MMU split_desc_cache only by default capacity Introduction In general

Re: loongarch missing tests/qtest/machine-none-test.c support

2022-07-12 Thread gaosong
HI, Peter On 2022/7/12 下午11:32, Peter Maydell wrote: The tests/qtest/machine-none-test has a cpus_map[] array which needs to be updated to list a CPU that will work with the 'none' machine type for the longarch64 target. This results in a warning message during 'make check': $

[PATCH] qtest/machine-none: Add LoongArch support

2022-07-12 Thread Song Gao
Update the cpu_maps[] to support the LoongArch target. Signed-off-by: Song Gao --- tests/qtest/machine-none-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/machine-none-test.c b/tests/qtest/machine-none-test.c index d0f8cd9902..f92fab479f 100644 ---

Re: [RFC v4 1/9] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-07-12 Thread Sam Li
Damien Le Moal 于2022年7月12日周二 15:35写道: > > On 7/12/22 11:13, Sam Li wrote: > > By adding zone management operations in BlockDriver, storage > > controller emulation can use the new block layer APIs including > > zone_report and zone_mgmt(open, close, finish, reset). > > > > Signed-off-by: Sam Li

Re: [RFC v4 1/9] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-07-12 Thread Sam Li
Stefan Hajnoczi 于2022年7月12日周二 23:49写道: > > On Tue, Jul 12, 2022 at 10:13:37AM +0800, Sam Li wrote: > > By adding zone management operations in BlockDriver, storage > > controller emulation can use the new block layer APIs including > > zone_report and zone_mgmt(open, close, finish, reset). > > >

Re: [PATCH v4 3/3] migration/multifd: Report to user when zerocopy not working

2022-07-12 Thread Leonardo Bras Soares Passos
On Tue, Jul 12, 2022 at 7:42 PM Peter Xu wrote: > > On Mon, Jul 11, 2022 at 06:11:13PM -0300, Leonardo Bras wrote: > > Some errors, like the lack of Scatter-Gather support by the network > > interface(NETIF_F_SG) may cause sendmsg(...,MSG_ZEROCOPY) to fail on using > > zero-copy, which causes it

Re: [PATCH] hw/intc/armv7m_nvic: ICPRn must not unpend an IRQ that is being held high

2022-07-12 Thread Philippe Mathieu-Daudé via
On 28/6/22 17:47, Peter Maydell wrote: In the M-profile Arm ARM, rule R_CVJS defines when an interrupt should be set to the Pending state: A) when the input line is high and the interrupt is not Active B) when the input line transitions from low to high and the interrupt is Active (Note

Re: [PATCH v4 1/3] QIOChannelSocket: Fix zero-copy flush returning code 1 when nothing sent

2022-07-12 Thread Peter Xu
On Mon, Jul 11, 2022 at 06:11:11PM -0300, Leonardo Bras wrote: > If flush is called when no buffer was sent with MSG_ZEROCOPY, it currently > returns 1. This return code should be used only when Linux fails to use > MSG_ZEROCOPY on a lot of sendmsg(). > > Fix this by returning early from flush if

Re: [PATCH] Align Raspberry Pi DMA interrupts with Linux DTS

2022-07-12 Thread Philippe Mathieu-Daudé via
+Pete/Jeremy On 26/6/22 12:16, Peter Maydell wrote: On Fri, 24 Jun 2022 at 21:54, Andrey Makarov wrote: All Raspberry Pi models 1-3 (based on bcm2835) have Linux device tree (arch/arm/boot/dts/bcm2835-common.dtsi +25): /* dma channel 11-14 share one irq */ which mismatched the Qemu

[PULL 4/5] ui/cocoa: Take refresh rate into account

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Akihiko Odaki Retrieve the refresh rate of the display and reflect it with dpy_set_ui_info() and update_displaychangelistener(), allowing the guest and DisplayChangeListener to consume the information. The information will be used as a hint how often the display should be updated. For

Re: [PATCH v4 3/3] migration/multifd: Report to user when zerocopy not working

2022-07-12 Thread Peter Xu
On Mon, Jul 11, 2022 at 06:11:13PM -0300, Leonardo Bras wrote: > Some errors, like the lack of Scatter-Gather support by the network > interface(NETIF_F_SG) may cause sendmsg(...,MSG_ZEROCOPY) to fail on using > zero-copy, which causes it to fall back to the default copying mechanism. > > After

[PULL 2/5] configure: Restrict TCG to emulation

2022-07-12 Thread Philippe Mathieu-Daudé via
If we don't need to emulate any target, we certainly don't need TCG. This should also help to compile again with ".../configure --enable-tools --disable-system --disable-user" on systems that do not have a TCG backend. Signed-off-by: Philippe Mathieu-Daudé [thuth: Re-arranged the code, remove

[PULL 1/5] hvf: Enable RDTSCP support

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Cameron Esfahani Pass through RDPID and RDTSCP support in CPUID if host supports it. Correctly detect if CPU_BASED_TSC_OFFSET and CPU_BASED2_RDTSCP would be supported in primary and secondary processor-based VM-execution controls. Enable RDTSCP in secondary processor controls if RDTSCP

Re: [PATCH] linux-user/hppa: Fix segfaults on page zero

2022-07-12 Thread Philippe Mathieu-Daudé via
On 7/7/22 21:45, Helge Deller wrote: This program: int main(void) { asm("bv %r0(%r0)"); return 0; } produces on real hardware the expected segfault: --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x3} --- +++ killed by SIGSEGV +++ Segmentation fault But when run on

Re: [PATCH] target/ppc/kvm: Skip ".." directory in kvmppc_find_cpu_dt

2022-07-12 Thread Murilo Opsfelder Araújo
Hi, Daniel, David. On 7/12/22 10:03, Daniel Henrique Barboza wrote: On 7/12/22 00:46, David Gibson wrote: On Mon, Jul 11, 2022 at 04:37:43PM -0300, Murilo Opsfelder Araujo wrote: Some systems have /proc/device-tree/cpus/../clock-frequency. However, this is not the expected path for a CPU

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

2022-07-12 Thread Philippe Mathieu-Daudé via
On 12/7/22 23:52, Mark Cave-Ayland wrote: 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

Re: [PATCH v2] Align Raspberry Pi DMA interrupts with Linux DTS

2022-07-12 Thread Philippe Mathieu-Daudé via
Hi Andrey, On 12/7/22 12:45, Andrey Makarov wrote: There is nothing in the specs on DMA engine interrupt lines: it should have been in the "BCM2835 ARM Peripherals" datasheet but the appropriate "ARM peripherals interrupt table" (p.113) is nearly empty. All Raspberry Pi models 1-3 (based on

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/ps2.c | 13 -

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell ---

Re: [PATCH v4 2/3] Add dirty-sync-missed-zero-copy migration stat

2022-07-12 Thread Peter Xu
On Mon, Jul 11, 2022 at 06:11:12PM -0300, Leonardo Bras wrote: > Signed-off-by: Leonardo Bras > Acked-by: Markus Armbruster > Reviewed-by: Daniel P. Berrangé > --- > qapi/migration.json | 7 ++- > migration/migration.c | 2 ++ > monitor/hmp-cmds.c| 5 + > 3 files changed, 13

[PULL 0/5] Darwin patches for 2022-07-12

2022-07-12 Thread Philippe Mathieu-Daudé via
The following changes since commit 8e3d85d36b77f11ad7bded3a2d48c1f0cc334f82: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2022-07-12 14:12:15 +0100) are available in the Git repository at: https://github.com/philmd/qemu.git tags/darwin-20220712 for you

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter

Re: [RFC v4 1/9] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-07-12 Thread Damien Le Moal
On 7/13/22 00:49, Stefan Hajnoczi wrote: > On Tue, Jul 12, 2022 at 10:13:37AM +0800, Sam Li wrote: >> By adding zone management operations in BlockDriver, storage >> controller emulation can use the new block layer APIs including >> zone_report and zone_mgmt(open, close, finish, reset). >> >>

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell ---

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

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

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

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

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell ---

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by:

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

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

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/lasips2.c | 2 +- 1 file changed, 1

Re: [PATCH] avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR

2022-07-12 Thread Peter Delevoryas
On Tue, Jul 12, 2022 at 11:53:14PM +0200, Philippe Mathieu-Daudé wrote: > On 2/7/22 20:56, Peter Delevoryas wrote: > > I like to build QEMU from the root source directory, rather than cd'ing > > into the build directory. This code may as well include a search path > > for that, so that you can run

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

2022-07-12 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 magnum machine which is the only user of the I8042_MMIO device. Signed-off-by: Mark

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/lasips2.c | 52 +++--- 1 file changed,

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

2022-07-12 Thread Mark Cave-Ayland
This will be soon be used to hold the underlying PS2_KBD_DEVICE object. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/lasips2.c | 7 +++ include/hw/input/lasips2.h | 7 +++ 2 files changed, 14

[PULL 5/5] avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Peter Delevoryas I like to build QEMU from the root source directory [*], rather than cd'ing into the build directory. This code may as well include a search path for that, so that you can run avocado tests individually without specifying "-p qemu_bin=build/qemu-system-arm" manually. [*]

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/lasips2.c | 6 +++---

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

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

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell ---

[PULL 3/5] ui/cocoa: Fix switched_to_fullscreen warning

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Peter Delevoryas I noticed this error while building QEMU on Mac OS X: [1040/1660] Compiling Objective-C object libcommon.fa.p/ui_cocoa.m.o ../ui/cocoa.m:803:17: warning: variable 'switched_to_fullscreen' set but not used [-Wunused-but-set-variable] static bool

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

2022-07-12 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 which will be enabled in the next patch. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by:

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/lasips2.c | 2 ++

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell ---

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge

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

2022-07-12 Thread Mark Cave-Ayland
This will be soon be used to hold the underlying PS2_MOUSE_DEVICE object. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/lasips2.c | 7 +++ include/hw/input/lasips2.h | 7 +++ 2 files changed, 14

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/pl050.c

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/ps2.c | 13 -

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/lasips2.c | 16

[PATCH v2 16/40] lasips2: QOMify LASIPS2Port

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/lasips2.c | 8 include/hw/input/lasips2.h | 14

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell ---

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

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

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

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

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

2022-07-12 Thread Mark Cave-Ayland
This will be soon be used to hold the underlying PS2_MOUSE_DEVICE object. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/pl050.c | 3 ++- include/hw/input/pl050.h | 7 +++ 2 files changed, 9 insertions(+), 1

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/lasips2.c | 16

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

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

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/pl050.c | 2 ++ include/hw/input/pl050.h | 8

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell ---

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell ---

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/pl050.c

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

2022-07-12 Thread Mark Cave-Ayland
This will be soon be used to hold the underlying PS2_KBD_DEVICE object. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/pl050.c | 3 ++- include/hw/input/pl050.h | 7 +++ 2 files changed, 9 insertions(+), 1

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/pl050.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

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

2022-07-12 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 Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell --- hw/input/pl050.c | 16 +--- include/hw/input/pl050.h | 35

Re: [PATCH] avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR

2022-07-12 Thread Philippe Mathieu-Daudé via
On 2/7/22 20:56, Peter Delevoryas wrote: I like to build QEMU from the root source directory, rather than cd'ing into the build directory. This code may as well include a search path for that, so that you can run avocado tests individually without specifying "-p qemu_bin=build/qemu-system-arm"

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

2022-07-12 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] target/avr: Drop avr_cpu_memory_rw_debug()

2022-07-12 Thread Philippe Mathieu-Daudé via
On Mon, Jun 20, 2022 at 10:01 PM Richard Henderson wrote: > On 3/22/22 02:50, Bin Meng wrote: > > CPUClass::memory_rw_debug() holds a callback for GDB memory access. > > If not provided, cpu_memory_rw_debug() is used by the GDB stub. > > Drop avr_cpu_memory_rw_debug() which does nothing special.

Re: [PATCH 1/3] ui/cocoa: Run qemu_init in the main thread

2022-07-12 Thread Philippe Mathieu-Daudé via
Hi Akihiko, On 6/7/22 04:13, Akihiko Odaki wrote: This work is based on: https://patchew.org/QEMU/20220317125534.38706-1-philippe.mathieu.da...@gmail.com/ Simplify the initialization dance by running qemu_init() in the main thread before the Cocoa event loop starts. The secondary thread only

[RFC PATCH 3/8] RFC: block: use transactions as a replacement of ->{can_}set_aio_context()

2022-07-12 Thread Emanuele Giuseppe Esposito
- RFC because I am not sure about the AioContext locks. - Do we need to take the new AioContext lock? what does it protect? - Taking the old AioContext lock is required now, because of bdrv_drained_begin calling AIO_WAIT_WHILE that unlocks the aiocontext. If we replace it with

[RFC PATCH 6/8] block-backend: implement .change_aio_ctx in child_root

2022-07-12 Thread Emanuele Giuseppe Esposito
blk_root_change_aio_ctx() is very similar to blk_root_can_set_aio_ctx(), but implements a new transaction so that if all check pass, the new transaction's .commit will take care of changing the BlockBackend AioContext. blk_root_set_aio_ctx_commit() is the same as blk_root_set_aio_ctx(). Note:

[RFC PATCH 7/8] block: use the new _change_ API instead of _can_set_ and _set_

2022-07-12 Thread Emanuele Giuseppe Esposito
Replace all direct usage of ->can_set_aio_ctx and ->set_aio_ctx, and call bdrv_child_try_change_aio_context() in bdrv_try_set_aio_context(), the main function called through the whole block layer. >From this point onwards, ->can_set_aio_ctx and ->set_aio_ctx won't be used anymore. Signed-off-by:

[RFC PATCH 8/8] block: remove all unused ->can_set_aio_ctx and ->set_aio_ctx callbacks

2022-07-12 Thread Emanuele Giuseppe Esposito
Together with all _can_set_ and _set_ APIs, as they are not needed anymore. Signed-off-by: Emanuele Giuseppe Esposito --- block.c| 196 - block/block-backend.c | 33 - blockjob.c | 35 --

[RFC PATCH 5/8] block: implement .change_aio_ctx in child_of_bds

2022-07-12 Thread Emanuele Giuseppe Esposito
bdrv_child_cb_change_aio_ctx() is identical to bdrv_child_cb_can_set_aio_ctx(), as we only need to recursively go on the parent bs. Note: bdrv_child_try_change_aio_context() is not called by anyone at this point. Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 9 + 1 file

[RFC PATCH 4/8] blockjob: implement .change_aio_ctx in child_job

2022-07-12 Thread Emanuele Giuseppe Esposito
child_job_change_aio_ctx() is very similar to child_job_can_set_aio_ctx(), but it implements a new transaction so that if all check pass, the new transaction's .commit() will take care of changin the BlockJob AioContext. child_job_set_aio_ctx_commit() is similar to child_job_set_aio_ctx(), but it

[RFC PATCH 2/8] transactions: add tran_add_back

2022-07-12 Thread Emanuele Giuseppe Esposito
First change the transactions from a QLIST to QSIMPLEQ, then use it to implement tran_add_tail, which allows adding elements to the end of list transactions. This is useful if we have some "preparation" transiction callbacks that we want to run before the others but still only when invoking

[RFC PATCH 1/8] block.c: assert bs->aio_context is written under BQL and drains

2022-07-12 Thread Emanuele Giuseppe Esposito
Also here ->aio_context is read by I/O threads and written under BQL. Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block.c b/block.c index d0db104d71..267a39c0de 100644 --- a/block.c +++ b/block.c @@ -7285,6 +7285,7 @@ static void

[RFC PATCH 0/8] Refactor bdrv_try_set_aio_context using transactions

2022-07-12 Thread Emanuele Giuseppe Esposito
The aim of this series is to reorganize bdrv_try_set_aio_context and drop BDS ->set_aio_context and ->can_set_aio_ctx callbacks in favour of a new one, ->change_aio_ctx. More informations in patch 3 (which is also RFC, due to the doubts I have with AioContext locks). Patch 1 just add assertions

Re: [RFC PATCH] target/ppc: don't print TB in ppc_cpu_dump_state if it's not initialized

2022-07-12 Thread Daniel Henrique Barboza
On 7/12/22 16:25, Matheus Ferst wrote: When using "-machine none", env->tb_env is not allocated, causing the segmentation fault reported in issue #85 (launchpad bug #811683). To avoid this problem, check if the pointer != NULL before calling the methods to print TBU/TBL/DECR. Resolves:

Re: [PATCH] configure: Restrict TCG to emulation

2022-07-12 Thread Philippe Mathieu-Daudé via
On 6/7/22 17:38, Thomas Huth wrote: From: Philippe Mathieu-Daudé If we don't need to emulate any target, we certainly don't need TCG. This should also help to compile again with ".../configure --enable-tools --disable-system --disable-user" on systems that do not have a TCG backend.

[PATCH v2] target/ppc/kvm: Skip current and parent directories in kvmppc_find_cpu_dt

2022-07-12 Thread Murilo Opsfelder Araujo
Some systems have /proc/device-tree/cpus/../clock-frequency. However, this is not the expected path for a CPU device tree directory. Signed-off-by: Murilo Opsfelder Araujo Signed-off-by: Fabiano Rosas --- v2: - Skip current and parent directories. v1:

Re: [PATCH v4] ui/cocoa: Take refresh rate into account

2022-07-12 Thread Philippe Mathieu-Daudé via
On 2/7/22 16:25, Akihiko Odaki wrote: Retreieve the refresh rate of the display and reflect it with dpy_set_ui_info() and update_displaychangelistener(), allowing the guest and DisplayChangeListener to consume the information. The information will be used as a hint how often the display should

Re: [PULL 09/18] tests/tcg: compile system emulation tests as freestanding

2022-07-12 Thread Philippe Mathieu-Daudé via
On 12/7/22 14:49, Paolo Bonzini wrote: System emulation tests do not run in a hosted environment, since they do not link with libc. They should only use freestanding headers (float.h, limits.h, stdarg.h, stddef.h, stdbool.h, stdint.h, stdalign.h, stdnoreturn.h) and should be compiled with

[PULL 12/12] target/mips: Remove GET_TARGET_STRING and FREE_TARGET_STRING

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Richard Henderson Inline these macros into the only two callers. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20220628111701.677216-9-richard.hender...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/sysemu/mips-semi.c | 27

[PULL 11/12] target/mips: Simplify UHI_argnlen and UHI_argn

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Richard Henderson With semihosting_get_arg, we already have a check vs argc, so there's no point replicating it -- just check the result vs NULL. Merge copy_argn_to_target into its caller. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[PULL 07/12] target/mips: Use semihosting/syscalls.h

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Richard Henderson This separates guest file descriptors from host file descriptors, and utilizes shared infrastructure for integration with gdbstub. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220628111701.677216-4-richard.hender...@linaro.org>

[PULL 04/12] target/mips: introduce Cavium Octeon CPU model

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Pavel Dovgalyuk This patch adds Cavium Octeon 68XX vCPU which provides Octeon-specific instructions. Signed-off-by: Pavel Dovgalyuk Message-Id: <165572673785.167724.7604881144978983510.stgit@pasha-ThinkPad-X280> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu-defs.c.inc | 28

[PULL 09/12] target/mips: Use error_report for UHI_assert

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Richard Henderson Always log the assert locally. Do not report_fault, but instead include the fact of the fault in the assertion. Don't bother freeing allocated strings before the abort(). Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[PULL 02/12] target/mips: implement Octeon-specific BBIT instructions

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Pavel Dovgalyuk This patch introduces Octeon-specific decoder and implements check-bit-and-jump instructions. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Richard Henderson Message-Id: <165572672705.167724.16667636081912075906.stgit@pasha-ThinkPad-X280> Signed-off-by: Philippe

[PULL 10/12] semihosting: Remove qemu_semihosting_log_out

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Richard Henderson The function is no longer used. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20220628111701.677216-7-richard.hender...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- include/semihosting/console.h | 13 -

[PULL 05/12] target/mips: Create report_fault for semihosting

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Richard Henderson The UHI specification does not have an EFAULT value, and further specifies that "undefined UHI operations should not return control to the target". So, log the error and abort. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[PULL 01/12] target/mips: introduce decodetree structure for Cavium Octeon extension

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Pavel Dovgalyuk This patch adds decodetree for Cavium Octeon extension and an instruction set extension flag for using it in CPU models. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Richard Henderson Message-Id: <165572672162.167724.13656301229517693806.stgit@pasha-ThinkPad-X280>

[PULL 08/12] target/mips: Avoid qemu_semihosting_log_out for UHI_plog

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Richard Henderson Use semihost_sys_write and/or qemu_semihosting_console_write for implementing plog. When using gdbstub, copy the temp string below the stack so that gdb has a guest address from which to perform the log. Signed-off-by: Richard Henderson Reviewed-by: Philippe

[PULL 06/12] target/mips: Drop link syscall from semihosting

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Richard Henderson We don't implement it with _WIN32 hosts, and the syscall is missing from the gdb remote file i/o interface. Since we can't implement it universally, drop it. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[PULL 03/12] target/mips: implement Octeon-specific arithmetic instructions

2022-07-12 Thread Philippe Mathieu-Daudé via
From: Pavel Dovgalyuk This patch implements several Octeon-specific instructions: - BADDU - DMUL - EXTS/EXTS32 - CINS/CINS32 - POP/DPOP - SEQ/SEQI - SNE/SNEI Signed-off-by: Pavel Dovgalyuk Reviewed-by: Richard Henderson Message-Id:

  1   2   3   4   >