Skip to content
  • Emanuele Giuseppe Esposito's avatar
    bd688fc9
    accel: introduce accelerator blocker API · bd688fc9
    Emanuele Giuseppe Esposito authored
    
    
    This API allows the accelerators to prevent vcpus from issuing
    new ioctls while execting a critical section marked with the
    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: default avatarEmanuele Giuseppe Esposito <eesposit@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Message-Id: <20221111154758.1372674-2-eesposit@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    bd688fc9
    accel: introduce accelerator blocker API
    Emanuele Giuseppe Esposito authored
    
    
    This API allows the accelerators to prevent vcpus from issuing
    new ioctls while execting a critical section marked with the
    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: default avatarEmanuele Giuseppe Esposito <eesposit@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Message-Id: <20221111154758.1372674-2-eesposit@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading