Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4241322rwl; Mon, 10 Apr 2023 08:08:47 -0700 (PDT) X-Google-Smtp-Source: AKy350YkXsa+DMAuo204zTn/2pTiHxOenoxoVSiTw0tKZZEST1CY4LkGtRAtM0j09V16t1vydK4c X-Received: by 2002:a17:902:9b95:b0:1a1:918e:4129 with SMTP id y21-20020a1709029b9500b001a1918e4129mr12327327plp.30.1681139327156; Mon, 10 Apr 2023 08:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681139327; cv=none; d=google.com; s=arc-20160816; b=g97IWVL6dXwpYhtSanbZH1ZIU9cdSX71jFeb7w9pOuBk3b7Pi2mmoumKd7+zWowQ/t /2gZAz6Xp/2+ywOcsc4b2WKtvIKVJNyPT6/qyxzj7vxIOugYIGUH/X90NtBnbUlOV6xN eRPt44N3yQL5xvJDk68Vyer+ewMC9dpIlBr9ShXwrukPkt7dDRK5l+BiodYovi9xS2nK tqk+T0SAUM8qrfuUVvIC4oSadwMNz23NYOMronOcUBNRYcxXy7kEbCfSPU7kX2Woenxc 3KiOdXhoZ1gWn+5mx74rxPm0ArjCUWCcoLvzX8GHwGlpZEQSlVW6ZeCLcAzUw5/Qa8v4 K//w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=jvoKw5fddC6ImxYUVWRQGjUNBYWemWpfZTmvE3MZouI=; b=wBLL1NqiVDT5OAwvSqrg10SmfDT9JjlJKlC+uXHBpvvZonjSPr3SLRlMsT89Cm/n5N iSoQcvV2SvwXzLwGFcXKKTRcbVZUdM6Dt7djLG4ieVK1t8dc5gEKWn5881ggRTKaX7DZ AewHissMyYUcZW59LKZIWnIJ58mEE3l5xhpPNLqJHzGJEEfZ5FjsP4k3h8lsmHaSd3TM 4wp6cSoJqPCk0UC1NA092a1VWNCrQ2ik+q2ZT5R0t6xArmjlWb+WtMoXNSjv3mzx4PBF svOHfe3LXD7O66U3w9EO7pmf1hKIe+pRWxxl0hyNg6Xw82KQncYrjtzgdL110viS6Tnz JSCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J3fmotMV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a170902f69100b0019e88376e3csi10546583plg.162.2023.04.10.08.08.24; Mon, 10 Apr 2023 08:08:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J3fmotMV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229955AbjDJPC2 (ORCPT + 99 others); Mon, 10 Apr 2023 11:02:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbjDJPC1 (ORCPT ); Mon, 10 Apr 2023 11:02:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B15F4ED3 for ; Mon, 10 Apr 2023 08:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681138904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=jvoKw5fddC6ImxYUVWRQGjUNBYWemWpfZTmvE3MZouI=; b=J3fmotMVTaKvLfCm1xlsbvIHdJPthCs8ZbvDWF7G6Us768W6qSc8KC0vqXvraRlzbRlaUH ztR2he+Fwf0sEx1oFDUIYPxTqDsTxQulg7pkL08PjX4B7x6T4N05ulvAK/loivRVb8gLax 2K9LTtYZLbGn+i+ICdGierb+/hZ8Gcs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-195-6Lhfy9nhOkqSBmrUFiGbxQ-1; Mon, 10 Apr 2023 11:01:41 -0400 X-MC-Unique: 6Lhfy9nhOkqSBmrUFiGbxQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3379E1C0513F; Mon, 10 Apr 2023 15:01:41 +0000 (UTC) Received: from server.redhat.com (ovpn-12-107.pek2.redhat.com [10.72.12.107]) by smtp.corp.redhat.com (Postfix) with ESMTP id D646314171B7; Mon, 10 Apr 2023 15:01:37 +0000 (UTC) From: Cindy Lu To: lulu@redhat.com, jasowang@redhat.com, mst@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org Subject: [PATCH] vhost_vdpa: fix unmap process in no-batch mode Date: Mon, 10 Apr 2023 23:01:30 +0800 Message-Id: <20230410150130.837691-1-lulu@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While using the no-batch mode, the process will not begin with VHOST_IOTLB_BATCH_BEGIN, so we need to add the VHOST_IOTLB_INVALIDATE to get vhost_vdpa_as, the process is the same as VHOST_IOTLB_UPDATE Signed-off-by: Cindy Lu --- drivers/vhost/vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 7be9d9d8f01c..32636a02a0ab 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -1074,6 +1074,7 @@ static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, u32 asid, goto unlock; if (msg->type == VHOST_IOTLB_UPDATE || + msg->type == VHOST_IOTLB_INVALIDATE || msg->type == VHOST_IOTLB_BATCH_BEGIN) { as = vhost_vdpa_find_alloc_as(v, asid); if (!as) { -- 2.34.3