From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45CFEC433ED for ; Fri, 16 Apr 2021 03:24:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC2EE6113D for ; Fri, 16 Apr 2021 03:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237775AbhDPDZE (ORCPT ); Thu, 15 Apr 2021 23:25:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46635 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234973AbhDPDZE (ORCPT ); Thu, 15 Apr 2021 23:25:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618543480; 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=y2eoMDNZ7KhFTHyXgnjh9cYB2las6pMgIII6CMe3Tt4=; b=OupOO/Z5hbgQJeJe9mLQ2xdWHk5kxtO0u/YLb0xxbl+sgM6Fm/8PH5wQtqCfIzhWmQ5n8H IjakGIbKwE+mfCNDzHpK7RkDK2PpDBTqNL+Co6VFFLvoolWzv/T6fy5oHHdBCmbqqvc1SK qae1rpZk2j9/KTmJIB8Tq52DdWb+O5E= 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-497-aChSZ2eYPcWkYTo_ixynCg-1; Thu, 15 Apr 2021 23:24:38 -0400 X-MC-Unique: aChSZ2eYPcWkYTo_ixynCg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B9916501FB; Fri, 16 Apr 2021 03:24:35 +0000 (UTC) Received: from wangxiaodeMacBook-Air.local (ovpn-13-140.pek2.redhat.com [10.72.13.140]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2EA1518B42; Fri, 16 Apr 2021 03:24:20 +0000 (UTC) Subject: Re: [PATCH v6 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace To: Xie Yongji , mst@redhat.com, stefanha@redhat.com, sgarzare@redhat.com, parav@nvidia.com, hch@infradead.org, christian.brauner@canonical.com, rdunlap@infradead.org, willy@infradead.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, bcrl@kvack.org, corbet@lwn.net, mika.penttila@nextfour.com, dan.carpenter@oracle.com Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20210331080519.172-1-xieyongji@bytedance.com> <20210331080519.172-10-xieyongji@bytedance.com> From: Jason Wang Message-ID: <87a54b5e-626d-7e04-93f4-f59eddff9947@redhat.com> Date: Fri, 16 Apr 2021 11:24:19 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <20210331080519.172-10-xieyongji@bytedance.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org ÔÚ 2021/3/31 ÏÂÎç4:05, Xie Yongji дµÀ: > + } > + case VDUSE_INJECT_VQ_IRQ: > + ret = -EINVAL; > + if (arg >= dev->vq_num) > + break; > + > + ret = 0; > + queue_work(vduse_irq_wq, &dev->vqs[arg].inject); > + break; One additional note: Please use array_index_nospec() for all vqs[idx] access where idx is under the control of userspace to avoid potential spectre exploitation. Thanks