Re: [PATCH v2 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Kevin Wolf
Am 21.12.2023 um 16:35 hat Stefan Hajnoczi geschrieben: > NBDClient has a number of fields that are accessed by both the export > AioContext and the main loop thread. When the AioContext lock is removed > these fields will need another form of protection. > > Add NBDClient->lock and protect fields

[PATCH 06/21] configure: unify again the case arms in probe_target_compiler

2023-12-21 Thread Paolo Bonzini
Remove assignments that match the default, and group the targets for debian-legacy-test-cross and debian-all-test-cross into a single arm. Signed-off-by: Paolo Bonzini --- configure | 86 +-- 1 file changed, 27 insertions(+), 59 deletions(-) d

Re: [PATCH v2] target/i386: Fix physical address truncation

2023-12-21 Thread Paolo Bonzini
Queued, thanks. Paolo

[PATCH 13/21] meson: add more sections to main meson.build

2023-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index b5a85c4c255..b8c64c5ecf7 100644 --- a/meson.build +++ b/meson.build @@ -9,6 +9,10 @@ add_test_setup('thorough', env: ['G_TEST_

[PATCH 15/21] meson: move option validation a bit closer

2023-12-21 Thread Paolo Bonzini
Not entirely possible for option that depend on compiler or dependency checks, but it's a start. Signed-off-by: Paolo Bonzini --- meson.build | 52 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/meson.build b/meson.build index

[PATCH 21/21] configure, meson: rename targetos to host_os

2023-12-21 Thread Paolo Bonzini
This variable is about the host OS, not the target. It is used a lot more since the Meson conversion, but the original sin dates back to 2003. Time to fix it. Signed-off-by: Paolo Bonzini --- accel/tcg/meson.build| 2 +- backends/meson.build | 4 +- block/mes

[PATCH 16/21] meson: separate host-specific checks from option validation

2023-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 97 +++-- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/meson.build b/meson.build index f7e7deeabdc..e777f507ce3 100644 --- a/meson.build +++ b/meson.build @@ -602,53 +602,6 @@ have_vh

[PATCH 18/21] meson: move CFI detection code earlier

2023-12-21 Thread Paolo Bonzini
Keep it together with the other compiler modes, and before dependencies. Signed-off-by: Paolo Bonzini --- meson.build | 80 ++--- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/meson.build b/meson.build index f8d61a46ad1..f105462c1

[PATCH 07/21] meson: always probe u2f and canokey if the option is enabled

2023-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 6c77d9687de..de33e323d43 100644 --- a/meson.build +++ b/meson.build @@ -1759,12 +1759,12 @@ if not get_option('smartcard').auto() or have_system

[PATCH 12/21] meson: rename config_all

2023-12-21 Thread Paolo Bonzini
config_all now lists only accelerators, rename it to indicate its actual content. Signed-off-by: Paolo Bonzini --- hw/mips/meson.build | 2 +- meson.build | 16 target/arm/meson.build | 2 +- target/mips/meson.build | 2 +- tests/fp/meson.build| 2 +- te

[PATCH 02/21] meson: remove unused variable

2023-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/bench/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/bench/meson.build b/tests/bench/meson.build index 3c799dbd983..7e76338a52d 100644 --- a/tests/bench/meson.build +++ b/tests/bench/meson.build @@ -3,9 +3,9 @@ qh

[PATCH 20/21] meson: move subdirs to "Collect sources" section

2023-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 66 ++--- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/meson.build b/meson.build index 57821069e91..6cf70cbfb89 100644 --- a/meson.build +++ b/meson.build @@ -3221,39 +3221,6 @@ forea

[PATCH 17/21] meson: keep subprojects together

2023-12-21 Thread Paolo Bonzini
And move away dependencies that are not subprojects anymore. Signed-off-by: Paolo Bonzini --- meson.build | 72 ++--- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/meson.build b/meson.build index e777f507ce3..f8d61a46ad1 100644 --

[PATCH 03/21] meson: use version_compare() to compare version

2023-12-21 Thread Paolo Bonzini
While a simple lexicographic comparison usually works, it is less robust than a more specific algorithm designed to compare versions. Signed-off-by: Paolo Bonzini --- qga/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/meson.build b/qga/meson.build index ff7a8

[PATCH 19/21] meson: move config-host.h definitions together

2023-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/meson.build b/meson.build index f105462c181..57821069e91 100644 --- a/meson.build +++ b/meson.build @@ -40,7 +40,6 @@ qemu_moddir = get_option('libdir') /

[PATCH 00/21] Build system cleanups for QEMU 9.0

2023-12-21 Thread Paolo Bonzini
These are cleanups that we can do with a completed conversion and a global view of meson.build, including: 1) removal of CONFIG_ALL 2) regrouping of root meson.build into better-defined sections 3) renaming of targetos into host_os 4) cleaning up of probe_target_compiler Plus a bunch of small

[PATCH 09/21] meson: remove CONFIG_POSIX and CONFIG_WIN32 from config_targetos

2023-12-21 Thread Paolo Bonzini
For consistency with other OSes, use if...endif for rules that are target-independent. Signed-off-by: Paolo Bonzini --- backends/meson.build | 6 -- block/meson.build| 7 +-- chardev/meson.build | 26 ++ hw/usb/meson.build | 4 +++- meson.build

[PATCH 05/21] configure: remove unnecessary subshell

2023-12-21 Thread Paolo Bonzini
Do not use a subshell to hide the shadowing of $config_host_mak. Signed-off-by: Paolo Bonzini --- configure | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 6ea8f53310e..c634948051b 100755 --- a/configure +++ b/configure @@ -1671,10 +1671,9

[PATCH 10/21] meson: remove config_targetos

2023-12-21 Thread Paolo Bonzini
config_targetos is now empty and can be removed; its use in sourcesets that do not involve target-specific files can be replaced with an empty dictionary. In fact, at this point *all* sourcesets that do not involve target-specific files are just glorified mutable arrays. Enforce that they never t

[PATCH 04/21] Makefile: clean qemu-iotests output

2023-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- Makefile | 1 + configure | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 676a4a54f48..8f369903356 100644 --- a/Makefile +++ b/Makefile @@ -202,6 +202,7 @@ clean: recurse-clean ! -path ./roms/edk2/Ar

[PATCH 08/21] meson: remove OS definitions from config_targetos

2023-12-21 Thread Paolo Bonzini
CONFIG_DARWIN, CONFIG_LINUX and CONFIG_BSD are used in some rules, but only CONFIG_LINUX has substantial use. Convert them all to if...endif. Signed-off-by: Paolo Bonzini --- accel/tcg/meson.build | 4 +++- backends/meson.build | 4 +++- block/meson.build | 4 +++- fsdev/meson.build

[PATCH 14/21] meson: move program checks together

2023-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 90 ++--- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/meson.build b/meson.build index b8c64c5ecf7..1a1e006ba13 100644 --- a/meson.build +++ b/meson.build @@ -19,21 +19,8 @@ ss = impo

[PATCH 11/21] meson: remove CONFIG_ALL

2023-12-21 Thread Paolo Bonzini
CONFIG_ALL is tricky to use and was ported over to Meson from the recursive processing of Makefile variables. Meson sourcesets however have all_sources() and all_dependencies() methods that remove the need for it. Signed-off-by: Paolo Bonzini --- docs/devel/build-system.rst | 15 ---

[PATCH 01/21] meson: fix type of "relocatable" option

2023-12-21 Thread Paolo Bonzini
Since the option is of boolean type, the default value should be a boolean rather than a string. Signed-off-by: Paolo Bonzini --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index c9baeda6395..0a99a059ec8 100644 ---

Re: [PULL 20/47] backends/iommufd: Introduce the iommufd object

2023-12-21 Thread Eric Auger
Hi Cédric, On 12/21/23 17:00, Cédric Le Goater wrote: > [ ... ] > > >> +static void iommufd_backend_init(Object *obj) >> +{ >> +    IOMMUFDBackend *be = IOMMUFD_BACKEND(obj); >> + >> +    be->fd = -1; >> +    be->users = 0; >> +    be->owned = true; >> +    qemu_mutex_init(&be->lock);> +} >> + >>

[PATCH 1/2] hw/s390x/ccw: Replace basename() with g_path_get_basename()

2023-12-21 Thread Zhao Liu
From: Zhao Liu g_path_get_basename() is a portable utility function that has the advantage of not modifing the string argument, so it should be preferred over basename(). And also to avoid potential compile breakage with the Musl C library similar to [1], replace basename() with g_path_get_basen

[PATCH 0/2] hw/s390x/ccw: Cleanup basename() and dirname()

