From nobody Mon Feb 9 20:46:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239760740384.3525987101161; Wed, 5 Jul 2017 00:29:20 -0700 (PDT) Received: from localhost ([::1]:44544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSekR-00016X-8x for importer@patchew.org; Wed, 05 Jul 2017 03:29:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWo-0004h8-Iq for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWn-0007hy-M6 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:14 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWn-0007hV-CD; Wed, 05 Jul 2017 03:15:13 -0400 Received: by mail-wm0-x244.google.com with SMTP id j85so30447933wmj.0; Wed, 05 Jul 2017 00:15:13 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=6L4XugqVIefozncL+7/SBmA/ORq/e08syfRoJGil+Zo=; b=mu3jQxO6g/R/RQfo3a9Dhw0ff1bpljOeX42QU3NdZl1wVCnU8TmOTbZsvkxFRqDvE4 bisFv18PZ4LwzTqu+OJ3dwsdIxXi8bDRKp35hvc/ffKjZMBQEm4jU7h7yPYwdtjwaVFk 943Ayjr7P3C+qHA3bCIt1sAvfgAF8/KTGlL4fsP7W2JzJAQhiIZVB485AMSY0uVD1GDm XFXQMvGxYAwe2PDoFgxSQeXkiJWyce9eP6X1mgnSPmiCXvfy9X/CUJFTXqLEh4uFoyce kAWitbkk1TuMeFJSTYsaQAEs2vOkgRVC7oFWEkwkSq1Fykr1sZs+MwWjyR5tgSkDJ8Vj treA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=6L4XugqVIefozncL+7/SBmA/ORq/e08syfRoJGil+Zo=; b=Ee4/1wf+Nxt5QxR1E179GTfIRLcdbG5I8HDBn/UAAxpBP1Pm3MPrc026fgjuT6FD1s z4ZMUE3s5pha+oSQYkgeZGmnFidqepapPOU2lYs5FJT+sH71kJmujTFXB8IXBKiOuMsr wZudjofn5GyiQjOHnfZCMHHwQ2tpabEixQ81n9IHtltVMstdmbnWxZD0P0xsaqk2ICyy 15EAxKD6wE4AKBnXBklqu0E8x5HRp2U6uOFRsLC3gti2O9Hq1Efc2wKpxyH6ehK2BeMi P0XPkUuwEtyhzBKVSof+EM9vldcv0stW1RT4RLeQOAAEPaCPRDoVoV1RM8hlsr3MhExO rJsA== X-Gm-Message-State: AIVw110oJGnwJRpB1Y8aA1hL2IFpPSTSP9lF8MhrIKsoYM3Y6cWR8T+A rY4PRJCBbfpttuqiYyU= X-Received: by 10.28.150.142 with SMTP id y136mr9419171wmd.51.1499238912189; Wed, 05 Jul 2017 00:15:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:22 +0200 Message-Id: <1499238885-26161-20-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 19/42] virtio-scsi: finalize IOMMU support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jason Wang After converting to use DMA api for virtio devices, we should use dma_as instead of address_space_memory. Otherwise it won't work if IOMMU is enabled. Fixes: commit 8607f5c3072c ("virtio: convert to use DMA api") Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang Message-Id: <1499170866-9068-1-git-send-email-jasowang@redhat.com> Signed-off-by: Paolo Bonzini --- hw/scsi/virtio-scsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index f46f06d..d076fe7 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -43,12 +43,13 @@ static inline SCSIDevice *virtio_scsi_device_find(VirtI= OSCSI *s, uint8_t *lun) =20 void virtio_scsi_init_req(VirtIOSCSI *s, VirtQueue *vq, VirtIOSCSIReq *req) { + VirtIODevice *vdev =3D VIRTIO_DEVICE(s); const size_t zero_skip =3D offsetof(VirtIOSCSIReq, resp_iov) + sizeof(req->resp_iov); =20 req->vq =3D vq; req->dev =3D s; - qemu_sglist_init(&req->qsgl, DEVICE(s), 8, &address_space_memory); + qemu_sglist_init(&req->qsgl, DEVICE(s), 8, vdev->dma_as); qemu_iovec_init(&req->resp_iov, 1); memset((uint8_t *)req + zero_skip, 0, sizeof(*req) - zero_skip); } --=20 1.8.3.1