[PATCH] linux-user: Do not treat madvise()'s advice as a bitmask

2022-07-25 Thread Ilya Leoshkevich
Advice is enum, not flags. Doing (advice & MADV_DONTNEED) also matches e.g. MADV_MERGEABLE. Signed-off-by: Ilya Leoshkevich --- linux-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 4e7a6be6ee..edceaca4a8 100644 ---

Re: [PATCH v2] qemu-options: bring the kernel and image options together

2022-07-25 Thread Alex Bennée
Alex Bennée writes: > How to control the booting of QEMU is often a source of confusion for > users. Bring the options that control this together in the manual > pages and add some verbiage to describe when each option is > appropriate. This attempts to codify some of the knowledge expressed >

Re: [RFC PATCH] docs/devel: fix description of OBJECT_DECLARE_SIMPLE_TYPE

2022-07-25 Thread Alex Bennée
Alex Bennée writes: > Since 30b5707c26 (qom: Remove module_obj_name parameter from > OBJECT_DECLARE* macros) we don't need the additional two parameters. > Fix the documentation. > > Signed-off-by: Alex Bennée > --- > docs/devel/qom.rst | 3 +-- > 1 file changed, 1 insertion(+), 2

Re: [PATCH for-7.2 04/10] hmp, device_tree.c: introduce fdt-save

2022-07-25 Thread Daniel Henrique Barboza
On 7/22/22 20:13, BALATON Zoltan wrote: On Fri, 22 Jul 2022, Daniel Henrique Barboza wrote: To save the FDT blob we have the '-machine dumpdtb=' property. With this property set, the machine saves the FDT in and exit. The created file can then be converted to plain text dts format using

Re: [PATCH for-7.2 00/10] add hmp 'save-fdt' and 'info fdt' commands

2022-07-25 Thread Daniel Henrique Barboza
On 7/25/22 06:11, Daniel P. Berrangé wrote: On Fri, Jul 22, 2022 at 04:59:57PM -0300, Daniel Henrique Barboza wrote: Hi, After dealing with a FDT element that isn't being shown in the userspace and having to shutdown the guest, dump the FDT using 'machine -dumpdtb' and then using 'dtc' to

Re: [PATCH v7 11/14] KVM: Register/unregister the guest private memory regions

2022-07-25 Thread Chao Peng
On Thu, Jul 21, 2022 at 05:58:50PM +, Sean Christopherson wrote: > On Thu, Jul 21, 2022, Chao Peng wrote: > > On Thu, Jul 21, 2022 at 03:34:59PM +0800, Wei Wang wrote: > > > > > > > > > On 7/21/22 00:21, Sean Christopherson wrote: > > > Maybe you could tag it with cgs for all the

Re: [PATCH] hw/display/bcm2835_fb: Fix framebuffer allocation address

2022-07-25 Thread Peter Maydell
On Sat, 23 Jul 2022 at 12:15, alanjian85 wrote: > > This patch fixes the dedicated framebuffer mailbox interface(marked as > deprecated in official docs, but can still be fixed for emulation purposes) > by removing unneeded offset to make it works like buffer allocate tag in > bcm2835_property

Re: driver type raw-xz supports discard=unmap?

2022-07-25 Thread Chris Murphy
On Mon, Jul 25, 2022, at 5:13 AM, Daniel P. Berrangé wrote: > On Fri, Jul 22, 2022 at 04:03:52PM -0400, Chris Murphy wrote: >> Is this valid? >> >> ` >> >> >> ` >> `/> >> ` >> >> I know type="raw" works fine, I'm wondering if there'd be any problem >> with type "raw-xz" combined with

[PATCH v2] linux-user: Passthrough MADV_DONTNEED for certain file mappings

2022-07-25 Thread Ilya Leoshkevich
This is a follow-up for commit 892a4f6a750a ("linux-user: Add partial support for MADV_DONTNEED"), which added passthrough for anonymous mappings. File mappings can be handled in a similar manner. In order to do that, mark pages, for which mmap() was passed through, with PAGE_PASSTHROUGH, and

Re: [PATCH] linux-user: Don't assume 0 is not a valid host timer_t value

