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.1 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 3FC7DC433E0 for ; Wed, 5 Aug 2020 02:16:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CCEA20842 for ; Wed, 5 Aug 2020 02:16:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="I3cB4OgR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgHECQg (ORCPT ); Tue, 4 Aug 2020 22:16:36 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:21989 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726799AbgHECQe (ORCPT ); Tue, 4 Aug 2020 22:16:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596593793; 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=HIaIax/zR4vv8fiWp11anUcThIo6Y4H4WRFdeKCBt5s=; b=I3cB4OgR0uiS7nNFOdBEW0cE/tYcnGyPOaRsLKnJ9hndFUjZfPVaRC1AHKmqAZ2ItdoVLq stGKp0iUzmNf9iP78zpXZSGGKC/mShH6QvEarsryGI9gOSv6pQud0KOzLU9OYuYpYSYELl r59PRRlSzMTXAj0qZsAJn4wjVa6YE0I= 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-66-AV2FqgRGPRKYsArtpv6xzg-1; Tue, 04 Aug 2020 22:16:29 -0400 X-MC-Unique: AV2FqgRGPRKYsArtpv6xzg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 275A110059A2; Wed, 5 Aug 2020 02:16:28 +0000 (UTC) Received: from [10.72.13.71] (ovpn-13-71.pek2.redhat.com [10.72.13.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0C3069318; Wed, 5 Aug 2020 02:16:18 +0000 (UTC) Subject: Re: [PATCH V5 1/6] vhost: introduce vhost_vring_call To: "Michael S. Tsirkin" Cc: "Zhu, Lingshan" , alex.williamson@redhat.com, pbonzini@redhat.com, sean.j.christopherson@intel.com, wanpengli@tencent.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, eli@mellanox.com, shahafs@mellanox.com, parav@mellanox.com References: <20200731065533.4144-1-lingshan.zhu@intel.com> <20200731065533.4144-2-lingshan.zhu@intel.com> <5e646141-ca8d-77a5-6f41-d30710d91e6d@redhat.com> <156b8d71-6870-c163-fdfa-35bf4701987d@redhat.com> <20200804052050-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: <14fd2bf1-e9c1-a192-bd6c-f1ee5fd227f6@redhat.com> Date: Wed, 5 Aug 2020 10:16:16 +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: <20200804052050-mutt-send-email-mst@kernel.org> 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.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 2020/8/4 下午5:21, Michael S. Tsirkin wrote: >>>>>   +struct vhost_vring_call { >>>>> +    struct eventfd_ctx *ctx; >>>>> +    struct irq_bypass_producer producer; >>>>> +    spinlock_t ctx_lock; >>>> It's not clear to me why we need ctx_lock here. >>>> >>>> Thanks >>> Hi Jason, >>> >>> we use this lock to protect the eventfd_ctx and irq from race conditions, >> We don't support irq notification from vDPA device driver in this version, >> do we still have race condition? >> >> Thanks > Jason I'm not sure what you are trying to say here. I meant we change the API from V4 so driver won't notify us if irq is changed. Then it looks to me there's no need for the ctx_lock, everyhing could be synchronized with vq mutex. Thanks > >