qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/3] accel: introduce accelerator blocker API


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 1/3] accel: introduce accelerator blocker API
Date: Fri, 18 Nov 2022 08:35:14 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 18/11/22 08:32, Philippe Mathieu-Daudé wrote:
On 11/11/22 16:47, Emanuele Giuseppe Esposito wrote:
This API allows the accelerators to prevent vcpus from issuing
new ioctls while execting a critical section marked with the

Typo "executing".

accel_ioctl_inhibit_begin/end functions.

Note that all functions submitting ioctls must mark where the
ioctl is being called with accel_{cpu_}ioctl_begin/end().

This API requires the caller to always hold the BQL.
API documentation is in sysemu/accel-blocker.h

Internally, it uses a QemuLockCnt together with a per-CPU QemuLockCnt
(to minimize cache line bouncing) to keep avoid that new ioctls
run when the critical section starts, and a QemuEvent to wait
that all running ioctls finish.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
  accel/accel-blocker.c          | 154 +++++++++++++++++++++++++++++++++
  accel/meson.build              |   2 +-
  hw/core/cpu-common.c           |   2 +
  include/hw/core/cpu.h          |   3 +
  include/sysemu/accel-blocker.h |  56 ++++++++++++
  5 files changed, 216 insertions(+), 1 deletion(-)
  create mode 100644 accel/accel-blocker.c
  create mode 100644 include/sysemu/accel-blocker.h

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]