2022-07-25 Thread Peter Maydell
On Mon, 25 Jul 2022 at 12:13, Daniel P. Berrangé wrote: > > On Mon, Jul 25, 2022 at 12:00:35PM +0100, Peter Maydell wrote: > > For handling guest POSIX timers, we currently use an array > > g_posix_timers[], whose entries are a host timer_t value, or 0 for > > "this slot is unused". When the

Re: [PATCH v2 0/2] accel/tcg: Test unaligned stores to s390x low-address-protected lowcore

2022-07-25 Thread Alex Bennée
Ilya Leoshkevich writes: > Hi, > > This is a follow-up series for [1]. > > The fix has been committed. > > I asked Christian what might be a good alternative for the > mmio-debug-exit device for testing, and he suggested to look into > shutdown/panic actions. > > Patch 1 adds a new panic

[PATCH] .gitlab-ci.d/windows.yml: Enable native Windows symlink

2022-07-25 Thread Bin Meng
From: Bin Meng The following error message was seen during the configure: "ln: failed to create symbolic link 'x86_64-softmmu/qemu-system-x86_64.exe': No such file or directory" By default the MSYS environment variable is not defined, so the runtime behavior of winsymlinks is: if does not

Re: [PATCH for-7.2 10/10] hmp, device_tree.c: add 'info fdt ' support

2022-07-25 Thread Dr. David Alan Gilbert
* Daniel Henrique Barboza (danielhb...@gmail.com) wrote: > 'info fdt' is only able to print full nodes so far. It would be good to > be able to also print single properties, since ometimes we just want > to verify a single value from the FDT. > > libfdt does not have support to find a property

Re: [PATCH 0/4] semihosting: fix various coverity issues

2022-07-25 Thread Alex Bennée
Peter Maydell writes: > This patchset fixes a handful of bugs in the semihosting code > noticed by Coverity. Queued to testing/next, thanks. -- Alex Bennée

[PATCH v2 10/11] block: rename bdrv_child_try_change_aio_context in bdrv_try_change_aio_context

2022-07-25 Thread Emanuele Giuseppe Esposito
No functional changes intended. Signed-off-by: Emanuele Giuseppe Esposito --- block.c| 19 --- block/block-backend.c | 3 +-- include/block/block-global-state.h | 12 +--- 3 files changed, 14 insertions(+), 20 deletions(-) diff

Re: [PATCH] .cirrus.yml: Change winsymlinks to 'native'

2022-07-25 Thread Alex Bennée
Bin Meng writes: > From: Bin Meng > > At present winsymlinks is set to 'nativestrict', and its behavior is: > > a) if native symlinks are enabled and exists, creates > as a native Windows symlink; > b) else if native symlinks are not enabled or if does > not exist, 'ln -s'

[PATCH v2 08/11] block: use the new _change_ API instead of _can_set_ and _set_

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

[PATCH v2 11/11] block: remove bdrv_try_set_aio_context and replace it with bdrv_try_change_aio_context

2022-07-25 Thread Emanuele Giuseppe Esposito
No functional change intended. Signed-off-by: Emanuele Giuseppe Esposito --- block.c| 14 -- block/export/export.c | 2 +- blockdev.c | 22 +++--- docs/devel/multiple-iothreads.txt | 4 ++--

[PATCH v2 01/11] block.c: assert bs->aio_context is written under BQL and drains

2022-07-25 Thread Emanuele Giuseppe Esposito
Also here ->aio_context is read by I/O threads and written under BQL. Reviewed-by: Hanna Reitz Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block.c b/block.c index 7559965dbc..58a9cfc8b7 100644 --- a/block.c +++ b/block.c @@

[PATCH v2 06/11] block: implement .change_aio_ctx in child_of_bds

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

[PATCH v2 02/11] block: use transactions as a replacement of ->{can_}set_aio_context()

2022-07-25 Thread Emanuele Giuseppe Esposito
Simplify the way the aiocontext can be changed in a BDS graph. There are currently two problems in bdrv_try_set_aio_context: - There is a confusion of AioContext locks taken and released, because we assume that old aiocontext is always taken and new one is taken inside. - It doesn't look very

[PATCH v2 09/11] block: remove all unused ->can_set_aio_ctx and ->set_aio_ctx callbacks

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

[PATCH v2 05/11] blockjob: implement .change_aio_ctx in child_job

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

