From nobody Mon Feb 9 05:44:32 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1655447946; cv=none; d=zohomail.com; s=zohoarc; b=byuQ/9Bwkx5W607/y7niiNrfq83qKpIyuHAAo7JBgzCZFIM3dvEgdc8GJ2QHi/reBlTTQdYiBFgMlU+3KtPDSMm2hEO1dBLUqn/gBqd0DFDdMeDUirPNTy6pxJGA2rlEiCKgfOdqAQhqLng8x8NGjKj3v6S+iSSRO/OEhthIY4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655447946; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=VLKfOlmNOuZjET9NcC9kY6DTrbv15WZ89RYjyjblBxU=; b=VL/eEPakKS2o0YW8Wuw7wRIiLwJTkv2vVCaLgPhg67Z/xb7odx8RisK9fybCpWYPr3+PJ7ob3uNGz5ZoJY1F/I7s3jjBlwqPvzC6vRq3DwloxTCLdLIFmP5FozaECL01+Ek9gUIkAyYZ2sQf2fQhXLQefu9zhufpw1vbRS+kc1Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655447946619259.6623525736064; Thu, 16 Jun 2022 23:39:06 -0700 (PDT) Received: from localhost ([::1]:44614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o25dJ-0006Ds-BW for importer@patchew.org; Fri, 17 Jun 2022 02:39:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o25S9-0001xo-Tr for qemu-devel@nongnu.org; Fri, 17 Jun 2022 02:27:36 -0400 Received: from mga17.intel.com ([192.55.52.151]:8479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o25S6-0000FY-GS for qemu-devel@nongnu.org; Fri, 17 Jun 2022 02:27:32 -0400 Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 23:27:25 -0700 Received: from duan-server-s2600bt.bj.intel.com ([10.240.192.123]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 23:27:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655447250; x=1686983250; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=HHRxCRo8nccqX9iaBtaQsm1tqkBAJ0ZbGoclZYK9GxU=; b=IsGq4hmbbebVRulvxiz7xrf4sl4/WIjiA+ctMF4oxB+C+Y6QWiDnpVOL fCcBNpXSSTRbDF8RAn2kBGR9zLWzb0K2+uMIkrv3yWOJMixKVtkII/51H F7T5nFnAi5MHdrB/hzpGzXMKYzIfYhN8YutTHLw+EwOiqsbFgo/V2VyzR Jb2KXEIAXZqtD7JrCpndGi5FJ8UJBJpGNDp1ehg/nO9+JGJTF7drA7SHT ZMB/GnWTQrOuBgX/5j9tO8IQu87IeABr0xTg9FLArj+SufpH+MJ5CPC0i ZBgd6qFFX1apQ+y/iHxCCIIv3XrLyQfDw1DONznZ4lPjE8JFQOlq9clee Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="259891956" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="259891956" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="641907327" From: Zhenzhong Duan To: qemu-devel@nongnu.org Cc: eric.auger@redhat.com, mst@redhat.com Subject: [PATCH v2] virtio-iommu: Fix the partial copy of probe request Date: Fri, 17 Jun 2022 14:20:24 +0800 Message-Id: <20220617062024.3168331-1-zhenzhong.duan@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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=192.55.52.151; envelope-from=zhenzhong.duan@intel.com; helo=mga17.intel.com X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1655447948607100001 Content-Type: text/plain; charset="utf-8" The structure of probe request doesn't include the tail, this leads to a few field missed to be copied. Currently this isn't an issue as those missed field belong to reserved field, just in case reserved field will be used in the future. Fixes: 1733eebb9e75b ("virtio-iommu: Implement RESV_MEM probe request") Signed-off-by: Zhenzhong Duan Reviewed-by: Eric Auger --- v2: keep bugfix change and drop cleanup change hw/virtio/virtio-iommu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index 7c122ab95780..195f909620ab 100644 --- a/hw/virtio/virtio-iommu.c +++ b/hw/virtio/virtio-iommu.c @@ -708,7 +708,8 @@ static int virtio_iommu_handle_probe(VirtIOIOMMU *s, uint8_t *buf) { struct virtio_iommu_req_probe req; - int ret =3D virtio_iommu_iov_to_req(iov, iov_cnt, &req, sizeof(req)); + int ret =3D virtio_iommu_iov_to_req(iov, iov_cnt, &req, + sizeof(req) + sizeof(struct virtio_iommu_req_tail)); =20 return ret ? ret : virtio_iommu_probe(s, &req, buf); } --=20 2.25.1