Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp830551ybn; Tue, 24 Sep 2019 10:08:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZfJhQg6Hbh+1odkApyb2lycsKDz/DGWBx5iJ34VKU//ckiMj1V33w0SQTbTka4nRwqGpQ X-Received: by 2002:a17:906:7048:: with SMTP id r8mr3493473ejj.101.1569344930656; Tue, 24 Sep 2019 10:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569344930; cv=none; d=google.com; s=arc-20160816; b=X5xbCfPdfrK1x9EatQC6tFz/fw2pvsyp4gFKqJ6oNi/Fkr3FvP91NjDJqeFV+2PkJb S5Q/W5u29nag8p78cfNlQRgQzj9GPFBTwSqpxbyfQm9bTZP6efdWTYNnUsRgklufmhEn 4X98F1yqlWPcMPN38bdG5YGLfcjz2v0UCsJOsrQB63+3DWQ8j3MGeBhhwQwDZBoDh7z5 2Ip5HIXfkkfQGCcEx6xD+CGkDfl0vv0Y0SkFzdPJ7lfVrT92T07zU+mIK1r22zJWzuue A+zjG9aUuZXt9+FHniHbUm1HKXE4oK4RztWXTvuz2PnNGINn65jBdHv/1t84FaZ/Rg37 z6fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Ct3xa266wyxHJytYg3Jqc6Uz5k20Q/FthlP3nJHhVjs=; b=Ljfka8OzehjxQ3nv/XpfsjwCZq50Qwgc7x6wlJVdOToZIeUmG1lK9zwmjR9yCSjXCW v6glVt0qXaluTWrEXXc30i5Ms8YpTjqfn6yYxIt7NyJQf69EfBsHDgC8Y7RiTzNm0UH5 UlJmTMS3n3Zf6Xc+XbYnwy864lnszmVKCDx6aO0Joq8ZMx1Hg/l06HAa0UkaFCQyXmiB oCW4OKNjIgDz0P1WdaAyNXfxt3j/CDG9i6Jr2nhLKWgJYjZxoPk8yCgT9w7Dmq6ZP2Wn AAk8sgUNr3uIhfX4d8sxXSGcCmxb3i6u/bGWOpUp9dkkl6qI7fHgEh6a7gAx/0xmS92r z+sw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19si1205479ejy.353.2019.09.24.10.08.16; Tue, 24 Sep 2019 10:08:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439388AbfIWNGM (ORCPT + 99 others); Mon, 23 Sep 2019 09:06:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58456 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395068AbfIWNGK (ORCPT ); Mon, 23 Sep 2019 09:06:10 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E21F220E4; Mon, 23 Sep 2019 13:06:09 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-12-93.pek2.redhat.com [10.72.12.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42FEC1001B00; Mon, 23 Sep 2019 13:05:34 +0000 (UTC) From: Jason Wang To: kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, kwankhede@nvidia.com, alex.williamson@redhat.com, mst@redhat.com, tiwei.bie@intel.com Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, cohuck@redhat.com, maxime.coquelin@redhat.com, cunming.liang@intel.com, zhihong.wang@intel.com, rob.miller@broadcom.com, xiao.w.wang@intel.com, haotian.wang@sifive.com, zhenyuw@linux.intel.com, zhi.a.wang@intel.com, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, airlied@linux.ie, daniel@ffwll.ch, farman@linux.ibm.com, pasic@linux.ibm.com, sebott@linux.ibm.com, oberpar@linux.ibm.com, heiko.carstens@de.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, akrowiak@linux.ibm.com, freude@linux.ibm.com, lingshan.zhu@intel.com, idos@mellanox.com, eperezma@redhat.com, lulu@redhat.com, parav@mellanox.com, Jason Wang Subject: [PATCH 5/6] vringh: fix copy direction of vringh_iov_push_kern() Date: Mon, 23 Sep 2019 21:03:30 +0800 Message-Id: <20190923130331.29324-6-jasowang@redhat.com> In-Reply-To: <20190923130331.29324-1-jasowang@redhat.com> References: <20190923130331.29324-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 23 Sep 2019 13:06:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We want to copy from iov to buf, so the direction was wrong. Signed-off-by: Jason Wang --- drivers/vhost/vringh.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 08ad0d1f0476..a0a2d74967ef 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -852,6 +852,12 @@ static inline int xfer_kern(void *src, void *dst, size_t len) return 0; } +static inline int kern_xfer(void *dst, void *src, size_t len) +{ + memcpy(dst, src, len); + return 0; +} + /** * vringh_init_kern - initialize a vringh for a kernelspace vring. * @vrh: the vringh to initialize. @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, const void *src, size_t len) { - return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern); + return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer); } EXPORT_SYMBOL(vringh_iov_push_kern); -- 2.19.1