[PATCH v2 07/11] block-backend: implement .change_aio_ctx in child_root

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

[PATCH v2 03/11] bdrv_change_aio_context: use hash table instead of list of visited nodes

2022-07-25 Thread Emanuele Giuseppe Esposito
Minor performance improvement, but given that we have hash tables available, avoid iterating in the visited nodes list every time just to check if a node has been already visited. The data structure is not actually a proper hash map, but an hash set, as we are just adding nodes and not key,value

[PATCH v2 04/11] bdrv_child_try_change_aio_context: add transaction parameter

2022-07-25 Thread Emanuele Giuseppe Esposito
This enables the caller to use the same transaction to also keep track of aiocontext changes. Signed-off-by: Emanuele Giuseppe Esposito --- block.c| 31 -- include/block/block-global-state.h | 5 + 2 files changed, 30 insertions(+), 6

[PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions

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

Re: [PATCH for-7.2 04/10] hmp, device_tree.c: introduce fdt-save

2022-07-25 Thread Dr. David Alan Gilbert
* Daniel Henrique Barboza (danielhb...@gmail.com) wrote: > To save the FDT blob we have the '-machine dumpdtb=' property. With this > property set, the machine saves the FDT in and exit. The created > file can then be converted to plain text dts format using 'dtc'. > > There's nothing

[PATCH] ui/console: fix qemu_console_resize() regression

2022-07-25 Thread marcandre . lureau
From: Marc-André Lureau The display may be corrupted when changing screen colour depth in qemu-system-ppc/MacOS since 7.0. Do not short-cut qemu_console_resize() if the surface is backed by vga vram. When the scanout isn't set, or it is already allocated, or opengl, and the size is fitting, we

Re: [PATCH v2 3/3] python/qemu/machine: use socketpair() for QMP by default

2022-07-25 Thread Daniel P . Berrangé
On Thu, Jun 30, 2022 at 04:34:19PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > When no monitor address is given, establish the QMP communication through > a socketpair() (API is also supported on Windows since Python 3.5) > > Signed-off-by: Marc-André Lureau > --- >

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

2022-07-25 Thread Daniel P . Berrangé
On Mon, Jul 25, 2022 at 03:23:26PM +0400, Marc-André Lureau wrote: > Hi > > On Fri, Jul 1, 2022 at 2:51 AM John Snow wrote: > > > On Thu, Jun 30, 2022 at 8:34 AM wrote: > > > > > > From: Marc-André Lureau > > > > > > Hi, > > > > > > As reported earlier by Richard Henderson ("virgl avocado

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

2022-07-25 Thread Marc-André Lureau
Hi On Fri, Jul 1, 2022 at 2:51 AM John Snow wrote: > On Thu, Jun 30, 2022 at 8:34 AM wrote: > > > > From: Marc-André Lureau > > > > Hi, > > > > As reported earlier by Richard Henderson ("virgl avocado hang" thread), > avocado > > tests may hang when QEMU exits before the QMP connection is

Re: [PATCH] linux-user: Don't assume 0 is not a valid host timer_t value

2022-07-25 Thread Daniel P . Berrangé
On Mon, Jul 25, 2022 at 12:00:35PM +0100, Peter Maydell wrote: > For handling guest POSIX timers, we currently use an array > g_posix_timers[], whose entries are a host timer_t value, or 0 for > "this slot is unused". When the guest calls the timer_create syscall > we look through the array for a

[PATCH] linux-user: Don't assume 0 is not a valid host timer_t value

2022-07-25 Thread Peter Maydell
For handling guest POSIX timers, we currently use an array g_posix_timers[], whose entries are a host timer_t value, or 0 for "this slot is unused". When the guest calls the timer_create syscall we look through the array for a slot containing 0, and use that for the new timer. This scheme

Re: [PATCH v2 4/7] vdpa: Add asid parameter to vhost_vdpa_dma_map/unmap

2022-07-25 Thread Jason Wang
在 2022/7/22 21:43, Eugenio Pérez 写道: So the caller can choose which ASID is destined. No need to update the batch functions as they will always be called from memory listener updates at the moment. Memory listener updates will always update ASID 0, as it's the passthrough ASID. All vhost

Re: [PATCH v4 6/7] vdpa: Add virtio-net mac address via CVQ at start

2022-07-25 Thread Jason Wang
在 2022/7/22 19:12, Eugenio Pérez 写道: This is needed so the destination vdpa device see the same state a the guest set in the source. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 61 1 file changed, 61 insertions(+) diff --git

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

2022-07-25 Thread Gupta, Pankaj
I view it as a performance problem because nothing stops KVM from copying from userspace into the private fd during the SEV ioctl().  What's missing is the ability for userspace to directly initialze the private fd, which may or may not avoid an extra memcpy() depending on how clever

Re: driver type raw-xz supports discard=unmap?

2022-07-25 Thread Daniel P . Berrangé
On Fri, Jul 22, 2022 at 04:03:52PM -0400, Chris Murphy wrote: > Is this valid? > > ` > > > ` > `/> > ` > > I know type="raw" works fine, I'm wondering if there'd be any problem > with type "raw-xz" combined with discards? This is libvirt configuration, so libvirt-us...@redhat.com is the

Re: [PATCH for-7.2 00/10] add hmp 'save-fdt' and 'info fdt' commands

2022-07-25 Thread Daniel P . Berrangé
On Fri, Jul 22, 2022 at 04:59:57PM -0300, Daniel Henrique Barboza wrote: > Hi, > > After dealing with a FDT element that isn't being shown in the userspace > and having to shutdown the guest, dump the FDT using 'machine -dumpdtb' and > then using 'dtc' to see what was inside the FDT, I thought it

Re: Access target TranslatorOps

2022-07-25 Thread Peter Maydell
On Fri, 22 Jul 2022 at 06:09, Kenneth Adam Miller wrote: > > I need to determine the set of instruction encodings that the TCG can support > for a given platform. I am not bothered whether the target runs at all, and > in fact it is better if it doesn't, so runtime or translate time doesn't >

Re: [PATCH v3 1/1] python/machine: Fix AF_UNIX path too long on macOS

2022-07-25 Thread Daniel P . Berrangé
On Fri, Jul 22, 2022 at 11:25:08AM -0700, Peter Delevoryas wrote: > On macOS, private $TMPDIR's are the default. These $TMPDIR's are > generated from a user's unix UID and UUID [1], which can create a > relatively long path: > > /var/folders/d7/rz20f6hd709c1ty8f6_6y_z4gn/T/ > > QEMU's

Re: [PATCH] .cirrus.yml: Change winsymlinks to 'native'

2022-07-25 Thread Thomas Huth
On 19/07/2022 18.12, Bin Meng wrote: From: Bin Meng At present winsymlinks is set to 'nativestrict', and its behavior is: a) if native symlinks are enabled and exists, creates as a native Windows symlink; b) else if native symlinks are not enabled or if does not exist,

Re: [PATCH v4 3/7] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg

2022-07-25 Thread Jason Wang
在 2022/7/22 19:12, Eugenio Pérez 写道: So its generic enough to accept any out sg buffer and we can inject NIC state messages. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git

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

2022-07-25 Thread Emanuele Giuseppe Esposito
Am 20/07/2022 um 16:09 schrieb Vladimir Sementsov-Ogievskiy: > On 7/13/22 00:19, Emanuele Giuseppe Esposito wrote: >> +/* >> + * @visited will accumulate all visited BdrvChild object. The caller is >> + * responsible for freeing the list afterwards. >> + */ >> +bool

Re: [PATCH] linux-user: Passthrough MADV_DONTNEED for certain file mappings

2022-07-25 Thread Laurent Vivier
Le 01/07/2022 à 15:52, Ilya Leoshkevich a écrit : This is a follow-up for commit 892a4f6a750a ("linux-user: Add partial support for MADV_DONTNEED"), which added passthrough for anonymous mappings. File mappings can be handled in a similar manner. In order to do that, mark pages, for which

[PATCH v10 20/21] blockjob: remove unused functions

2022-07-25 Thread Emanuele Giuseppe Esposito
These public functions are not used anywhere, thus can be dropped. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- blockjob.c | 16 ++-- include/block/blockjob.h | 31 --- 2 files changed, 14 insertions(+), 33

[PATCH v10 15/21] blockjob.h: categorize fields in struct BlockJob

