Re: [RFC PATCH v3 3/5] KVM: x86: Add notifications for Heki policy configuration and violation

2024-05-16 Thread Nicolas Saenz Julienne
On Tue May 14, 2024 at 12:23 PM UTC, Mickaël Salaün wrote: > > Development happens > > https://github.com/vianpl/{linux,qemu,kvm-unit-tests} and the vsm-next > > branch, but I'd advice against looking into it until we add some order > > to the rework. Regardless, feel free to get in touch. > > Than

Re: [RFC PATCH v3 3/5] KVM: x86: Add notifications for Heki policy configuration and violation

2024-05-10 Thread Nicolas Saenz Julienne
On Tue May 7, 2024 at 4:16 PM UTC, Sean Christopherson wrote: > > If yes, that would indeed require a *lot* of work for something we're not > > sure will be accepted later on. > > Yes and no. The AWS folks are pursuing VSM support in KVM+QEMU, and SVSM > support > is trending toward the paired VM

[PATCH] meson.build: Fix glib -Wno-unused-function workaround

2023-05-24 Thread Nicolas Saenz Julienne
ed-function' isn't enabled while running it. Let's enable it. Fixes: fc9a809e0d28 ("build: move glib detection and workarounds to meson") Signed-off-by: Nicolas Saenz Julienne --- Meson logs before: Running compile: Working directory: /local/home/nsaenz/c/qemu/buil

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-23 Thread Nicolas Saenz Julienne
Hi Sean, On Fri May 19, 2023 at 6:23 PM UTC, Sean Christopherson wrote: > On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > > Hi, > > On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: [...] > > VSM introduces isolated guest execution contexts called Virtual Trus

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-19 Thread Nicolas Saenz Julienne
Hi Sean, On Fri May 19, 2023 at 6:23 PM UTC, Sean Christopherson wrote: > On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > > Hi, > > > > On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: > > > > [...] > > > +The user sets the per-page

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-19 Thread Nicolas Saenz Julienne
Hi, On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: [...] > +4.138 KVM_GET_SUPPORTED_MEMORY_ATTRIBUTES > +- > + > +:Capability: KVM_CAP_MEMORY_ATTRIBUTES > +:Architectures: x86 > +:Type: vm ioctl > +:Parameters: u64 memory attributes bitmask(out) > +:R

Re: [PATCH v3 2/3] thread-pool: replace semaphore with condition variable

