Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1804256pxu; Thu, 8 Oct 2020 23:20:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyQPryBoXBDsWYY3g9JorML4nRFbS1JiLjvn7tb1rWRQ/bA9bVjSfEhMIqvX248SZGOJl/ X-Received: by 2002:a17:906:1b0d:: with SMTP id o13mr12221020ejg.526.1602224458865; Thu, 08 Oct 2020 23:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602224458; cv=none; d=google.com; s=arc-20160816; b=uG+SWxnTPlDF8QwoqwRQpKbQTAdM1l+vWmwQPoo00Z7hC/3twh37Lyw4ve11tIOufC cVhveMUGndWo4nHz0T2PuawYMe7OTffQf12q5Mm7072LQfvh+DnYz/wFpOg+Bg0Lsmfe zy0QmRGv6rt/QCJU6KQg0VFSKgpSWacVaIqOJ96mSarboMEhfdTAOLM29yGCbl4Hk+b8 6QwgC4lJky65YmrBzHIQaJ0L7HyOT8E/+ZnX/Qv3fYciLqf3d7veuPRmxWWWA6s0ORLe hVee8wDZT7gAjvMsJHKu2DTo5dnJPf5jz+r/SwLzwYNF2VoS7eQbWW13w1gAa6DGQDyu xl6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=CeARdKdxXITMJyQg5RZv73lx5offC2uV5GIuBo7fxJ0=; b=p8bI793VPybeFtFOGD1DMbaBfTgDMa5GYxdMQHAMi8CE97z9teW/r293cAcPoPa/CT Lj+/WTlm8mHilFlRK0CWkj5+hw95dsP8cDBifOaNTU3nWQsfGwGSSR6Q69fhDjS0e9xX G3nklvdn2mHDG+B6na1wY27b5eH84JV/MejjFRLVqJzh2baaLyAJ4VLzTpOcl3Wu1GmQ RPRGz5XZvY1wTtPTCwe54lnobW2aXHfHv4XgwKF36RSup2iRrs6AcKCudowKsrcoFbR2 WxXYkDdPY+ujr6NMQVC2hs7IM0HUTnB5AowO1DG28IT2n7NO8d4GRTxPv2KvYrpYNchN RIjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="R/JyMCpH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b26si5450568edw.538.2020.10.08.23.20.35; Thu, 08 Oct 2020 23:20:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="R/JyMCpH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730876AbgJID7y (ORCPT + 99 others); Thu, 8 Oct 2020 23:59:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:21211 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729908AbgJID7y (ORCPT ); Thu, 8 Oct 2020 23:59:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602215993; 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=CeARdKdxXITMJyQg5RZv73lx5offC2uV5GIuBo7fxJ0=; b=R/JyMCpHNsJRJ3dyVsAO7ndV0bUazP5hLPlkjs71ozsilbdbaSkr1nzUHwqONFcdE6YVRq WRwud9876RGGiSxdfJLedGdHTvlaPYRQO+x12ws4D9NkA5vznRMgAvd9ca+qC4OkJY/GgS tYew4ZfS7JcLMXqE6ZttSEQDQ2Zu85k= 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-476-ovPi3MAeMFqZ6s7Ym02ajw-1; Thu, 08 Oct 2020 23:59:52 -0400 X-MC-Unique: ovPi3MAeMFqZ6s7Ym02ajw-1 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 579CB425D7; Fri, 9 Oct 2020 03:59:50 +0000 (UTC) Received: from [10.72.13.133] (ovpn-13-133.pek2.redhat.com [10.72.13.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 013996EF58; Fri, 9 Oct 2020 03:59:17 +0000 (UTC) Subject: Re: [RFC PATCH 18/24] vhost-vdpa: support ASID based IOTLB API To: Eugenio Perez Martin Cc: Michael Tsirkin , Cindy Lu , kvm list , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Miller , lingshan.zhu@intel.com, Harpreet Singh Anand , mhabets@solarflare.com, eli@mellanox.com, Adrian Moreno Zapata , Maxime Coquelin , Stefan Hajnoczi , Stefano Garzarella References: <20200924032125.18619-1-jasowang@redhat.com> <20200924032125.18619-19-jasowang@redhat.com> From: Jason Wang Message-ID: Date: Fri, 9 Oct 2020 11:59:10 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/9/28 下午11:44, Eugenio Perez Martin wrote: >> - u64 iova, u64 size) >> +static int vhost_vdpa_unmap(struct vhost_vdpa *v, >> + struct vhost_iotlb *iotlb, >> + u64 iova, u64 size) >> { >> struct vdpa_device *vdpa = v->vdpa; >> const struct vdpa_config_ops *ops = vdpa->config; >> + u32 asid = (iotlb); >> + >> + if (!iotlb) >> + return -EINVAL; > This should be reorder to check for (!iotlb) before use at `asid = > iotlb_to_asid()`, isn't it? > > Thanks! > Yes, will fix in the next version. Thanks