2022-07-25 Thread Emanuele Giuseppe Esposito
The same job lock is being used also to protect some of blockjob fields. Categorize them just as done in job.h. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Emanuele Giuseppe Esposito --- include/block/blockjob.h | 17 ++--- 1 file changed, 14 insertions(+), 3

[PATCH v10 10/21] block/mirror.c: use of job helpers in drivers to avoid TOC/TOU

2022-07-25 Thread Emanuele Giuseppe Esposito
Once job lock is used and aiocontext is removed, mirror has to perform job operations under the same critical section, using the helpers prepared in previous commit. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. Reviewed-by: Vladimir Sementsov-Ogievskiy

[PATCH v10 18/21] job.c: enable job lock/unlock and remove Aiocontext locks

2022-07-25 Thread Emanuele Giuseppe Esposito
Change the job_{lock/unlock} and macros to use job_mutex. Now that they are not nop anymore, remove the aiocontext to avoid deadlocks. Therefore: - when possible, remove completely the aiocontext lock/unlock pair - if it is used by some other function too, reduce the locking section as much as

[PATCH v10 13/21] job: detect change of aiocontext within job coroutine

2022-07-25 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini We want to make sure access of job->aio_context is always done under either BQL or job_mutex. The problem is that using aio_co_enter(job->aiocontext, job->co) in job_start and job_enter_cond makes the coroutine immediately resume, so we can't hold the job lock. And caching it

[PATCH v10 14/21] jobs: protect job.aio_context with BQL and job_mutex

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

[PATCH v10 06/21] job: move and update comments from blockjob.c

2022-07-25 Thread Emanuele Giuseppe Esposito
This comment applies more on job, it was left in blockjob as in the past the whole job logic was implemented there. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. No functional change intended. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Emanuele

[PATCH v10 21/21] job: remove unused functions

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

[PATCH v10 16/21] blockjob: rename notifier callbacks as _locked

2022-07-25 Thread Emanuele Giuseppe Esposito
They all are called with job_lock held, in job_event_*_locked() Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi Signed-off-by: Emanuele Giuseppe Esposito --- blockjob.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git

[PATCH v10 09/21] jobs: use job locks also in the unit tests

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

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

2022-07-25 Thread Emanuele Giuseppe Esposito
With "intact" we mean that all job.h functions implicitly take the lock. Therefore API callers are unmodified. This means that: - many static functions that will be always called with job lock held become _locked, and call _locked functions - all public functions take the lock internally if

[PATCH v10 19/21] block_job_query: remove atomic read

2022-07-25 Thread Emanuele Giuseppe Esposito
Not sure what the atomic here was supposed to do, since job.busy is protected by the job lock. Since the whole function is called under job_mutex, just remove the atomic. Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi Signed-off-by: Emanuele Giuseppe Esposito ---

[PATCH v10 08/21] jobs: add job lock in find_* functions

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

[PATCH v10 11/21] jobs: group together API calls under the same job lock

2022-07-25 Thread Emanuele Giuseppe Esposito
Now that the API offers also _locked() functions, take advantage of it and give also the caller control to take the lock and call _locked functions. This makes sense especially when we have for loops, because it makes no sense to have: for(job = job_next(); ...) where each job_next() takes the

[PATCH v10 04/21] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED

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

[PATCH v10 17/21] blockjob: protect iostatus field in BlockJob struct

2022-07-25 Thread Emanuele Giuseppe Esposito
iostatus is the only field (together with .job) that needs protection using the job mutex. It is set in the main loop (GLOBAL_STATE functions) but read in I/O code (block_job_error_action). In order to protect it, change block_job_iostatus_set_err to block_job_iostatus_set_err_locked(), always

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

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

[PATCH v10 12/21] commit and mirror: create new nodes using bdrv_get_aio_context, and not the job aiocontext

2022-07-25 Thread Emanuele Giuseppe Esposito
We are always using the given bs AioContext, so there is no need to take the job ones (which is identical anyways). This also reduces the point we need to check when protecting job.aio_context field. Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi Signed-off-by: Emanuele

[PATCH v10 03/21] job.c: API functions not used outside should be static

2022-07-25 Thread Emanuele Giuseppe Esposito
job_event_* functions can all be static, as they are not used outside job.c. Same applies for job_txn_add_job(). Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/qemu/job.h | 18 -- job.c