2022-05-17 Thread Nicolas Saenz Julienne
On Tue, 2022-05-17 at 16:18 +0200, Paolo Bonzini wrote: > On 5/17/22 14:46, Nicolas Saenz Julienne wrote: > > > -while (!pool->stopping) { > > > +while (!pool->stopping && pool->cur_threads <= pool->max_threads) { > > >

Re: [PATCH v3 0/3] thread-pool: fix performance regression

2022-05-17 Thread Nicolas Saenz Julienne
hread-pool: optimize scheduling of completion bottom half > thread-pool: replace semaphore with condition variable > thread-pool: remove stopping variable > > util/thread-pool.c | 74 +++++++--- > 1 file changed, 30 insertions(+), 44 deletions(-) For the whole series: Reviewed-by: Nicolas Saenz Julienne Thanks, -- Nicolás Sáenz

Re: [PATCH v3 2/3] thread-pool: replace semaphore with condition variable

2022-05-17 Thread Nicolas Saenz Julienne
Hi Paolo, On Sat, 2022-05-14 at 08:50 +0200, Paolo Bonzini wrote: [...] > static void *worker_thread(void *opaque) > { > ThreadPool *pool = opaque; > @@ -99,20 +82,25 @@ static void *worker_thread(void *opaque) > pool->pending_threads--; > do_spawn_thread(pool); > > -while

Re: [PATCH v2 2/3] thread-pool: replace semaphore with condition variable

2022-05-13 Thread Nicolas Saenz Julienne
Hi Paolo, On Thu, 2022-05-12 at 12:43 +0200, Paolo Bonzini wrote: [...] > diff --git a/util/thread-pool.c b/util/thread-pool.c > index 4979f30ca3..da189d9338 100644 > --- a/util/thread-pool.c > +++ b/util/thread-pool.c > @@ -57,7 +57,7 @@ struct ThreadPool { > QEMUBH *completion_bh; >

[PATCH v6 1/3] Introduce event-loop-base abstract class

2022-04-25 Thread Nicolas Saenz Julienne
two depend on it. - Process the 'hw' subdir earlier, as it introduces files into the 'qom' source set. No functional changes intended. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Stefan Hajnoczi Acked-by: Markus Armbruster --- Changes since v4: - Introdu

[PATCH v6 3/3] util/event-loop-base: Introduce options to set the thread pool size

2022-04-25 Thread Nicolas Saenz Julienne
lization or upon updating the property's value, remain available during its lifetime regardless of demand, and destroyed upon freeing it. A properly characterized workload will then be able to configure the pool to avoid any latency spikes. Signed-off-by: Nicolas Saenz Julienne Reviewed-by:

[PATCH v6 2/3] util/main-loop: Introduce the main loop into QOM

2022-04-25 Thread Nicolas Saenz Julienne
using the '-object' keyword[1]. Only one instance of 'MainLoopClass' might be created at any time. 'EventLoopBaseClass' learns a new callback, 'can_be_deleted()' so as to mark 'MainLoop' as non-deletable. [1] For example: -object main-loop,id=mai

[PATCH v6 0/3] util/thread-pool: Expose minimun and maximum size

2022-04-25 Thread Nicolas Saenz Julienne
v3: - Avoid duplication in qom.json by creating EventLoopBaseProperties. - Fix failures on first compilation due to race between event-loop-base.o and qapi header generation. Changes since v2: - Get rid of wrong locking/waiting - Fix qapi versioning - Better commit messages Changes since v1:

Re: [PATCH v5 0/3] util/thread-pool: Expose minimun and maximum size

2022-04-25 Thread Nicolas Saenz Julienne
On Mon, 2022-04-25 at 07:22 +0200, Markus Armbruster wrote: > Nicolas Saenz Julienne writes: > > > As discussed on the previous RFC[1] the thread-pool's dynamic thread > > management doesn't play well with real-time and latency sensitive > > systems. This s

[PATCH v5 3/3] util/event-loop-base: Introduce options to set the thread pool size

2022-04-22 Thread Nicolas Saenz Julienne
lization or upon updating the property's value, remain available during its lifetime regardless of demand, and destroyed upon freeing it. A properly characterized workload will then be able to configure the pool to avoid any latency spikes. Signed-off-by: Nicolas Saenz Julienne Review

[PATCH v5 1/3] Introduce event-loop-base abstract class

2022-04-22 Thread Nicolas Saenz Julienne
two depend on it. - Process the 'hw' subdir earlier, as it introduces files into the 'qom' source set. No functional changes intended. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Stefan Hajnoczi --- Changes since v4: - Introduce relevant qom.json changes, l

[PATCH v5 2/3] util/main-loop: Introduce the main loop into QOM

2022-04-22 Thread Nicolas Saenz Julienne
using the '-object' keyword[1]. Only one instance of 'MainLoopClass' might be created at any time. 'EventLoopBaseClass' learns a new callback, 'can_be_deleted()' so as to mark 'MainLoop' as non-deletable. [1] For example: -object main-loop,id=mai

[PATCH v5 0/3] util/thread-pool: Expose minimun and maximum size

2022-04-22 Thread Nicolas Saenz Julienne
nce v1: - Address all Stefan's comments - Introduce new fix Nicolas Saenz Julienne (3): Introduce event-loop-base abstract class util/main-loop: Introduce the main loop into QOM util/event-loop-base: Introduce options to set the thread pool size event-loop-base.c|

Re: [PATCH v4 2/3] util/main-loop: Introduce the main loop into QOM

2022-04-22 Thread Nicolas Saenz Julienne
On Fri, 2022-04-22 at 13:40 +0200, Nicolas Saenz Julienne wrote: > > > +## > > > +{ 'struct': 'EventLoopBaseProperties', > > > + 'data': { '*aio-max-batch': 'int' } } > > > + > > > ## > > >

Re: [PATCH v4 3/3] util/event-loop-base: Introduce options to set the thread pool size

2022-04-22 Thread Nicolas Saenz Julienne
On Fri, 2022-04-22 at 13:15 +0200, Markus Armbruster wrote: > Nicolas Saenz Julienne writes: > > > The thread pool regulates itself: when idle, it kills threads until > > empty, when in demand, it creates new threads until full. This behaviour > > doesn't pla

Re: [PATCH v4 2/3] util/main-loop: Introduce the main loop into QOM

2022-04-22 Thread Nicolas Saenz Julienne
On Fri, 2022-04-22 at 13:13 +0200, Markus Armbruster wrote: > Nicolas Saenz Julienne writes: > > > 'event-loop-base' provides basic property handling for all 'AioContext' > > based event loops. So let's define a new 'MainLoopClass' that inh

Re: [PATCH v4 0/4] util/thread-pool: Expose minimun and maximum size

2022-04-19 Thread Nicolas Saenz Julienne
On Mon, 2022-04-04 at 10:29 +0100, Stefan Hajnoczi wrote: > On Fri, Apr 01, 2022 at 11:35:20AM +0200, Nicolas Saenz Julienne wrote: > > As discussed on the previous RFC[1] the thread-pool's dynamic thread > > management doesn't play well with real-time and latency se

Re: [PATCH v4 0/4] util/thread-pool: Expose minimun and maximum size

2022-04-04 Thread Nicolas Saenz Julienne
On Fri, 2022-04-01 at 11:35 +0200, Nicolas Saenz Julienne wrote: Subject says 0/4 where is should've been 0/3. > As discussed on the previous RFC[1] the thread-pool's dynamic thread > management doesn't play well with real-time and latency sensitive > systems. This se

[PATCH v4 3/3] util/event-loop-base: Introduce options to set the thread pool size

2022-04-01 Thread Nicolas Saenz Julienne
lization or upon updating the property's value, remain available during its lifetime regardless of demand, and destroyed upon freeing it. A properly characterized workload will then be able to configure the pool to avoid any latency spikes. Signed-off-by: Nicolas Saenz Julienne Review

[PATCH v4 1/3] Introduce event-loop-base abstract class

2022-04-01 Thread Nicolas Saenz Julienne
two depend on it. - Process the 'hw' subdir earlier, as it introduces files into the 'qom' source set. No functional changes intended. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Stefan Hajnoczi --- Changes since v3: - Fix event-loop-base compilation so it de

[PATCH v4 2/3] util/main-loop: Introduce the main loop into QOM

2022-04-01 Thread Nicolas Saenz Julienne
using the '-object' keyword[1]. Only one instance of 'MainLoopClass' might be created at any time. 'EventLoopBaseClass' learns a new callback, 'can_be_deleted()' so as to mark 'MainLoop' as non-deletable. [1] For example: -object main-loop,id=mai

[PATCH v4 0/4] util/thread-pool: Expose minimun and maximum size

2022-04-01 Thread Nicolas Saenz Julienne
pBaseProperties. - Fix failures on first compilation due to race between event-loop-base.o and qapi header generation. Changes since v2: - Get rid of wrong locking/waiting - Fix qapi versioning - Better commit messages Changes since v1: - Address all Stefan's comments - Introduce new

Re: [PATCH v3 2/3] util/main-loop: Introduce the main loop into QOM

2022-03-29 Thread Nicolas Saenz Julienne
Hi Markus, On Wed, 2022-03-16 at 15:28 +0100, Markus Armbruster wrote: > Nicolas Saenz Julienne writes: > > > 'event-loop-base' provides basic property handling for all 'AioContext' > > based event loops. So let's define a new 'MainLoopClass'

[PATCH v3 3/3] util/event-loop-base: Introduce options to set the thread pool size

2022-03-16 Thread Nicolas Saenz Julienne
lization or upon updating the property's value, remain available during its lifetime regardless of demand, and destroyed upon freeing it. A properly characterized workload will then be able to configure the pool to avoid any latency spikes. Signed-off-by: Nicolas Saenz Julienne --- Changes

[PATCH v3 0/3] util/thread-pool: Expose minimun and maximum size

2022-03-16 Thread Nicolas Saenz Julienne
iendly and pass all the tests. [1] https://patchwork.ozlabs.org/project/qemu-devel/patch/20220202175234.656711-1-nsaen...@redhat.com/ --- Changes since v2: - Get rid of wrong locking/waiting - Fix qapi versioning - Better commit messages Changes since v1: - Address all Stefan's commen

[PATCH v3 2/3] util/main-loop: Introduce the main loop into QOM

2022-03-16 Thread Nicolas Saenz Julienne
using the '-object' keyword[1]. Only one instance of 'MainLoopClass' might be created at any time. 'EventLoopBaseClass' learns a new callback, 'can_be_deleted()' so as to mark 'MainLoop' as non-deletable. [1] For example: -object main-loop,id=mai

[PATCH v3 1/3] Introduce event-loop-base abstract class

2022-03-16 Thread Nicolas Saenz Julienne
two depend on it. - Process the 'hw' subdir earlier, as it introduces files into the 'qom' source set. No functional changes intended. Signed-off-by: Nicolas Saenz Julienne --- Changes since v2: - reword commit message to better explain compilation dependencies.

Re: [PATCH v2 4/4] util/event-loop-base: Introduce options to set the thread pool size

2022-03-14 Thread Nicolas Saenz Julienne
On Mon, 2022-03-14 at 13:35 +, Stefan Hajnoczi wrote: > On Fri, Mar 11, 2022 at 11:40:30AM +0100, Nicolas Saenz Julienne wrote: > > On Thu, 2022-03-10 at 10:45 +, Stefan Hajnoczi wrote: > > > On Thu, Mar 03, 2022 at 04:13:07PM +0100, Nicolas Saenz Julienne wrote: > >

Re: [PATCH v2 2/4] Introduce event-loop-base abstract class

2022-03-14 Thread Nicolas Saenz Julienne
On Mon, 2022-03-14 at 13:33 +, Stefan Hajnoczi wrote: > On Fri, Mar 11, 2022 at 11:17:22AM +0100, Nicolas Saenz Julienne wrote: > > On Thu, 2022-03-10 at 10:25 +, Stefan Hajnoczi wrote: > > > On Thu, Mar 03, 2022 at 03:58:20PM +0100, Nicolas Saenz Julienne wrote: &

Re: [PATCH v2 4/4] util/event-loop-base: Introduce options to set the thread pool size

2022-03-11 Thread Nicolas Saenz Julienne
On Thu, 2022-03-10 at 10:45 +, Stefan Hajnoczi wrote: > On Thu, Mar 03, 2022 at 04:13:07PM +0100, Nicolas Saenz Julienne wrote: > > @@ -537,10 +546,19 @@ > > # 0 means that the engine will use its default > > # (default:0, since 6.1) >

Re: [PATCH v2 2/4] Introduce event-loop-base abstract class

2022-03-11 Thread Nicolas Saenz Julienne
On Thu, 2022-03-10 at 10:25 +, Stefan Hajnoczi wrote: > On Thu, Mar 03, 2022 at 03:58:20PM +0100, Nicolas Saenz Julienne wrote: > > @@ -2935,13 +2947,6 @@ qemu_syms = custom_target('qemu.syms', output: > > 'qemu.syms', > >

Re: [PATCH v2 1/4] util/thread-pool: Fix thread pool freeing locking

2022-03-10 Thread Nicolas Saenz Julienne
On Thu, 2022-03-10 at 09:20 +, Stefan Hajnoczi wrote: > On Thu, Mar 03, 2022 at 03:58:19PM +0100, Nicolas Saenz Julienne wrote: > > Upon freeing a thread pool we need to get rid of any remaining worker. > > This is achieved by setting the thread pool's topping flag, wakin

[PATCH v2 4/4] util/event-loop-base: Introduce options to set the thread pool size

2022-03-03 Thread Nicolas Saenz Julienne
lization or upon updating the property's value, remain available during its lifetime regardless of demand, and destroyed upon freeing it. A properly characterized workload will then be able to configure the pool to avoid any latency spikes. Signed-off-by: Nicolas Saenz Julienne --- Changes s

[PATCH v2 2/4] Introduce event-loop-base abstract class

2022-03-03 Thread Nicolas Saenz Julienne
ordering in meson.build, among other things the 'hw' subdir is processed earlier as it introduces files into the 'qom' source set. No functional changes intended. Signed-off-by: Nicolas Saenz Julienne --- Changes since v1: - Rename to event-loop-base - Move event-loop-base int

[PATCH v2 3/4] util/main-loop: Introduce the main loop into QOM

2022-03-03 Thread Nicolas Saenz Julienne
using the '-object' keyword[1]. Only one instance of 'MainLoopClass' might be created at any time. 'EventLoopBaseClass' learns a new callback, 'can_be_deleted()' so as to mark 'MainLoop' as non-deletable. Signed-off-by: Nicolas Saenz Julienne

[PATCH v2 0/4] util/thread-pool: Expose minimun and maximum size

2022-03-03 Thread Nicolas Saenz Julienne
iendly and pass all the tests. [1] https://patchwork.ozlabs.org/project/qemu-devel/patch/20220202175234.656711-1-nsaen...@redhat.com/ --- Changes since v1: - Address all Stefan's comments - Introduce new fix Nicolas Saenz Julienne (4): util/thread-pool: Fix thread pool freeing locking

[PATCH v2 1/4] util/thread-pool: Fix thread pool freeing locking

2022-03-03 Thread Nicolas Saenz Julienne
ively blocking the workers from exiting. So let's release the thread pool lock after signaling a worker thread that it's time to exit to give it a chance to do so. Fixes: f7311ccc63 ("threadpool: add thread_pool_new() and thread_pool_free()") Signed-off-by: Nicolas Saenz Julienne

Re: [PATCH 3/3] util/event-loop: Introduce options to set the thread pool size

2022-02-28 Thread Nicolas Saenz Julienne
On Thu, 2022-02-24 at 10:40 +, Stefan Hajnoczi wrote: > On Mon, Feb 21, 2022 at 06:08:45PM +0100, Nicolas Saenz Julienne wrote: > > The thread pool regulates itself: when idle, it kills threads until > > empty, when in demand, it creates new threads until full. This behaviour &

Re: [PATCH 2/3] util/main-loop: Introduce the main loop into QOM

2022-02-28 Thread Nicolas Saenz Julienne
On Thu, 2022-02-24 at 10:01 +, Stefan Hajnoczi wrote: > On Mon, Feb 21, 2022 at 06:08:44PM +0100, Nicolas Saenz Julienne wrote: > > diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h > > index 8dbc6fcb89..fea5a3e9d4 100644 > > --- a/include/qemu/main-loop.h &

Re: [PATCH 1/3] util & iothread: Introduce event-loop abstract class

2022-02-28 Thread Nicolas Saenz Julienne
Hi Stefan, thanks for the review. On Thu, 2022-02-24 at 09:48 +, Stefan Hajnoczi wrote: > On Mon, Feb 21, 2022 at 06:08:43PM +0100, Nicolas Saenz Julienne wrote: > > diff --git a/qom/meson.build b/qom/meson.build > > index 062a3789d8..c20e5dd1cb 100644 > > --- a/qom/meso

[PATCH 0/3] util/thread-pool: Expose minimun and maximum size

2022-02-21 Thread Nicolas Saenz Julienne
iendly and pass all the tests. [1] https://patchwork.ozlabs.org/project/qemu-devel/patch/20220202175234.656711-1-nsaen...@redhat.com/ --- Nicolas Saenz Julienne (3): util & iothread: Introduce event-loop abstract class util/main-loop: Introduce the main loop into QOM util/ev

[PATCH 1/3] util & iothread: Introduce event-loop abstract class

2022-02-21 Thread Nicolas Saenz Julienne
attach themselves to the user creatable class 'complete' function. The new 'event-loop-backend' class will live in the util directory, and will be packed into the qom static library. No functional changes intended. Signed-off-by: Nicolas Saenz Julienne --- MAINTAINERS

[PATCH 3/3] util/event-loop: Introduce options to set the thread pool size

2022-02-21 Thread Nicolas Saenz Julienne
tialization, remain available during its lifetime regardless of demand, and destroyed upon freeing it. A properly characterized workload will then be able to configure the pool to avoid any latency spike. Signed-off-by: Nicolas Saenz Julienne --- include/block/aio.h | 11 +++ qap

[PATCH 2/3] util/main-loop: Introduce the main loop into QOM

2022-02-21 Thread Nicolas Saenz Julienne
using the '-object' keyword[1]. Only one instance of 'MainLoopClass' might be created at any time. 'EventLoopBackendClass' learns a new callback, 'can_be_deleted()' so as to mark 'MainLoop' as non-deletable. Signed-off-by: Nicolas Saenz Julienne

Re: [RFC] thread-pool: Add option to fix the pool size

2022-02-11 Thread Nicolas Saenz Julienne
On Thu, 2022-02-03 at 14:19 +, Stefan Hajnoczi wrote: > Yep, I didn't comment on this because I don't have a good suggestion. > > In terms of semantics I think we should have: > > 1. A global default value that all new AioContext take. The QEMU main >loop's qemu_aio_context will use this

Re: [RFC] thread-pool: Add option to fix the pool size

2022-02-07 Thread Nicolas Saenz Julienne
Hi Stefan, thanks for the review. I took note of your comments. On Thu, 2022-02-03 at 10:53 +, Stefan Hajnoczi wrote: > > Some background on my workload: I'm using IDE emulation, the guest is an > > old RTOS that doesn't support virtio, using 'aio=native' isn't possible > > either (unaligned I

[RFC] thread-pool: Add option to fix the pool size

2022-02-02 Thread Nicolas Saenz Julienne
ing its lifetime regardless of demand, and destroyed upon freeing it. A properly characterized workload will then be able to configure the pool to avoid any latency spike. Signed-off-by: Nicolas Saenz Julienne --- The fix I propose here works for my specific use-case, but I'm pretty sure it