On 28.02.2018 21:45, Tony Krowiak wrote:How can this happen while the guest is running? QEMU opens the fd when the
On 02/28/2018 04:49 AM, David Hildenbrand wrote:Okay, but from a pure interface point of view, this could happen any
I'm not sure exactly what you're asking here. Are you asking if the+static int vfio_ap_mdev_open(struct mdev_device *mdev)Can't this happen while the guest is already running? Or what hinders us
+{
+ struct ap_matrix_mdev *matrix_mdev = mdev_get_drvdata(mdev);
+ unsigned long events;
+ int ret;
+
+ matrix_mdev->group_notifier.notifier_call = vfio_ap_mdev_group_notifier;
+ events = VFIO_GROUP_NOTIFY_SET_KVM;
+ ret = vfio_register_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY,
+ &events, &matrix_mdev->group_notifier);
+
+ ret = kvm_ap_configure_matrix(matrix_mdev->kvm,
+ matrix_mdev->matrix);
+ if (ret)
+ return ret;
+
+ ret = kvm_ap_enable_ie_mode(matrix_mdev->kvm);
from doing that?
vfio_ap_mdev_open()
function can be called multiple times while the guest is running? AFAIK
this will be
called only once when the mediated device's file descriptor is opened.
This happens in
QEMU when the -device vfio-ap device is realized.
time, even while the guest is already running. Patching in the SCB of a
running VCPU is evil.
But I guess we don't have to worry about that when changing they way we
set ECA_APIE, as described in the other mail.