Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp7503pxv; Thu, 24 Jun 2021 01:15:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8Vh4B8DRI7HsZF/M1sTpBlbh1p2hzUXqaV1f8+hcAoqSDa5HqY6yNMIlFLR0NnRqy5kaF X-Received: by 2002:a05:6402:1e8c:: with SMTP id f12mr5399954edf.169.1624522534611; Thu, 24 Jun 2021 01:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624522534; cv=none; d=google.com; s=arc-20160816; b=w+UfhJk/txY0sDnYckttDPN8FZCapblCb/8Rrq99Ua1hIJWia7yaB8pXKAlATbD9Cn Q+9m5KtCuuybYhAW9eioj2GcLLgLNi1kEAWj1tk9mp68bOvbCQ6T6hbpD/K3ZCg0SweY mLVfHGdd/3zx7rnsOq1w8JsKlzMzBjR9U8hJclsNsTq2AHTUPSPT+WSVHQO818r8qYhy wiBp3l8k4pId2NMp3AoU6H+Wj7u0FEVn32fIGPeJ3XrDKfl5Rj4DvqdXIJaVSUXM5M28 NH2/kaEAeaiB1569gBzzZ7N1hqCwrcEPhC6G+dgYTmnmCSHZfQ6CNN6Scfu84TkTUng2 qZMQ== 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=QgEPrtgYrjYyuikepQ643R5m9hvqjjuW2YQFdqmgfAI=; b=SZZrM4kPmOwGbx6MU175N3kRjTa56RN1SPsmTwNepmrK/mToICi+5SrLzb8zivVVJD u5Z2RSfCmH5WT8ihUjleQI943tymCTMIIo4Fny0Tuu62wEVVJDcm/ox+rtYu787gfJ55 OO9AEF4FBzONekCDJojECKjYez55IqRJdPo62WuEIblNF0BgP9dqgkYuAragrG6y4mSD 58rVoe6jy+p++lB76hnU6XYKziHheQi+2HWFeSdHHmM0ZxO8sTJQI9CS3j4Xjc6SIb9M 93/3Nwwsdc6vEWakIMSrcgn7ycFNvsv2dbyr6jsfDfJblbt9vIdoneqVJIw2suXmM3S0 CRGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QV+7Vf1b; 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 y13si2429326edq.315.2021.06.24.01.15.12; Thu, 24 Jun 2021 01:15:34 -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=QV+7Vf1b; 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 S231878AbhFXIQb (ORCPT + 99 others); Thu, 24 Jun 2021 04:16:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57326 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231713AbhFXIQb (ORCPT ); Thu, 24 Jun 2021 04:16:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624522452; 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=QgEPrtgYrjYyuikepQ643R5m9hvqjjuW2YQFdqmgfAI=; b=QV+7Vf1bjADbDhiG+TM4uM7zGPbLLFVmHTCmCa8JNrz4YQUTPAvkO5233621FjkYO24ZUW Yti420ybLptWcqXtRqPUWP9zc/PDKYFpnYN0ei+Y+Y4n5n9Cf41AenOeA5oK9OMkUtVHn/ Lp85ENJoTFLpGGz9plg0aFp/4DsRSIg= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-544-_DF_aDVvOPGjbqnievFYHg-1; Thu, 24 Jun 2021 04:14:11 -0400 X-MC-Unique: _DF_aDVvOPGjbqnievFYHg-1 Received: by mail-pg1-f200.google.com with SMTP id j17-20020a63cf110000b0290226eb0c27acso3014761pgg.23 for ; Thu, 24 Jun 2021 01:14:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=QgEPrtgYrjYyuikepQ643R5m9hvqjjuW2YQFdqmgfAI=; b=XkDOK931VuAkaf9ZvonOKJJWX7qngAZBw03Y9KaKqc0kMAX2pVmrloVvcKpJ09h81I Gck8449NJ7cBIu1OpVySUqHO2HBg8G6oes7BGGPsjPqkukQCzQ8eKL45tqSO0AXoCcdt 4CHmz0DNBMlEskjG96u1w30rI7sS5/lh/BJKNBrugQR3b6wtOTFy9YrFsFjRwxsrEgz9 gb2qm5Ltqk9e5ZDf0Qyp5CaUs13LCsrUiXNUKyGgIWUK+veWpmU39lJD5iEXlWJMF03n 9QZ38xP1OF0TbIET9Jtzt2Au4FoQJmEU+L6nvFfmAcisF42nlmc03xjmED8kVXa4BWvO MhUg== X-Gm-Message-State: AOAM533IIJ6yXjvzw/Mi9+v1sOLEc7pjltBhQW8fJhbqvAOxvnO+cwsg 69JHTSogr571ptCVCjAARSQrzA98LZC0i//fStEv6SnLDWROKNR2rb74pJKjcHI2Y56uBUHLaPG 3nCWTsg/gQ3nGU2PpBPDugGztev3XQrL5JTJ+EfQyFZIIf8xHHuB8svNhGdkEH5QLasji6yifVf nk X-Received: by 2002:a63:e04e:: with SMTP id n14mr3633712pgj.324.1624522449662; Thu, 24 Jun 2021 01:14:09 -0700 (PDT) X-Received: by 2002:a63:e04e:: with SMTP id n14mr3633666pgj.324.1624522449288; Thu, 24 Jun 2021 01:14:09 -0700 (PDT) Received: from wangxiaodeMacBook-Air.local ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id v21sm2129727pfu.77.2021.06.24.01.14.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jun 2021 01:14:08 -0700 (PDT) Subject: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace To: Yongji Xie Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , Stefano Garzarella , Parav Pandit , Christoph Hellwig , Christian Brauner , Randy Dunlap , Matthew Wilcox , Al Viro , Jens Axboe , bcrl@kvack.org, Jonathan Corbet , =?UTF-8?Q?Mika_Penttil=c3=a4?= , Dan Carpenter , joro@8bytes.org, Greg KH , songmuchun@bytedance.com, virtualization , netdev@vger.kernel.org, kvm , linux-fsdevel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel References: <20210615141331.407-1-xieyongji@bytedance.com> <20210615141331.407-10-xieyongji@bytedance.com> <1bba439f-ffc8-c20e-e8a4-ac73e890c592@redhat.com> <0aeb7cb7-58e5-1a95-d830-68edd7e8ec2e@redhat.com> From: Jason Wang Message-ID: <48cab125-093b-2299-ff9c-3de8c7c5ed3d@redhat.com> Date: Thu, 24 Jun 2021 16:13:56 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2021/6/24 下午12:46, Yongji Xie 写道: >> So we need to deal with both FEATURES_OK and reset, but probably not >> DRIVER_OK. >> > OK, I see. Thanks for the explanation. One more question is how about > clearing the corresponding status bit in get_status() rather than > making set_status() fail. Since the spec recommends this way for > validation which is done in virtio_dev_remove() and > virtio_finalize_features(). > > Thanks, > Yongji > I think you can. Or it would be even better that we just don't set the bit during set_status(). I just realize that in vdpa_reset() we had: static inline void vdpa_reset(struct vdpa_device *vdev) {         const struct vdpa_config_ops *ops = vdev->config;         vdev->features_valid = false;         ops->set_status(vdev, 0); } We probably need to add the synchronization here. E.g re-read with a timeout. Thanks