From nobody Mon Feb 9 20:32:23 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=1590168090; cv=none; d=zohomail.com; s=zohoarc; b=ESwyGpyONiLHRVTnMcLGSPZPFvZ4Az63xQQiLH2Cu86agXxlUgyJoBKGvJ57AuQc+sIYnXRgj1ZtPCsP7rf9xN3k5oiNe+2uGg09xm8uWhvZ5d8GFgJDL2v6dRj/VcoRYXZcXg7IRFvTrMm+kaDur4ulxNPr8L4JfkhYyZW+o9A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590168090; 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=IUvdZ9WOLD61EuJIHtGb6cIb8n0l3/qyiO43STZSrdY=; b=MddLiFHXpCmRKzg4Xmo58W9oov1SOd7bpRVbEG3w3fEHibkVcUEpDXUlmj4j9c0pILEyP8hWyY71GFtD9UUuiLgJ3y++Y5wB4hOrnpfBv2W5JvJnUAvPg5ljb+mLZkuVSi7ZlpjaaoAR1YR/GGgnfENr743+6lNm+ARHNWMQFp4= 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 1590168090498166.26939186816548; Fri, 22 May 2020 10:21:30 -0700 (PDT) Received: from localhost ([::1]:58162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jcBMP-0002B9-BO for importer@patchew.org; Fri, 22 May 2020 13:21:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jcBJg-0006P8-PE for qemu-devel@nongnu.org; Fri, 22 May 2020 13:18:40 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:34006 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jcBJf-0000iy-VF for qemu-devel@nongnu.org; Fri, 22 May 2020 13:18:40 -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-486-943U-aW1MuaIJyqJiK7W1w-1; Fri, 22 May 2020 13:18:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF1F88005AA; Fri, 22 May 2020 17:18:35 +0000 (UTC) Received: from localhost (ovpn-112-243.ams2.redhat.com [10.36.112.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id D69857820A; Fri, 22 May 2020 17:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590167918; 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=IUvdZ9WOLD61EuJIHtGb6cIb8n0l3/qyiO43STZSrdY=; b=cUmx9dJpdM225LGWo+dNa+nfYhNfdwv4z69PADj30Za4Q8q8WvU9Kd8ulwFgC47wNZl3aK ijBhbh2mtJxhWlZL8mBDFxGyB0SQ+O7TEt5T1tb7AXQODcpz4am1fW4H+SoO7asjSFfDyf zn/fDJ6FxHetWOhOhEdbtCQ25UPjxEk= X-MC-Unique: 943U-aW1MuaIJyqJiK7W1w-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PATCH 5/5] virtio: enable VIRTIO_F_RING_PACKED for all devices Date: Fri, 22 May 2020 18:17:26 +0100 Message-Id: <20200522171726.648279-6-stefanha@redhat.com> In-Reply-To: <20200522171726.648279-1-stefanha@redhat.com> References: <20200522171726.648279-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.61; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/22 11:11:51 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MIME_BASE64_TEXT=1.741, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , jasowang@redhat.com, cohuck@redhat.com, Stefan Hajnoczi , "Dr. David Alan Gilbert" , Raphael Norwitz , "Gonglei \(Arei\)" , Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fam Zheng , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The packed virtqueue layout was introduced in VIRTIO 1.1. It is a single ring instead of a split avail/used ring design. There are CPU cache advantages to this layout and it is also suited better to hardware implementation. The vhost-net backend has already supported packed virtqueues for some time. Performance benchmarks show that virtio-blk performance on NVMe drives is also improved. Go ahead and enable this feature for all VIRTIO devices. Keep it disabled for QEMU 5.0 and earlier machine types. Signed-off-by: Stefan Hajnoczi Reviewed-by: Dr. David Alan Gilbert --- include/hw/virtio/virtio.h | 2 +- hw/core/machine.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index b69d517496..fd5b4a2044 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -292,7 +292,7 @@ typedef struct VirtIORNGConf VirtIORNGConf; DEFINE_PROP_BIT64("iommu_platform", _state, _field, \ VIRTIO_F_IOMMU_PLATFORM, false), \ DEFINE_PROP_BIT64("packed", _state, _field, \ - VIRTIO_F_RING_PACKED, false) + VIRTIO_F_RING_PACKED, true) =20 hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n); bool virtio_queue_enabled(VirtIODevice *vdev, int n); diff --git a/hw/core/machine.c b/hw/core/machine.c index bb3a7b18b1..3598c3c825 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -28,7 +28,23 @@ #include "hw/mem/nvdimm.h" #include "migration/vmstate.h" =20 -GlobalProperty hw_compat_5_0[] =3D {}; +GlobalProperty hw_compat_5_0[] =3D { + { "vhost-user-blk", "packed", "off" }, + { "vhost-user-fs-device", "packed", "off" }, + { "vhost-vsock-device", "packed", "off" }, + { "virtio-9p-device", "packed", "off" }, + { "virtio-balloon-device", "packed", "off" }, + { "virtio-blk-device", "packed", "off" }, + { "virtio-crypto-device", "packed", "off" }, + { "virtio-gpu-device", "packed", "off" }, + { "virtio-input-device", "packed", "off" }, + { "virtio-iommu-device", "packed", "off" }, + { "virtio-net-device", "packed", "off" }, + { "virtio-pmem", "packed", "off" }, + { "virtio-rng-device", "packed", "off" }, + { "virtio-scsi-common", "packed", "off" }, + { "virtio-serial-device", "packed", "off" }, +}; const size_t hw_compat_5_0_len =3D G_N_ELEMENTS(hw_compat_5_0); =20 GlobalProperty hw_compat_4_2[] =3D { --=20 2.25.3