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 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 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: 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 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 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

[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,

[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 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] 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 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 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

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

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 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 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 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

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

[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

[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 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 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 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 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 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 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 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 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 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 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 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

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 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

[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 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 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 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 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 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

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] 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: [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

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: [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

[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

[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 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 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

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 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 ---

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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_

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

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

[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 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

[RFC PATCH] readthodocs: fully specify a build environment

2023-12-21 Thread Alex Bennée
This is now expected by rtd so I've expanded using their example as 22.04 is one of our supported platforms. I tried to work out if there was an easy way to re-generate a requirements.txt from our pythondeps.toml but in the end went for the easier solution. Signed-off-by: Alex Bennée Cc: qemu-sta

[PATCH v4 01/13] 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 v4 07/13] 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 v4 03/13] 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 v4 09/13] 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 v4 10/13] 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 v4 02/13] 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 v4 12/13] 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

[PATCH v4 05/13] 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 |

[PATCH v4 13/13] 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 v4 11/13] 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 v4 00/13] 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 v4 06/13] 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 v4 04/13] 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 v4 08/13] 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 02/16] target/riscv: move 'pmu-mask' and 'pmu-num' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Every property in riscv_cpu_options[] will be migrated to riscv_cpu_properties[]. This will make their default values init earlier, allowing cpu_init() functions to overwrite them. We'll also implement common getters and setters that both accelerators will use, allowing them to share validations th

[PATCH 00/16] target/riscv: deprecate riscv_cpu_options[]

2023-12-21 Thread Daniel Henrique Barboza
Hi, Rob reported a few days ago about vendor properties overrides that we're having with riscv_cpu_options [1]. At that time I was doing changes in the 'vlen' and 'elen' properties due to (yet to be sent) changes I'm making in Vector code. I decided to extend the work I was doing and it resulted i

[PATCH 01/16] target/riscv/cpu_cfg.h: remove user_spec and bext_spec

2023-12-21 Thread Daniel Henrique Barboza
They aren't being used. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu_cfg.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/riscv/cpu_cfg.h b/target/riscv/cpu_cfg.h index f4605fb190..c67a8731d3 100644 --- a/target/riscv/cpu_cfg.h +++ b/target/riscv/cpu_cfg.h @@ -136,8 +

[PATCH 12/16] target/riscv: move 'cboz_blocksize' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Do the same we did with 'cbom_blocksize' in the previous patch. Remove the now unused kvm_cpu_set_cbomz_blksize() setter. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 45 +- target/riscv/kvm/kvm-cpu.c | 28

[PATCH 06/16] target/riscv: rework 'priv_spec'

2023-12-21 Thread Daniel Henrique Barboza
'priv_spec' and 'vext_spec' are two string options used as a fancy way of setting integers in the CPU state (cpu->env.priv_ver and cpu->env.vext_ver). It requires us to deal with string parsing and to store them in cpu_cfg. We must support these string options, but we don't need to store them. We

[PATCH 04/16] target/riscv: move 'mmu' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Commit 7f0bdfb5bfc ("target/riscv/cpu.c: remove cfg setup from riscv_cpu_init()") already did some of the work by making some cpu_init() functions to explictly enable their own 'mmu' default. The generic CPUs didn't get update by that commit, so they are still relying on the defaults set by the 'm

[PATCH 07/16] target/riscv: rework 'vext_spec'

2023-12-21 Thread Daniel Henrique Barboza
The same rework did in 'priv_spec' is done for 'vext_spec'. This time is simpler, since we only accept one value ("v1.0") and we'll always have env->vext_ver set to VEXT_VERSION_1_00_0, thus we don't need helpers to convert string to 'vext_ver' back and forth like we needed for 'priv_spec'. Signed

[PATCH 08/16] target/riscv: move 'vlen' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Turning 'vlen' into a class property will allow its default value to be overwritten by cpu_init() later on, solving the issue we have now where CPU specific settings are getting overwritten by the default. For 'vlen', 'elen' and the blocksize options we need a way of tracking if the user set a val

[PATCH 11/16] target/riscv: move 'cbom_blocksize' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
After adding a KVM finalize() implementation, turn cbom_blocksize into a class property. Follow the same design we used with 'vlen' and 'elen'. The duplicated 'cbom_blocksize' KVM property can be removed from kvm_riscv_add_cpu_user_properties(). Signed-off-by: Daniel Henrique Barboza --- target

[PATCH 09/16] target/riscv: move 'elen' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Do the same thing we did with 'vlen' in the previous patch with 'elen'. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 52 -- target/riscv/tcg/tcg-cpu.c | 5 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/target/

[PATCH 10/16] target/riscv: create finalize_features() for KVM

2023-12-21 Thread Daniel Henrique Barboza
To turn cbom_blocksize and cboz_blocksize into class properties we need KVM specific changes. KVM is creating its own version of these options with a customized setter() that prevents users from picking an invalid value during init() time. This comes at the cost of duplicating each option that KVM

[PATCH 03/16] target/riscv: make riscv_cpu_is_generic() public

2023-12-21 Thread Daniel Henrique Barboza
We'll use this function in target/riscv/cpu.c to implement setters that won't allow vendor CPU options to be changed. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 5 + target/riscv/cpu.h | 1 + target/riscv/tcg/tcg-cpu.c | 5 - 3 files changed, 6 insert

<    1   2   3   >