2023-12-21 Thread Zhao Liu
From: Zhao Liu As commit 3e015d815b3f ("use g_path_get_basename instead of basename") said, g_path_get_basename() and g_path_get_dirname() should be preferred over basename() and dirname(), since g_path_get_basename() and g_path_get_dirname() are portable utility functions that have the advantage

[PATCH 2/2] hw/s390x/ccw: Replace dirname() with g_path_get_dirname()

2023-12-21 Thread Zhao Liu
From: Zhao Liu As commit 3e015d815b3f ("use g_path_get_basename instead of basename") said, g_path_get_dirname() should be preferred over dirname() since the former is a portable utility function that has the advantage of not modifing the string argument. Replace dirname() with g_path_get_dirnam

[PATCH] MAINTAINERS: Remove myself as reviewer from Live Migration

2023-12-21 Thread Leonardo Bras
I am currently focusing in kernel development, so I will probably not be of much help in reviewing general Live Migration changes. For above reason I am removing my Reviewer status from Migration and RDMA Migration. Signed-off-by: Leonardo Bras --- MAINTAINERS | 2 -- 1 file changed, 2 deletion

Re: [PATCH 1/2] target/riscv/csr: Rename groups of interrupts

2023-12-21 Thread Daniel Henrique Barboza
On 12/21/23 08:36, Vadim Shakirov wrote: In AIA spec in 5.1 chapter says that "... the AIA categorizes the counter overflow interrupt (code 13) as a local interrupt. It is assumed furthermore that any future definitions for reserved interrupt numbers 14 and 15 will also be local interrupts" an

Re: [PATCH 2/2] target/riscv/csr: Added the ability to delegate LCOFI to VS

2023-12-21 Thread Daniel Henrique Barboza
On 12/21/23 08:36, Vadim Shakirov wrote: In the AIA specification in the paragraph "Virtual interrupts for VS level" it is indicated for interrupts 13-63: if the bit in hideleg is enabled, then the corresponding vsip and vsie bits are aliases to sip and sie Signed-off-by: Vadim Shakirov ---

Re: [PULL 20/47] backends/iommufd: Introduce the iommufd object

