[PATCH] linux-user: Improve strace output of pread64() and pwrite64()

2023-01-15 Thread Helge Deller
Make the strace look nicer for those two syscalls. Signed-off-by: Helge Deller --- linux-user/strace.list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index 909298099e..41bb6bbfbc 100644 --- a/linux-user/strace.list +++ b

[PATCH] linux-user: Add strace output for clock_getres_time64() and futex_time64()

2023-01-15 Thread Helge Deller
Add the two syscalls to strace output to avoid "Unknown syscall" message. Signed-off-by: Helge Deller --- linux-user/strace.list | 6 ++ 1 file changed, 6 insertions(+) diff --git a/linux-user/strace.list b/linux-user/strace.list index 41bb6bbfbc..3924046426 100644 --- a/linux-user/strace.l

[PATCH v5 1/3] block/rbd: Remove redundant stack variable passphrase_len

2023-01-15 Thread Or Ozeri
Signed-off-by: Or Ozeri --- block/rbd.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index 3aa6aae0e0..cfec0f2862 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -385,7 +385,6 @@ static int qemu_rbd_encryption_format(rbd_image_t ima

[PATCH v5 3/3] block/rbd: Add support for layered encryption

2023-01-15 Thread Or Ozeri
Starting from ceph Reef, RBD has built-in support for layered encryption, where each ancestor image (in a cloned image setting) can be possibly encrypted using a unique passphrase. A new function, rbd_encryption_load2, was added to librbd API. This new function supports an array of passphrases (vi

[PATCH v5 2/3] block/rbd: Add luks-any encryption opening option

2023-01-15 Thread Or Ozeri
Ceph RBD encryption API required specifying the encryption format for loading encryption. The supported formats were LUKS (v1) and LUKS2. Starting from Reef release, RBD also supports loading with "luks-any" format, which works for both versions of LUKS. This commit extends the qemu rbd driver AP

[PATCH v5 0/3] block/rbd: Add support for layered encryption

2023-01-15 Thread Or Ozeri
v5: nit fixes v4: split to multiple commits add support for more than just luks-any in layered encryption nit fixes v3: further nit fixes suggested by @idryomov v2: nit fixes suggested by @idryomov Or Ozeri (3): block/rbd: Remove redundant stack variable passphrase_len block/rbd: Add l

[PATCH 00/17] audio: improve callback interface for audio frontends

2023-01-15 Thread Volker Rümelin
Based-on: <3b1404eb-a7c5-f64c-3e47-1397c54c4...@t-online.de> ([PATCH 00/11] audio: more improvements) The callback interface for emulated audio devices is strange. The callback function has an 'avail' parameter that passes the number of bytes that can be written or read. Unfortunately, this val

[PATCH 03/17] audio: make the resampling code greedy

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Read the maximum possible number of audio frames instead of the minimum necessary number of frames when the audio stream is downsampled and the output buffer is limited. This makes the function symmetrical to upsampling when the input buffer is limited. The maximum possible n

[PATCH 01/17] audio: change type of mix_buf and conv_buf

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Change the type of mix_buf in struct HWVoiceOut and conv_buf in struct HWVoiceIn from STSampleBuffer * to STSampleBuffer. However, a buffer pointer is still needed. For this reason in struct STSampleBuffer samples[] is changed to *buffer. This is a preparation for the next p

[PATCH 07/17] audio: don't misuse audio_pcm_sw_write()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin The audio_pcm_sw_write() function is intended to convert a PCM audio stream to the internal representation, adjust the volume, and then mix it with the other audio streams with a possibly changed sample rate in mix_buf. In order for the audio_capture_mix_and_clear() function

[PATCH 04/17] audio: replace the resampling loop in audio_pcm_sw_write()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Replace the resampling loop in audio_pcm_sw_write() with the new function audio_pcm_sw_resample_out(). Unlike the old resample loop the new function will try to consume input frames even if the output buffer is full. This is necessary when downsampling to avoid reading less a

[PATCH 16/17] audio/audio_template: substitute sw->hw with hw

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Substitute sw->hw with hw in the audio_pcm_sw_alloc_resources_* functions. Signed-off-by: Volker Rümelin --- audio/audio_template.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index a9a550a3b7..0

[PATCH 14/17] audio: wire up st_rate_frames_out()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Wire up the st_rate_frames_out() function and replace audio_frontend_frames_in() to make audio packet length calculation exact. Signed-off-by: Volker Rümelin --- audio/audio.c | 29 - 1 file changed, 8 insertions(+), 21 deletions(-) diff --git

[PATCH 05/17] audio: remove sw == NULL check

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin All call sites of audio_pcm_sw_write() guarantee that sw is not NULL. Remove the unnecessary NULL check. Signed-off-by: Volker Rümelin --- audio/audio.c | 4 1 file changed, 4 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index b0a270ba85..9d6ffa500a 100644

[PATCH 11/17] audio: replace the resampling loop in audio_pcm_sw_read()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Replace the resampling loop in audio_pcm_sw_read() with the new function audio_pcm_sw_resample_in(). Unlike the old resample loop the new function will try to consume input frames even if the output buffer is full. This is necessary when downsampling to avoid reading less aud

[PATCH 08/17] audio: remove unused noop_conv() function

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin The function audio_capture_mix_and_clear() no longer uses audio_pcm_sw_write() to resample audio frames from one internal buffer to another. For this reason, the noop_conv() function is now unused. Remove it. Signed-off-by: Volker Rümelin --- audio/audio.c | 8 1

[PATCH 10/17] audio: wire up st_rate_frames_in()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Wire up the st_rate_frames_in() function and replace audio_frontend_frames_out() to make audio packet length calculation exact. When upsampling, it's still possible that the audio frontends can't write the last audio frame. This will be fixed later. Signed-off-by: Volker Rüm

[PATCH 06/17] audio: rename variables in audio_pcm_sw_write()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin The audio_pcm_sw_write() function uses a lot of very unspecific variable names. Rename them for better readability. ret => total_in total => total_out size => buf_len hwsamples => hw->mix_buf.size samples => frames_in_max Signed-off-by: Volker Rümelin --- audio/audio.c |

[PATCH 13/17] audio/mixeng: calculate number of output frames

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Calculate the exact number of audio output frames the resampling code can generate from a given number of audio input frames. When upsampling, this function returns the maximum number of output frames. This function will later replace the audio_frontend_frames_in() function,

[PATCH 17/17] audio: remove sw->ratio

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Simplify the resample buffer size calculation. For audio playback we have sw->ratio = ((int64_t)sw->hw->info.freq << 32) / sw->info.freq; samples = ((int64_t)sw->HWBUF.size << 32) / sw->ratio; This can be simplified to samples = muldiv64(sw->HWBUF.size, sw->info.freq, sw->h

[PATCH 02/17] audio: change type and name of the resample buffer

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Change the type of the resample buffer from struct st_sample * to STSampleBuffer. Also change the name from buf to resample_buf for better readability. The new variables resample_buf.size and resample_buf.pos will be used after the next patches. There is no functional change

[PATCH 12/17] audio: rename variables in audio_pcm_sw_read()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin The audio_pcm_sw_read() function uses a few very unspecific variable names. Rename them for better readability. ret => total_out total => total_in size => buf_len samples => frames_out_max Signed-off-by: Volker Rümelin --- audio/audio.c | 18 +- 1 file cha

[PATCH 15/17] audio: handle leftover audio frame from upsampling

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Upsampling may leave one remaining audio frame in the input buffer. The emulated audio playback devices are currently resposible to write this audio frame again in the next write cycle. Push that task down to audio_pcm_sw_write. This is another step towards an audio callback

[PATCH 09/17] audio/mixeng: calculate number of input frames

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Calculate the exact number of audio input frames needed to get a given number of audio output frames. The exact number of frames depends only on the difference of opos - ipos and the number of output frames. When downsampling, this function returns the maximum number of input

Re: [PATCH 00/17] audio: improve callback interface for audio frontends

2023-01-15 Thread Volker Rümelin
Am 15.01.23 um 14:08 schrieb Volker Rümelin: Ccing a few more people who might be interested in this patch series. @Mark: After this patch series, the code in your out of tree ASC audio device (and a few in tree audio devices) could be simplified. write_audio() and the loops calling write_audi

Re: [PATCH 2/9] audio: remove special audio_calloc function

2023-01-15 Thread Volker Rümelin
Am 13.01.23 um 17:21 schrieb Daniel P. Berrangé: The audio_calloc function does various checks on the size and nmembers parameters to detect various error conditions. There are only 5 callers * alsa_poll_helper: the pollfd count is small and bounded, * audio_pcm_create_voice_pair_: allocatin

Re: [PATCH v2] Windows installer: keep dependency cache

2023-01-15 Thread Bin Meng
On Sun, Jan 15, 2023 at 2:40 AM Arthur Sengileyev wrote: > > It should be possible to reuse cache built by previous iteration > to process next executables. Processed dependencies are already > skipped later based on dll name. > > Changes for v2: > (1) changed variable name > (2) changed wording i

Re: [PATCH v2] Windows installer: keep dependency cache

2023-01-15 Thread Arthur Sengileyev
Will resubmit v3 fixing this. Sorry for this. This is my first time using the mailing list to submit changes. Regards, Arthur On Sun, Jan 15, 2023 at 5:16 PM Bin Meng wrote: > On Sun, Jan 15, 2023 at 2:40 AM Arthur Sengileyev > wrote: > > > > It should be possible to reuse cache built by previ

Re: [PATCH 1/9] audio: don't check qemu_add_vm_change_state_handler failure

2023-01-15 Thread Volker Rümelin
Am 13.01.23 um 17:21 schrieb Daniel P. Berrangé: This function cannot fail since g_malloc0 aborts on OOM. Signed-off-by: Daniel P. Berrangé --- audio/audio.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index d849a94a81..7b4b957945 1

[PATCH v8 04/11] parallels: create parallels_set_bat_entry_helper() to assign BAT value

2023-01-15 Thread Alexander Ivanov
This helper will be reused in next patches during parallels_co_check rework to simplify its code. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/parallels.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff

[PATCH v8 00/11] parallels: Refactor the code of images checks and fix a bug

2023-01-15 Thread Alexander Ivanov
Fix image inflation when offset in BAT is out of image. Replace whole BAT syncing by flushing only dirty blocks. Move all the checks outside the main check function in separate functions Use WITH_QEMU_LOCK_GUARD for simplier code. Fix incorrect condition in out-of-image check. v8: Rebase on th

[PATCH v8 07/11] parallels: Move check of cluster outside image to a separate function

2023-01-15 Thread Alexander Ivanov
We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 59 ++- 1 f

[PATCH v8 08/11] parallels: Move check of leaks to a separate function

2023-01-15 Thread Alexander Ivanov
We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 84 +-- 1 f

[PATCH v8 11/11] parallels: Incorrect condition in out-of-image check

2023-01-15 Thread Alexander Ivanov
All the offsets in the BAT must be lower than the file size. Fix the check condition for correct check. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/parallels.c b/block/parallels.c ind

[PATCH v8 06/11] parallels: Move check of unclean image to a separate function

2023-01-15 Thread Alexander Ivanov
We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/parallels.c | 31 +

[PATCH v8 02/11] parallels: Fix high_off calculation in parallels_co_check()

2023-01-15 Thread Alexander Ivanov
Don't let high_off be more than the file size even if we don't fix the image. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 4af68adc61..436b36b

[PATCH v8 10/11] parallels: Replace qemu_co_mutex_lock by WITH_QEMU_LOCK_GUARD

2023-01-15 Thread Alexander Ivanov
Replace the way we use mutex in parallels_co_check() for simplier and less error prone code. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/block/parallels.

[PATCH v8 05/11] parallels: Use generic infrastructure for BAT writing in parallels_co_check()

2023-01-15 Thread Alexander Ivanov
BAT is written in the context of conventional operations over the image inside bdrv_co_flush() when it calls parallels_co_flush_to_os() callback. Thus we should not modify BAT array directly, but call parallels_set_bat_entry() helper and bdrv_co_flush() further on. After that there is no need to ma

[PATCH v8 01/11] parallels: Out of image offset in BAT leads to image inflation

2023-01-15 Thread Alexander Ivanov
data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create the cluster at this offset and/or the image will be truncated to this offset on close. This is definitely not correct. Raise an error in parallels_

[PATCH v8 09/11] parallels: Move statistic collection to a separate function

2023-01-15 Thread Alexander Ivanov
We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/parallels.c | 53 +

[PATCH v8 03/11] parallels: Fix data_end after out-of-image check

2023-01-15 Thread Alexander Ivanov
Set data_end to the end of the last cluster inside the image. In such a way we can be sure that corrupted offsets in the BAT can't affect on the image size. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bl

Re: [PATCH v2 0/5] parallels: Add duplication check, repair at open, fix bugs

2023-01-15 Thread Alexander Ivanov
This patchset should be applied on the top of *[PATCH v8 00/11] parallels: Refactor the code of images checks and fix a bug* On 12.01.2023 16:01, Alexander Ivanov wrote: Fix incorrect data end calculation in parallels_open(). Split image leak handling to separate check and fix helpers. Add ch

[PATCH 0/2] target/riscv: Fix double calls to gen_set_rm [#1411]

2023-01-15 Thread Richard Henderson
These double calls tickle an assertion in decode_save_opc, and isn't efficient anyway. Introduce a new helper to do exactly what was desired. r~ Richard Henderson (2): target/arm: Introduce helper_set_rounding_mode_chkfrm target/riscv: Remove helper_set_rod_rounding_mode target/riscv/hel

[PATCH 1/2] target/arm: Introduce helper_set_rounding_mode_chkfrm

2023-01-15 Thread Richard Henderson
The new helper always validates the contents of FRM, even if the new rounding mode is not DYN. This is required by the vector unit. Track whether we've validated FRM separately from whether we've updated fp_status with a given rounding mode, so that we can elide calls correctly. This partially r

[PATCH 2/2] target/riscv: Remove helper_set_rod_rounding_mode

2023-01-15 Thread Richard Henderson
The only setting of RISCV_FRM_ROD is from the vector unit, and now handled by helper_set_rounding_mode_chkfrm. This helper is now unused. Signed-off-by: Richard Henderson --- target/riscv/helper.h | 1 - target/riscv/fpu_helper.c | 5 - target/riscv/translate.c | 4 3 files changed

Re: [PATCH 0/2] target/riscv: Fix double calls to gen_set_rm [#1411]

2023-01-15 Thread Richard Henderson
On 1/15/23 06:06, Richard Henderson wrote: These double calls tickle an assertion in decode_save_opc, and isn't efficient anyway. Introduce a new helper to do exactly what was desired. Also #1339. r~

[PATCH v3] Windows installer: keep dependency cache

2023-01-15 Thread Arthur Sengileyev
It should be possible to reuse cache built by previous iteration to process next executables. Processed dependencies are already skipped later based on dll name. Signed-off-by: Arthur Sengileyev Reviewed-by: Bin Meng --- scripts/nsis.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) d

[PATCH] target/arm: Widen cnthctl_el2 to uint64_t

2023-01-15 Thread Richard Henderson
This is a 64-bit register on AArch64, even if the high 44 bits are RES0. Because this is defined as ARM_CP_STATE_BOTH, we are asserting that the cpreg field is 64-bits. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1400 Signed-off-by: Richard Henderson --- During my perigrinations of

[PATCH] vhost-user-fs: add capability to allow migration

2023-01-15 Thread Anton Kuchin
Now any vhost-user-fs device makes VM unmigratable, that also prevents qemu update without stopping the VM. In most cases that makes sense because qemu has no way to transfer FUSE session state. But we can give an option to orchestrator to override this if it can guarantee that state will be prese

[PATCH v7 00/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-15 Thread Avihai Horon
Hello, Following VFIO migration protocol v2 acceptance in kernel, this series implements VFIO migration according to the new v2 protocol and replaces the now deprecated v1 implementation. The main differences between v1 and v2 migration protocols are: 1. VFIO device state is represented as a fini

[PATCH v7 01/13] linux-headers: Update to v6.2-rc1

2023-01-15 Thread Avihai Horon
Update to commit 1b929c02afd3 ("Linux 6.2-rc1"). Signed-off-by: Avihai Horon --- include/standard-headers/drm/drm_fourcc.h | 63 +++- include/standard-headers/linux/ethtool.h | 81 - include/standard-headers/linux/fuse.h | 20 +- .../linux/input-event-codes.h

[PATCH v7 06/13] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one

2023-01-15 Thread Avihai Horon
vfio_devices_all_running_and_saving() is used to check if migration is in pre-copy phase. This is done by checking if migration is in setup or active states and if all VFIO devices are in pre-copy state, i.e. _SAVING | _RUNNING. In VFIO migration protocol v2 pre-copy support is made optional. Henc

[PATCH v7 03/13] vfio/migration: Fix NULL pointer dereference bug

2023-01-15 Thread Avihai Horon
As part of its error flow, vfio_vmstate_change() accesses MigrationState->to_dst_file without any checks. This can cause a NULL pointer dereference if the error flow is taken and MigrationState->to_dst_file is not set. For example, this can happen if VM is started or stopped not during migration a

[PATCH v7 02/13] migration: No save_live_pending() method uses the QEMUFile parameter

2023-01-15 Thread Avihai Horon
From: Juan Quintela So remove it everywhere. Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr. David Alan Gilbert --- include/migration/register.h | 3 +-- migration/savevm.h | 3 +-- hw/s390x/s390-stattrib.c | 2 +- hw/vfio/migration

[PATCH v7 07/13] vfio/migration: Move migration v1 logic to vfio_migration_init()

2023-01-15 Thread Avihai Horon
Move vfio_dev_get_region_info() logic from vfio_migration_probe() to vfio_migration_init(). This logic is specific to v1 protocol and moving it will make it easier to add the v2 protocol implementation later. No functional changes intended. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goate

[PATCH v7 05/13] migration/qemu-file: Add qemu_file_get_to_fd()

2023-01-15 Thread Avihai Horon
Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Cédric Le Goater --- migration/qemu-file.h

[PATCH v7 04/13] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support

2023-01-15 Thread Avihai Horon
Currently, if IOMMU of a VFIO container doesn't support dirty page tracking, migration is blocked. This is because a DMA-able VFIO device can dirty RAM pages without updating QEMU about it, thus breaking the migration. However, this doesn't mean that migration can't be done at all. In such case, a

[PATCH v7 11/13] vfio/migration: Remove VFIO migration protocol v1

2023-01-15 Thread Avihai Horon
Now that v2 protocol implementation has been added, remove the deprecated v1 implementation. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 5 - hw/vfio/common.c | 19 +- hw/vfio/migration.c | 703 +

[PATCH v7 12/13] vfio: Alphabetize migration section of VFIO trace-events file

2023-01-15 Thread Avihai Horon
Sort the migration section of VFIO trace events file alphabetically and move two misplaced traces to common.c section. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- hw/vfio/trace-events | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/

[PATCH v7 08/13] vfio/migration: Rename functions/structs related to v1 protocol

2023-01-15 Thread Avihai Horon
To avoid name collisions, rename functions and structs related to VFIO migration protocol v1. This will allow the two protocols to co-exist when v2 protocol is added, until v1 is removed. No functional changes intended. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- include/hw/vf

[PATCH v7 13/13] docs/devel: Align VFIO migration docs to v2 protocol

2023-01-15 Thread Avihai Horon
Now that VFIO migration protocol v2 has been implemented and v1 protocol has been removed, update the documentation according to v2 protocol. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- docs/devel/vfio-migration.rst | 68 --- 1 file changed, 30

[PATCH v7 10/13] vfio/migration: Optimize vfio_save_pending()

2023-01-15 Thread Avihai Horon
During pre-copy phase of migration vfio_save_pending() is called repeatedly and queries the VFIO device for its pending data size. As long as pending RAM size is over the threshold, migration can't converge and be completed. Therefore, during this time there is no point in querying the VFIO device

[PATCH v7 09/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-15 Thread Avihai Horon
Implement the basic mandatory part of VFIO migration protocol v2. This includes all functionality that is necessary to support VFIO_MIGRATION_STOP_COPY part of the v2 protocol. The two protocols, v1 and v2, will co-exist and in the following patches v1 protocol code will be removed. There are sev

Re: [PATCH v6 09/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-15 Thread Avihai Horon
On 13/01/2023 18:13, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 1/12/23 09:50, Avihai Horon wrote: Implement the basic mandatory part of VFIO migration protocol v2. This includes all functionality that is necessary to support VFIO_MIGRATION_STOP_COPY

[qemu-web PATCH] Add download procedure in Windows with msys2

2023-01-15 Thread nathbappai
From: Biswapriyo Nath Signed-off-by: Biswapriyo Nath --- _download/windows.md | 32 1 file changed, 32 insertions(+) diff --git a/_download/windows.md b/_download/windows.md index 5ccf8b4..43c9ac7 100644 --- a/_download/windows.md +++ b/_download/windows.md @@

Re: [PATCH 7/7] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-01-15 Thread Mike Maslenkin
On Fri, Jan 13, 2023 at 7:43 PM Jonathan Cameron via wrote: > > CXL uses PCI AER Internal errors to signal to the host that an error has > occurred. The host can then read more detailed status from the CXL RAS > capability. > > For uncorrectable errors: support multiple injection in one operation

[PATCH] linux-user: Improve strace output of getgroups() and setgroups()

2023-01-15 Thread Helge Deller
Make the strace look nicer for those syscalls. Signed-off-by: Helge Deller --- linux-user/strace.list | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index 3924046426..7c1124a718 100644 --- a/linux-user/strace.list +++ b

Re: [PATCH v3 1/3] arm: move KVM breakpoints helpers

2023-01-15 Thread Alex Bennée
francesco.cag...@gmail.com writes: > From: Francesco Cagnin > > These helpers will be also used for HVF. Aside from reformatting a > couple of comments for 'checkpatch.pl' and updating meson to compile > 'hyp_gdbstub.c', this is just code motion. > > Signed-off-by: Francesco Cagnin Haven't I

[PATCH] Fix exec migration on Windows (w32+w64).

2023-01-15 Thread John Berberian, Jr
* Use cmd instead of /bin/sh on Windows. * Try to auto-detect cmd.exe's path, but default to a hard-coded path. Note that this will require that gspawn-win32-helper.exe and gspawn-win32-helper-console.exe are included in the Windows binary distributions (cc: Stefan Weil). Signed-off-by: John Ber

Re: [PATCH 0/3] Fix UNMAP notifier for intel-iommu

2023-01-15 Thread Viktor Prutyanov
On Tue, Nov 29, 2022 at 11:10 AM Jason Wang wrote: > > Hi All: > > According to ATS, device should work if ATS is disabled. This is not > correctly implemented in the current intel-iommu since it doesn't > handle the UNMAP notifier correctly. This breaks the vhost-net + > vIOMMU without dt. > > Th

[PATCH] pci: add enforce_slot_reserved_mask_manual property

2023-01-15 Thread Chuck Zmudzinski
The current reserved slot check in do_pci_register_device(), added with commit 8b8849844fd6, is done even if the pci device being added is configured manually for a particular slot. The new property, when set to false, disables the check when the device is configured to request a particular slot. T

[PATCH v2] Fix exec migration on Windows (w32+w64).

2023-01-15 Thread John Berberian, Jr
* Use cmd instead of /bin/sh on Windows. * Try to auto-detect cmd.exe's path, but default to a hard-coded path. Note that this will require that gspawn-win[32|64]-helper.exe and gspawn-win[32|64]-helper-console.exe are included in the Windows binary distributions (cc: Stefan Weil). Signed-off-by

Re: [PATCH 1/4] iothread: Remove unused IOThreadClass / IOTHREAD_CLASS

2023-01-15 Thread Alistair Francis
On Sat, Jan 14, 2023 at 6:04 AM Philippe Mathieu-Daudé wrote: > > Since commit be8d853766 ("iothread: add I/O thread object") we > never used IOThreadClass / IOTHREAD_CLASS() / IOTHREAD_GET_CLASS(), > remove these definitions. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Franc

Re: [PATCH 2/4] hw/irq: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE()

2023-01-15 Thread Alistair Francis
On Sat, Jan 14, 2023 at 6:03 AM Philippe Mathieu-Daudé wrote: > > QOM *DECLARE* macros expect a typedef as first argument, > not a structure. Replace 'struct IRQState' by 'IRQState' > to avoid when modifying the macros: > > ../hw/core/irq.c:29:1: error: declaration of anonymous struct must be a

Re: [PATCH 3/4] hw/or-irq: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE()

2023-01-15 Thread Alistair Francis
On Sat, Jan 14, 2023 at 6:03 AM Philippe Mathieu-Daudé wrote: > > Missed during automatic conversion from commit 8063396bf3 > ("Use OBJECT_DECLARE_SIMPLE_TYPE when possible"). > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Alistair > --- > include/hw/or-irq.h | 3 +--

Re: [PATCH 4/4] hw: Replace qemu_or_irq typedef by OrIRQState

2023-01-15 Thread Alistair Francis
On Sat, Jan 14, 2023 at 6:04 AM Philippe Mathieu-Daudé wrote: > > OBJECT_DECLARE_SIMPLE_TYPE() macro provides the OrIRQState > declaration for free. Besides, the QOM code style is to use > the structure name as typedef, and QEMU style is to use Camel > Case, so rename qemu_or_irq as OrIRQState. >

Re: [PATCH v7 2/3] hw/riscv/boot.c: make riscv_load_initrd() static

2023-01-15 Thread Alistair Francis
On Sat, Jan 14, 2023 at 3:39 AM Daniel Henrique Barboza wrote: > > The only remaining caller is riscv_load_kernel_and_initrd() which > belongs to the same file. > > Signed-off-by: Daniel Henrique Barboza > Reviewed-by: Philippe Mathieu-Daudé > Reviewed-by: Bin Meng Reviewed-by: Alistair Franci

Re: [RFC v2 01/13] vdpa: fix VHOST_BACKEND_F_IOTLB_ASID flag check

2023-01-15 Thread Jason Wang
在 2023/1/13 14:42, Eugenio Perez Martin 写道: On Fri, Jan 13, 2023 at 4:12 AM Jason Wang wrote: On Fri, Jan 13, 2023 at 1:24 AM Eugenio Pérez wrote: VHOST_BACKEND_F_IOTLB_ASID is the feature bit, not the bitmask. Since the device under test also provided VHOST_BACKEND_F_IOTLB_MSG_V2 and VHOST

Re: [RFC v2 02/13] vdpa net: move iova tree creation from init to start

2023-01-15 Thread Jason Wang
在 2023/1/13 15:28, Eugenio Perez Martin 写道: On Fri, Jan 13, 2023 at 4:53 AM Jason Wang wrote: On Fri, Jan 13, 2023 at 1:24 AM Eugenio Pérez wrote: Only create iova_tree if and when it is needed. The cleanup keeps being responsability of last VQ but this change allows to merge both cleanup

Re: [PATCH v2 0/2] target/riscv/cpu: fix sifive_u 32/64bits boot in riscv-to-apply.next

2023-01-15 Thread Alistair Francis
On Sat, Jan 14, 2023 at 3:55 AM Daniel Henrique Barboza wrote: > > Hi, > > In this version I fixed the commit message typos pointed by Bin. I've > also added some notes about the code repetition the fix is introducing > in the cpu_init() functions. > > The patches are based on riscv-to-apply.next

[PATCH v2] hw/net/lan9118: log [read|write]b when mode_16bit is enabled rather than abort

2023-01-15 Thread Qiang Liu
This patch replaces hw_error to guest error log for [read|write]b accesses when mode_16bit is enabled. This avoids aborting qemu. Fixes: 1248f8d4cbc3 ("hw/lan9118: Add basic 16-bit mode support.") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1433 Reported-by: Qiang Liu Signed-off-by: Q

Re: [PATCH] target/riscv: Use TARGET_FMT_lx for env->mhartid

2023-01-15 Thread Alistair Francis
On Tue, Jan 10, 2023 at 1:28 AM Bin Meng wrote: > > env->mhartid is currently casted to long before printed, which drops > the high 32-bit for rv64 on 32-bit host. Use TARGET_FMT_lx instead. > > Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Alistair > --- > > target/riscv/cpu.c | 6 +

[PATCH] hw/display/xlnx_dp: fix abort in xlnx_dp_change_graphic_fmt()

2023-01-15 Thread Qiang Liu
xlnx_dp_change_graphic_fmt() will directly abort if either graphic format or the video format is not supported. This patch directly let xlnx_dp_change_graphic_fmt() return if the formats are not supported. xlnx_dp_change_graphic_fmt() has two callsites in xlnx_dp_avbufm_write() and xlnx_dp_reset(

Re: [RFC v2 04/13] vdpa: rewind at get_base, not set_base

2023-01-15 Thread Jason Wang
在 2023/1/13 15:40, Eugenio Perez Martin 写道: On Fri, Jan 13, 2023 at 5:10 AM Jason Wang wrote: On Fri, Jan 13, 2023 at 1:24 AM Eugenio Pérez wrote: At this moment it is only possible to migrate to a vdpa device running with x-svq=on. As a protective measure, the rewind of the inflight descri

Re: [RFC v2 05/13] vdpa net: add migration blocker if cannot migrate cvq

2023-01-15 Thread Jason Wang
在 2023/1/13 15:46, Eugenio Perez Martin 写道: On Fri, Jan 13, 2023 at 5:25 AM Jason Wang wrote: 在 2023/1/13 01:24, Eugenio Pérez 写道: A vdpa net device must initialize with SVQ in order to be migratable, and initialization code verifies conditions. If the device is not initialized with the x-

Re: [PATCH] target/riscv: Use TARGET_FMT_lx for env->mhartid

2023-01-15 Thread Alistair Francis
On Tue, Jan 10, 2023 at 1:28 AM Bin Meng wrote: > > env->mhartid is currently casted to long before printed, which drops > the high 32-bit for rv64 on 32-bit host. Use TARGET_FMT_lx instead. > > Signed-off-by: Bin Meng Thanks! Applied to riscv-to-apply.next Alistair > --- > > target/riscv/cp

Re: [PATCH 01/10] hw/riscv/spike.c: simplify create_fdt()

2023-01-15 Thread Alistair Francis
On Thu, Jan 12, 2023 at 3:21 AM Daniel Henrique Barboza wrote: > > 'mem_size' and 'cmdline' are unused. > > Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Alistair > --- > hw/riscv/spike.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/hw/ri

Re: [PATCH 02/10] hw/riscv/virt.c: simplify create_fdt()

2023-01-15 Thread Alistair Francis
On Thu, Jan 12, 2023 at 3:18 AM Daniel Henrique Barboza wrote: > > 'mem_size' and 'cmdline' aren't being used. Remove them. > > Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Alistair > --- > hw/riscv/virt.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >

Re: [PATCH 03/10] hw/riscv/sifive_u.c: simplify create_fdt()

2023-01-15 Thread Alistair Francis
On Thu, Jan 12, 2023 at 3:25 AM Daniel Henrique Barboza wrote: > > 'cmdline' isn't being used. Remove it. > > A MachineState pointer is being retrieved via a MACHINE() macro calling > qdev_get_machine(). Use MACHINE(s) instead to avoid calling qdev(). > > 'mem_size' is being set as machine->ram_s

Re: [PATCH 04/10] hw/riscv/virt.c: remove 'is_32_bit' param from create_fdt_socket_cpus()

2023-01-15 Thread Alistair Francis
On Thu, Jan 12, 2023 at 3:22 AM Daniel Henrique Barboza wrote: > > create_fdt_socket_cpus() writes a different 'mmu-type' value if we're > running in 32 or 64 bits. However, the flag is being calculated during > virt_machine_init(), and is passed around in create_fdt(), then > create_fdt_socket(),

Re: [PATCH 05/10] hw/riscv: use MachineState::fdt in riscv_socket_fdt_write_id()

2023-01-15 Thread Alistair Francis
On Thu, Jan 12, 2023 at 3:28 AM Daniel Henrique Barboza wrote: > > There's no need to use a MachineState pointer and a fdt pointer now that > all RISC-V machines are using the FDT from the MachineState. > > Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Alistair > --- >

Re: [PATCH 06/10] hw/riscv: use ms->fdt in riscv_socket_fdt_write_distance_matrix()

2023-01-15 Thread Alistair Francis
On Thu, Jan 12, 2023 at 3:26 AM Daniel Henrique Barboza wrote: > > There's no need to use a MachineState pointer and a fdt pointer now that > all RISC-V machines are using the FDT from the MachineState. > > Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Alistair > --- >

Re: [PATCH 00/10] riscv: create_fdt() related cleanups

2023-01-15 Thread Alistair Francis
On Thu, Jan 12, 2023 at 3:12 AM Daniel Henrique Barboza wrote: > > Hi, > > This is a follow-up of: > > "[PATCH v5 00/11] riscv: OpenSBI boot test and cleanups" > > Patches were based on top of riscv-to-apply.next [1] + the series above. > > The recent FDT changes made in hw/riscv (all machines are

Re: [PATCH v5 1/2] riscv: Pass Object to register_cpu_props instead of DeviceState

2023-01-15 Thread Alistair Francis
On Fri, Jan 13, 2023 at 8:36 PM Alexandre Ghiti wrote: > > One can extract the DeviceState pointer from the Object pointer, so pass > the Object for future commits to access other fields of Object. > > No functional changes intended. > > Signed-off-by: Alexandre Ghiti Reviewed-by: Alistair Franc

Re: [PATCH v7 3/3] hw/riscv: clear kernel_entry higher bits in load_elf_ram_sym()

2023-01-15 Thread Alistair Francis
On Sat, Jan 14, 2023 at 11:41 PM Bin Meng wrote: > > On Sat, Jan 14, 2023 at 1:18 AM Daniel Henrique Barboza > wrote: > > > > Recent hw/risc/boot.c changes caused a regression in an use case with > > the Xvisor hypervisor. Running a 32 bit QEMU guest with '-kernel' > > stopped working. The reason

Re: [PATCH 1/2] target/riscv: Fix up masking of vsip/vsie accesses

2023-01-15 Thread Alistair Francis
On Fri, Dec 16, 2022 at 8:46 AM Andrew Bresticker wrote: > > The current logic attempts to shift the VS-level bits into their correct > position in mip while leaving the remaining bits in-tact. This is both > pointless and likely incorrect since one would expect that any new, future > VS-level int

Re: [PATCH 2/2] target/riscv: Trap on writes to stimecmp from VS when hvictl.VTI=1

2023-01-15 Thread Alistair Francis
On Fri, Dec 16, 2022 at 8:46 AM Andrew Bresticker wrote: > > Per the AIA specification, writes to stimecmp from VS level should > trap when hvictl.VTI is set since the write may cause vsip.STIP to > become unset. > > Fixes: 3ec0fe18a31f ("target/riscv: Add vstimecmp support") > Signed-off-by: Andr

Call qemu_socketpair() instead of socketpair() when possible

2023-01-15 Thread Guoyi Tu
As qemu_socketpair() was introduced in commit 3c63b4e9 ("oslib-posix: Introduce qemu_socketpair()"), it's time to replace the other existing socketpair() calls with qemu_socketpair() if possible Signed-off-by: Guoyi Tu --- backends/tpm/tpm_emulator.c | 2 +- tests/qtest/dbus-display-tes

Re: [RFC v2 05/13] vdpa net: add migration blocker if cannot migrate cvq

2023-01-15 Thread Michael S. Tsirkin
On Mon, Jan 16, 2023 at 11:34:20AM +0800, Jason Wang wrote: > > 在 2023/1/13 15:46, Eugenio Perez Martin 写道: > > On Fri, Jan 13, 2023 at 5:25 AM Jason Wang wrote: > > > > > > 在 2023/1/13 01:24, Eugenio Pérez 写道: > > > > A vdpa net device must initialize with SVQ in order to be migratable, > > > >

Re: [PATCH v2 2/5] target/riscv: Update VS timer whenever htimedelta changes

2023-01-15 Thread Anup Patel
Hi Alistair, On Tue, Jan 3, 2023 at 9:43 PM Anup Patel wrote: > > Hi Alistair, > > On Wed, Dec 28, 2022 at 11:08 AM Alistair Francis > wrote: > > > > On Fri, Dec 23, 2022 at 11:14 PM Anup Patel wrote: > > > > > > On Thu, Dec 15, 2022 at 8:55 AM Alistair Francis > > > wrote: > > > > > > > > O

  1   2   >