[PATCH v10 07/21] blockjob: introduce block_job _locked() APIs

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

[PATCH v10 02/21] job.h: categorize fields in struct Job

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

[PATCH v10 00/21] job: replace AioContext lock with job_mutex

2022-07-25 Thread Emanuele Giuseppe Esposito
In this series, we want to remove the AioContext lock and instead use the already existent job_mutex to protect the job structures and list. This is part of the work to get rid of AioContext lock usage in favour of smaller granularity locks. In order to simplify reviewer's job, job lock/unlock

Re: [PATCH v2 1/2] qapi: Add exit-failure PanicAction

2022-07-25 Thread David Hildenbrand
On 23.07.22 01:36, Ilya Leoshkevich wrote: > Currently QEMU exits with code 0 on both panic an shutdown. For tests > it is useful to return 1 on panic, so that it counts as a test > failure. > > Introduce a new exit-failure PanicAction that makes main() return > EXIT_FAILURE. Tests can use

Re: [PATCH v6 3/5] target/riscv: smstateen check for fcsr

2022-07-25 Thread Weiwei Li
在 2022/7/24 下午11:49, Mayuresh Chitale 写道: On Fri, 2022-07-22 at 09:42 +0800, Weiwei Li wrote: 在 2022/7/21 下午11:31, Mayuresh Chitale 写道: If smstateen is implemented and sstateen0.fcsr is clear then the floating point operations must return illegal instruction exception. Signed-off-by:

Re: [PATCH v6 1/5] target/riscv: Add smstateen support

2022-07-25 Thread Weiwei Li
在 2022/7/24 下午11:39, Mayuresh Chitale 写道: On Fri, 2022-07-22 at 08:31 +0800, Weiwei Li wrote: 在 2022/7/21 下午11:31, Mayuresh Chitale 写道: Smstateen extension specifies a mechanism to close the potential covert channels that could cause security issues. This patch adds the CSRs defined in the

Re: [PATCH v2] vhost: Get vring base from vq, not svq

2022-07-25 Thread Jason Wang
On Mon, Jul 18, 2022 at 8:05 PM Eugenio Pérez wrote: > > The SVQ vring used idx usually match with the guest visible one, as long > as all the guest buffers (GPA) maps to exactly one buffer within qemu's > VA. However, as we can see in virtqueue_map_desc, a single guest buffer > could map to many

Re: [PATCH] vdpa: Fix memory listener deletions of iova tree

2022-07-25 Thread Jason Wang
On Fri, Jul 22, 2022 at 4:26 PM Eugenio Pérez wrote: > > vhost_vdpa_listener_region_del is always deleting the first iova entry > of the tree, since it's using the needle iova instead of the result's > one. > > This was detected using a vga virtual device in the VM using vdpa SVQ. > It makes some

Re: [PATCH v7 01/92] target/arm: Add ID_AA64ZFR0 fields and isar_feature_aa64_sve2

2022-07-25 Thread Zenghui Yu via
Hi Richard, On 2021/5/25 9:02, Richard Henderson wrote: Will be used for SVE2 isa subset enablement. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- v2: Do not read zfr0 from kvm unless sve is available. v7: Move zfr0 read inside existing sve_enabled block. [...] diff --git

Re: [PATCH v3 8/8] arm/aspeed: Replace mx25l25635e chip model

2022-07-25 Thread Andrew Jeffery
On Mon, 25 Jul 2022, at 16:02, Cédric Le Goater wrote: > On 7/25/22 04:08, Andrew Jeffery wrote: >> >> >> On Fri, 22 Jul 2022, at 16:06, Cédric Le Goater wrote: >>> aspeed_machine_witherspoon_class_init(ObjectClass *oc, void *data) >>> mc->desc = "OpenPOWER Witherspoon BMC

Re: [PATCH v3 8/8] arm/aspeed: Replace mx25l25635e chip model

2022-07-25 Thread Cédric Le Goater
On 7/25/22 04:08, Andrew Jeffery wrote: On Fri, 22 Jul 2022, at 16:06, Cédric Le Goater wrote: A mx25l25635f chip model is generally found on these machines. It's newer and uses 4B opcodes which is better to exercise the support in the Linux kernel. Signed-off-by: Cédric Le Goater ---

<    1   2