From nobody Mon Feb 9 15:11:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621442876; cv=none; d=zohomail.com; s=zohoarc; b=HE5krfluMrj7CuSTQsEileOQzlN5QxGRQX/AogT7IFSdrSsiAS6PgaUQAGloVjY27qzp+Ux+SlnOQzPZ334+FUivnyNg+8fV4oP9HmjreYilBg/DGENLljIDswqVy7PemI+WAmyR5/VhzMWC0QwtKUG2g1qMGh7hDeEhJiUUqg4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621442876; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZO2vXSOcAYgTvZTq5H2SUet7zYlpax2GmAqSpPcJRYk=; b=H5QeZqb1OwL8zkRhN1Xh3mFgsHQXyJ0P6t3BnCXojZws43Lsxh3URbihJsDpoaPx/W1BcNqKkJVDKQsv7i5dovaPjhxyYBP1s6q5Zk2e4ONFBb1VEEZWvwTJFif07JrnP8WTpTnrfbnEwpHsdC42IRdJ9xkt6Lw/MjwxsIiAOwc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621442876922351.68856384204594; Wed, 19 May 2021 09:47:56 -0700 (PDT) Received: from localhost ([::1]:35696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljPMR-000455-WB for importer@patchew.org; Wed, 19 May 2021 12:47:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljP72-0006Fs-Bp for qemu-devel@nongnu.org; Wed, 19 May 2021 12:32:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljP6p-00060U-KF for qemu-devel@nongnu.org; Wed, 19 May 2021 12:31:57 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-560-xwHAtvnaM5qWs_jpKoKhdg-1; Wed, 19 May 2021 12:31:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 49338180FD6D; Wed, 19 May 2021 16:31:44 +0000 (UTC) Received: from eperezma.remote.csb (ovpn-113-65.ams2.redhat.com [10.36.113.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3EF45D6AC; Wed, 19 May 2021 16:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621441907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZO2vXSOcAYgTvZTq5H2SUet7zYlpax2GmAqSpPcJRYk=; b=BIz3LTB0+D9xJDfSJZzYpUJLcqc6eKzEyWon7H3YCX24u+tTyLTEdMFVY4soTqp9XoUoFN 8cRGSdQUdSG0mKUW0Cf7foM6Yl0wdy3NOjk+HRBWqpTVgFr90AlJrT5nElzT3VQ3ttaEdk wqjs0a59XYwYW2RumQpWjZOeMm0vw/k= X-MC-Unique: xwHAtvnaM5qWs_jpKoKhdg-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Subject: [RFC v3 19/29] vhost: Check for device VRING_USED_F_NO_NOTIFY at shadow virtqueue kick Date: Wed, 19 May 2021 18:28:53 +0200 Message-Id: <20210519162903.1172366-20-eperezma@redhat.com> In-Reply-To: <20210519162903.1172366-1-eperezma@redhat.com> References: <20210519162903.1172366-1-eperezma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eperezma@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Parav Pandit , "Michael S. Tsirkin" , Jason Wang , Juan Quintela , Markus Armbruster , virtualization@lists.linux-foundation.org, Harpreet Singh Anand , Xiao W Wang , Stefan Hajnoczi , Eli Cohen , Michael Lilja , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Eugenio P=C3=A9rez --- hw/virtio/vhost-shadow-virtqueue.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-vi= rtqueue.c index 6d767fe248..6b42147449 100644 --- a/hw/virtio/vhost-shadow-virtqueue.c +++ b/hw/virtio/vhost-shadow-virtqueue.c @@ -135,6 +135,15 @@ static void vhost_shadow_vq_add(VhostShadowVirtqueue *= svq, svq->ring_id_maps[qemu_head] =3D elem; } =20 +static void vhost_shadow_vq_kick(VhostShadowVirtqueue *svq) +{ + /* Make sure we are reading updated device flag */ + smp_rmb(); + if (!(svq->vring.used->flags & VRING_USED_F_NO_NOTIFY)) { + event_notifier_set(&svq->kick_notifier); + } +} + /* Handle guest->device notifications */ static void vhost_handle_guest_kick(EventNotifier *n) { @@ -159,7 +168,7 @@ static void vhost_handle_guest_kick(EventNotifier *n) } =20 vhost_shadow_vq_add(svq, elem); - event_notifier_set(&svq->kick_notifier); + vhost_shadow_vq_kick(svq); } =20 virtio_queue_set_notification(svq->vq, true); --=20 2.27.0