2023-12-21 Thread Cédric Le Goater
[ ... ] +static void iommufd_backend_init(Object *obj) +{ +IOMMUFDBackend *be = IOMMUFD_BACKEND(obj); + +be->fd = -1; +be->users = 0; +be->owned = true; +qemu_mutex_init(&be->lock);> +} + +static void iommufd_backend_finalize(Object *obj) +{ +IOMMUFDBackend *be = IOMMUFD

[PATCH v2] target/i386: Fix physical address truncation

2023-12-21 Thread Michael Brown
The address translation logic in get_physical_address() will currently truncate physical addresses to 32 bits unless long mode is enabled. This is incorrect when using physical address extensions (PAE) outside of long mode, with the result that a 32-bit operating system using PAE to access memory a

Re: [PATCH v4 1/4] qdev-properties: alias all object class properties

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 01:39:48PM +0100, Kevin Wolf wrote: > Am 20.12.2023 um 14:47 hat Stefan Hajnoczi geschrieben: > > qdev_alias_all_properties() aliases a DeviceState's qdev properties onto > > an Object. This is used for VirtioPCIProxy types so that --device > > virtio-blk-pci has properties

[PATCH v2 5/6] nbd/server: only traverse NBDExport->clients from main loop thread

2023-12-21 Thread Stefan Hajnoczi
The NBD clients list is currently accessed from both the export AioContext and the main loop thread. When the AioContext lock is removed there will be nothing protecting the clients list. Adding a lock around the clients list is tricky because NBDClient structs are refcounted and may be freed from

[PATCH v2 3/6] fixup scsi: only access SCSIDevice->requests from one thread

2023-12-21 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index df68a44b6a..5b08cbf60a 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -127,7 +127,8 @@

[PATCH v2 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
NBDClient has a number of fields that are accessed by both the export AioContext and the main loop thread. When the AioContext lock is removed these fields will need another form of protection. Add NBDClient->lock and protect fields that are accessed by both threads. Also add assertions where poss

[PATCH v2 4/6] nbd/server: avoid per-NBDRequest nbd_client_get/put()

2023-12-21 Thread Stefan Hajnoczi
nbd_trip() processes a single NBD request from start to finish and holds an NBDClient reference throughout. NBDRequest does not outlive the scope of nbd_trip(). Therefore it is unnecessary to ref/unref NBDClient for each NBDRequest. Removing these nbd_client_get()/nbd_client_put() calls will make

[PATCH v2 1/6] fixup block-coroutine-wrapper: use qemu_get_current_aio_context()

2023-12-21 Thread Stefan Hajnoczi
qemu-iotests 051 fails on my machine so the change to 051.pc.out made by the above commit appears to be incorrect, at least against the current QEMU source tree. Revert it so that 051 passes again. Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/051.pc.out | 4 ++-- 1 file changed, 2 inser

[PATCH v2 0/6] qemu-iotests fixes for Kevin's block tree

2023-12-21 Thread Stefan Hajnoczi
v2: - Drop useless if (client->quiesing) check [Kevin] - run qio_channel_read_wake() in export AioContext to avoid race [Kevin] - Introduce nbd_client_put_nonzero() optimization [Paolo] - Reach goto label disconnect with client->lock taken [Paolo] - Add doc comment explaining nbd_co_receive_request

[PATCH v2 2/6] fixup block: remove AioContext locking

2023-12-21 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi --- migration/block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/migration/block.c b/migration/block.c index 2bcfcbfdf6..6ec6a1d6e6 100644 --- a/migration/block.c +++ b/migration/block.c @@ -311,10 +311,17 @@ static int mig_save_device_bulk(QEMUFile

Re: [PATCH] target/i386: Fix physical address truncation when PAE is enabled

2023-12-21 Thread Michael Brown
On 20/12/2023 21:51, Richard Henderson wrote: On 12/20/23 22:03, Michael Brown wrote: For the default case, I think it would make sense to unconditionally truncate the address to 32 bits if paging is disabled.  (I am not sure why the original commit 33dfdb5 included a test for long mode, since

[PATCH v3 07/11] hw/block/fdc-isa: Implement relocation and enabling/disabling for TYPE_ISA_FDC

2023-12-21 Thread Bernhard Beschow
The real SuperI/O chips emulated by QEMU allow for relocating and enabling or disabling their SuperI/O functions via software. So far this is not implemented. Prepare for that by adding isa_fdc_set_{enabled,iobase}. Signed-off-by: Bernhard Beschow --- include/hw/block/fdc.h | 3 +++ hw/block/fd

[PATCH v3 08/11] hw/char/serial-isa: Implement relocation and enabling/disabling for TYPE_ISA_SERIAL

2023-12-21 Thread Bernhard Beschow
The real SuperI/O chips emulated by QEMU allow for relocating and enabling or disabling their SuperI/O functions via software. So far this is not implemented. Prepare for that by adding isa_serial_set_{enabled,iobase}. Signed-off-by: Bernhard Beschow --- include/hw/char/serial.h | 2 ++ hw/char

[PATCH v3 06/11] exec/ioport: Add portio_list_set_enabled()

2023-12-21 Thread Bernhard Beschow
Some SuperI/O devices such as the VIA south bridges or the PC87312 controller allow to enable or disable their SuperI/O functions. Add a convenience function for implementing this in the VIA south bridges. The naming of the functions is inspired by its memory_region_set_enabled() pendant. Signed-

[PATCH v3 02/11] hw/block/fdc-sysbus: Move iomem from FDCtrl to FDCtrlSysBus

2023-12-21 Thread Bernhard Beschow
FDCtrl::iomem isn't used inside FDCtrl context but only inside FDCtrlSysBus context, so move it there. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- hw/block/fdc-internal.h | 2 -- hw/block/fdc-sysbus.c | 6 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v3 09/11] hw/char/parallel-isa: Implement relocation and enabling/disabling for TYPE_ISA_PARALLEL

2023-12-21 Thread Bernhard Beschow
The real SuperI/O chips emulated by QEMU allow for relocating and enabling or disabling their SuperI/O functions via software. So far this is not implemented. Prepare for that by adding isa_parallel_set_{enabled,iobase}. Signed-off-by: Bernhard Beschow --- include/hw/char/parallel-isa.h | 3 +++

[PATCH v3 11/11] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions

2023-12-21 Thread Bernhard Beschow
The VIA south bridges are able to relocate and toggle (enable or disable) their SuperI/O functions. So far this is hardcoded such that all functions are always enabled and are located at fixed addresses. Some PC BIOSes seem to probe for I/O occupancy before activating such a function and issue an

[PATCH v3 05/11] exec/ioport: Add portio_list_set_address()

2023-12-21 Thread Bernhard Beschow
Some SuperI/O devices such as the VIA south bridges or the PC87312 controller are able to relocate their SuperI/O functions. Add a convenience function for implementing this in the VIA south bridges. This convenience function relies on previous simplifications in exec/ioport which avoids some dupl

[PATCH v3 10/11] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions

2023-12-21 Thread Bernhard Beschow
This is a preparation for implementing relocation and toggling of SuperI/O functions in the VT8231 device model. Upon reset, all SuperI/O functions will be deactivated, so in case if no -bios is given, let the machine configure those functions the same way Pegasos II firmware would do. Signed-off-

[PATCH v3 00/11] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions

2023-12-21 Thread Bernhard Beschow
This series implements relocation of the SuperI/O functions of the VIA south bridges which resolves some FIXME's. It is part of my via-apollo-pro-133t branch [1] which is an extension of bringing the VIA south bridges to the PC machine [2]. This branch is able to run some real-world X86 BIOSes in t

[PATCH v3 04/11] exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio

2023-12-21 Thread Bernhard Beschow
portio_list_add_1() creates a MemoryRegionPortioList instance which holds a MemoryRegion `mr` and an array of MemoryRegionPortio elements named `ports`. Each element in the array gets assigned the same value for its .base attribute. The same value also ends up as the .addr attribute of `mr` due to

[PATCH v3 01/11] hw/block/fdc-isa: Move portio_list from FDCtrl to FDCtrlISABus

2023-12-21 Thread Bernhard Beschow
FDCtrl::portio_list isn't used inside FDCtrl context but only inside FDCtrlISABus context, so move it there. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- hw/block/fdc-internal.h | 2 -- hw/block/fdc-isa.c | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff -

[PATCH v3 03/11] hw/char/parallel: Move portio_list from ParallelState to ISAParallelState

2023-12-21 Thread Bernhard Beschow
ParallelState::portio_list isn't used inside ParallelState context but only inside ISAParallelState context, so move it there. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- include/hw/char/parallel-isa.h | 2 ++ include/hw/char/parallel.h | 2 -- hw/char/parallel.c

[PATCH] docs/devel/qapi-code-gen: Don't reserve types ending with 'Kind'

2023-12-21 Thread Markus Armbruster
We reserved type names ending with 'Kind' because a simple union 'SomeSimpleUnion' generated both a struct type SomeSimpleUnion and an enum type SomeSimpleUnionKind. Gone since commit 4e99f4b12c0 (qapi: Drop simple unions). The commit neglected to update the documentation not to reserve type name

chacha20-s390 broken in 8.2.0 in TCG on s390x

2023-12-21 Thread Michael Tokarev
When running current kernel on s390x in tcg mode *on s390x hw*, the following is generated when loading crypto selftest module (it gets loaded automatically): [ 10.546690] alg: skcipher: chacha20-s390 encryption test failed (wrong result) on test vector 1, cfg="in-place (one sglist)" [ 10.54

Re: [PATCH v2 11/12] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions

2023-12-21 Thread Bernhard Beschow
Am 19. Dezember 2023 00:11:37 UTC schrieb BALATON Zoltan : >On Mon, 18 Dec 2023, Bernhard Beschow wrote: >> This is a preparation for implementing relocation and toggling of SuperI/O >> functions in the VT8231 device model. Upon reset, all SuperI/O functions >> will be >> deactivated, so in cas

Re: [PATCH 5/6] nbd/server: only traverse NBDExport->clients from main loop thread

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 08:23:15AM +0100, Paolo Bonzini wrote: > On 12/21/23 02:49, Stefan Hajnoczi wrote: > > The NBD clients list is currently accessed from both the export > > AioContext and the main loop thread. When the AioContext lock is removed > > there will be nothing protecting the client

Re: [PATCH v2 08/12] hw/block/fdc-isa: Implement relocation and toggling for TYPE_ISA_FDC

2023-12-21 Thread Bernhard Beschow
Am 19. Dezember 2023 00:09:23 UTC schrieb BALATON Zoltan : >On Mon, 18 Dec 2023, Bernhard Beschow wrote: >> Implement isa_fdc_set_{enabled,iobase} in order to implement relocation and >> toggling of SuperI/O functions in the VIA south bridges without breaking >> encapsulation. > >You may want to

Re: [PATCH 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 11:45:36AM +0100, Kevin Wolf wrote: > Am 21.12.2023 um 02:49 hat Stefan Hajnoczi geschrieben: > > NBDClient has a number of fields that are accessed by both the export > > AioContext and the main loop thread. When the AioContext lock is removed > > these fields will need ano

RE: [PATCH v3 06/70] kvm: Introduce support for memory_attributes

2023-12-21 Thread Wang, Wei W
On Thursday, December 21, 2023 7:54 PM, Li, Xiaoyao wrote: > On 12/21/2023 6:36 PM, Wang, Wei W wrote: > > No need to specifically check for KVM_MEMORY_ATTRIBUTE_PRIVATE there. > > I'm suggesting below: > > > > diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index > > 2d9a2455de..63ba74b221

[PATCH 1/2] target/riscv/csr: Rename groups of interrupts

2023-12-21 Thread Vadim Shakirov
In AIA spec in 5.1 chapter says that "... the AIA categorizes the counter overflow interrupt (code 13) as a local interrupt. It is assumed furthermore that any future definitions for reserved interrupt numbers 14 and 15 will also be local interrupts" and than LCOFI belongs to LOCAL_INTERRUPTS Sign

[PATCH 2/2] target/riscv/csr: Added the ability to delegate LCOFI to VS

2023-12-21 Thread Vadim Shakirov
In the AIA specification in the paragraph "Virtual interrupts for VS level" it is indicated for interrupts 13-63: if the bit in hideleg is enabled, then the corresponding vsip and vsie bits are aliases to sip and sie Signed-off-by: Vadim Shakirov --- target/riscv/csr.c | 36 +

[PATCH] Signed-off-by: guoguangyao

2023-12-21 Thread guoguangyao
target/i386: Eip error in x86_64-softmmu When closing PCREL, qemu-system-x86_64 run into error. Eip modification here leads to the result. Fixes: b5e0d5d22fbf("target/i386: Fix 32-bit wrapping of pc/eip computation") Changes to be committed: modified: target/i386/tcg/translate.c ---

[PATCH 0/2] Added the ability to delegate LCOFI to VS

2023-12-21 Thread Vadim Shakirov
This series of patches adds LCOFI delegation from HS-mode to VS-mode. This possibility must be implemented, as in the AIA spec in section 6.3.2 it is indicated in table 6.1 that in the case when the hideleg bit is set, the corresponding vsip bit is an alias to the corresponding sip bit, also for e

[PATCH] virtio-iommu: Use qemu_real_host_page_mask as default page_size_mask

2023-12-21 Thread Eric Auger
We used to set default page_size_mask to qemu_target_page_mask() but with VFIO assignment it makes more sense to use the actual host page mask instead. So from now on qemu_real_host_page_mask() will be used as a default. To be able to migrate older code, we increase the vmstat version_id to 3 and

[PATCH] tcg/i386: convert add/sub of 128 to sub/add of -128

2023-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tcg/i386/tcg-target.c.inc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index a83f8aab304..4e9f372d4fd 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1332,

Re: [PATCH 1/1] target/riscv: pmp: Ignore writes when RW=01 and MML=0

2023-12-21 Thread Daniel Henrique Barboza
On 12/20/23 12:32, Ivan Klokov wrote: This patch changes behavior on writing RW=01 to pmpcfg with MML=0. RWX filed is form of collective WARL with the combination of pmpcfg.RW=01 remains reserved for future standard use. According to definition of WARL writing the CSR has no other side effect

Re: [PATCH v4 4/4] virtio-blk: add iothread-vq-mapping parameter

2023-12-21 Thread Kevin Wolf
Am 20.12.2023 um 14:47 hat Stefan Hajnoczi geschrieben: > Add the iothread-vq-mapping parameter to assign virtqueues to IOThreads. > Store the vq:AioContext mapping in the new struct > VirtIOBlockDataPlane->vq_aio_context[] field and refactor the code to > use the per-vq AioContext instead of the B

Re: Qemu resets terminal to crazy defaults

2023-12-21 Thread Fabiano Rosas
BALATON Zoltan writes: > On Wed, 20 Dec 2023, Fabiano Rosas wrote: >> Warner Losh writes: >> >>> On Tue, Dec 19, 2023, 1:55 PM Peter Maydell >>> wrote: >>> On Tue, 19 Dec 2023 at 19:40, Fabiano Rosas wrote: > > Dave Blanchard writes: > >> Hello all, can you please help me

Re: [PATCH v2 2/2] target/riscv: UPDATE xATP write CSR

2023-12-21 Thread Daniel Henrique Barboza
On 12/12/23 08:03, Irina Ryapolova wrote: Added xATP_MODE validation for vsatp/hgatp CSRs. The xATP register is an SXLEN-bit read/write WARL register, so the legal value must be returned (See riscv-privileged-20211203, SATP/VSATP/HGATP CSRs). Signed-off-by: Irina Ryapolova --- Reviewed-by

Re: [PATCH 37/40] plugins: add an API to read registers

2023-12-21 Thread Akihiko Odaki
On 2023/12/21 19:38, Alex Bennée wrote: We can only request a list of registers once the vCPU has been initialised so the user needs to use either call the get function on vCPU initialisation or during the translation phase. We don't expose the reg number to the plugin instead hiding it behind a

Re: [PATCH v2 1/2] target/riscv: FIX xATP_MODE validation

2023-12-21 Thread Daniel Henrique Barboza
Hi, On 12/12/23 08:03, Irina Ryapolova wrote: [Changes since v1] used satp_mode.map instead of satp_mode.supported [Original cover] The SATP register is an SXLEN-bit read/write WARL register. It means that CSR fields are only defined for a subset of bit encodings, but allow any value to be wri

Re: [PATCH v4 4/4] virtio-blk: add iothread-vq-mapping parameter

2023-12-21 Thread Kevin Wolf
Am 20.12.2023 um 14:47 hat Stefan Hajnoczi geschrieben: > Add the iothread-vq-mapping parameter to assign virtqueues to IOThreads. > Store the vq:AioContext mapping in the new struct > VirtIOBlockDataPlane->vq_aio_context[] field and refactor the code to > use the per-vq AioContext instead of the B

Re: [PATCH v4 1/4] qdev-properties: alias all object class properties

2023-12-21 Thread Kevin Wolf
Am 20.12.2023 um 14:47 hat Stefan Hajnoczi geschrieben: > qdev_alias_all_properties() aliases a DeviceState's qdev properties onto > an Object. This is used for VirtioPCIProxy types so that --device > virtio-blk-pci has properties of its embedded --device virtio-blk-device > object. > > Currently

[PATCH] hw/m68k/mcf5206: Embed m5206_timer_state in m5206_mbar_state

2023-12-21 Thread Thomas Huth
There's no need to explicitely allocate the memory here, we can simply embed it into the m5206_mbar_state instead. Signed-off-by: Thomas Huth --- hw/m68k/mcf5206.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c inde

Re: [PATCH RFC] linux-user: Allow gdbstub to ignore page protection

2023-12-21 Thread Ilya Leoshkevich
On Thu, Dec 21, 2023 at 10:33:51AM +1100, Richard Henderson wrote: > On 12/16/23 10:24, Ilya Leoshkevich wrote: > > @@ -377,22 +379,42 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, > > flags = page_get_flags(page); > > if (!(flags & PAGE_VALID)) > > return

Re: [PATCH 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 08:26:58AM +0100, Paolo Bonzini wrote: > On 12/21/23 02:49, Stefan Hajnoczi wrote: > > nbd_client_receive_next_request(client); > > + > > +qemu_mutex_unlock(&client->lock); > > + > > if (ret == -EIO) { > > goto disconnect; > > } > > I think I

[PATCH v3 10/14] vdpa: move iommu_list to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 09/14] vdpa: remove msg type of vhost_vdpa

2023-12-21 Thread Eugenio Pérez
It is always VHOST_IOTLB_MSG_V2. We can always make it back per vhost_dev if needed. This change makes easier for vhost_vdpa_map and unmap not to depend on vhost_vdpa but only in VhostVDPAShared. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 1 - hw/vir

[PATCH v3 13/14] vdpa: factor out vhost_vdpa_last_dev

2023-12-21 Thread Eugenio Pérez
From: Si-Wei Liu Generalize duplicated condition check for the last vq of vdpa device to a common function. This is used in next patches. Signed-off-by: Si-Wei Liu Reviewed-by: Eugenio Pérez --- v3: Cherry-picked from Si-Wei's series --- hw/virtio/vhost-vdpa.c | 9 +++-- 1 file changed,

[PATCH v3 08/14] vdpa: move backend_cap to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 14/14] vdpa: move memory listener to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 02/14] vdpa: move iova tree to the shared struct

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 00/14] Consolidate common vdpa members in VhostVDPAShared

2023-12-21 Thread Eugenio Pérez
Current memory operations like pinning may take a lot of time at the destination. Currently they are done after the source of the migration is stopped, and before the workload is resumed at the destination. This is a period where neigher traffic can flow, nor the VM workload can continue (downtim

[PATCH v3 06/14] vdpa: move file descriptor to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 04/14] vdpa: move shadow_data to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 11/14] vdpa: use VhostVDPAShared in vdpa_dma_map and unmap

2023-12-21 Thread Eugenio Pérez
The callers only have the shared information by the end of this series. Start converting this functions. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 4 +-- hw/virtio/vhost-vdpa.c | 50 +- net/vhost-vdpa.c

[PATCH v3 12/14] vdpa: use dev_shared in vdpa_iommu

2023-12-21 Thread Eugenio Pérez
The memory listener functions can call these too. Make vdpa_iommu work with VhostVDPAShared. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 2 +- hw/virtio/vhost-vdpa.c | 16 2 files changed, 9 insertions(+), 9 deletions(-) dif

Re: [PATCH v3 06/70] kvm: Introduce support for memory_attributes

2023-12-21 Thread Xiaoyao Li
On 12/21/2023 6:36 PM, Wang, Wei W wrote: On Thursday, December 21, 2023 2:11 PM, Li, Xiaoyao wrote: On 12/12/2023 9:56 PM, Wang, Wei W wrote: On Wednesday, November 15, 2023 3:14 PM, Xiaoyao Li wrote: Introduce the helper functions to set the attributes of a range of memory to private or shar

[PATCH v3 03/14] vdpa: move iova_range to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 01/14] vdpa: add VhostVDPAShared

2023-12-21 Thread Eugenio Pérez
It will hold properties shared among all vhost_vdpa instances associated with of the same device. For example, we just need one iova_tree or one memory listener for the entire device. Next patches will register the vhost_vdpa memory listener at the beginning of the VM migration at the destination

[PATCH v3 07/14] vdpa: move iotlb_batch_begin_sent to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 05/14] vdpa: use vdpa shared for tracing

2023-12-21 Thread Eugenio Pérez
By the end of this series dma_map and dma_unmap functions don't have the vdpa device for tracing. Movinge trace function to shared member one. Print it also in the vdpa initialization so log reader can relate them. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-vdpa.c |

virtio-pci in qemu-system-arm is broken in 8.2

2023-12-21 Thread Michael Tokarev
It looks like virtio-pci is entirely broke in qemu-system-arm, at least in tcg mode running on x86. The guest (current linux system) just does not detect any virtio-pci devices at all. When 8.1 is booting, the following messages are displayed (debian initramfs): Loading, please wait... Starting

Re: [PATCH v3 52/70] i386/tdx: handle TDG.VP.VMCALL

2023-12-21 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:15:01AM -0500, Xiaoyao Li wrote: > From: Isaku Yamahata > > For GetQuote, delegate a request to Quote Generation Service. > Add property "quote-generation-socket" to tdx-guest, whihc is a property > of type SocketAddress to specify Quote Generation Service(QGS). > > On

[PATCH 30/40] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki Align the parameters of gdb_get_reg_cb and gdb_set_reg_cb with the gdb_read_register and gdb_write_register members of CPUClass to allow to unify the logic to access registers of the core and coprocessors in the future. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée

[PATCH 32/40] gdbstub: Infer number of core registers from XML

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki GDBFeature has the num_regs member so use it where applicable to remove magic numbers. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-8-777047380...@daynix.com> Signed-off-by: Alex Bennée --- include/hw/core/cpu.h | 3 ++- target/s390x/cpu.h | 2 -- gdbs

[PATCH 34/40] gdbstub: Add members to identify registers to GDBFeature

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki These members will be used to help plugins to identify registers. The added members in instances of GDBFeature dynamically generated by CPUs will be filled in later changes. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-10-777047380...@daynix.com> Signed-off-by:

[PATCH 35/40] plugins: Use different helpers when reading registers

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki This avoids optimizations incompatible when reading registers. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-12-777047380...@daynix.com> Signed-off-by: Alex Bennée --- accel/tcg/plugin-helpers.h | 3 ++- include/qemu/plugin.h | 1 + accel/tcg/plugin-gen

<    1   2   3   >