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=-8.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=unavailable 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 342E1C4338F for ; Wed, 4 Aug 2021 08:54:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6EBD60EE9 for ; Wed, 4 Aug 2021 08:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236806AbhHDIy1 (ORCPT ); Wed, 4 Aug 2021 04:54:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36766 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236771AbhHDIy0 (ORCPT ); Wed, 4 Aug 2021 04:54:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628067254; 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=JEJS6wNFWZnl108KgJLIgK1xlv8/2mIWHkixRJuOciE=; b=WDsLGIXcQBI4Ril5/9VQX1fkPJ/grCepT7vlIrTdAtQ4UOEBu7b11hn2L6Brgxjp06R5YM NH3mWRnF7KhWaX7EJFxj0aardBJ2gCIl/2quHVxREqQghsfd+uNtMO+YrJBk9Dn+k+U8Ch o2LLrPScCMILps+Y3Dyl5BMovQI6ifU= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-qWzRc0gcMhegEmMLvXDwmw-1; Wed, 04 Aug 2021 04:54:13 -0400 X-MC-Unique: qWzRc0gcMhegEmMLvXDwmw-1 Received: by mail-pl1-f199.google.com with SMTP id u2-20020a170902e5c2b029012cb0f6543aso1655375plf.3 for ; Wed, 04 Aug 2021 01:54:13 -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=JEJS6wNFWZnl108KgJLIgK1xlv8/2mIWHkixRJuOciE=; b=RWitcWMiNOl3uOZ6gEyPq/Qn4ROyjGTS3xNvchBolbqE9r/KwnH/eERjgyqNOvewdv lYVXoIiS2kNGteTyd56Wu2KhPsw0/YXFnUtRBmjguk5HnGTGM26ygib1oc+j+XGMu0er NODYJweL5rEVJjmkbrrRwCcnPASfftRJW9Mt/DZT8tzgH1zLiWrgo+xHdTkp1Vr1bY92 mydsLFPkUL/CHNXxE1cqCqbw+lWwHpkVxADoZ2njOYsvGT0Ay61y58CdUJdgZt614SoP h7KrtIBbqFinuDcEkhUscbWDkE3abWvoL1MAuH5zaB/1zCPAo6rF2sSUHV92JmyVVmZD +HBg== X-Gm-Message-State: AOAM530U7OkUo3bKLt+Ia8gbHQPyC8JDpW4hdeIfugsf54CWQkZXAQkv Lyh1Lw264CWl6YqrcraODwliacSNElxx5GwxuxR5zC0tmSKCOoZW8qCAkWg6WcMrlIPBpt2OSK3 EUzRp7cIGPLFQvNQloYF1rAFVgoXUcYaVBQdqDpKN2B3vbGZZVaICivCfjFdAPmztNTTv/6BkLe ec X-Received: by 2002:a17:90a:f486:: with SMTP id bx6mr26967703pjb.26.1628067251961; Wed, 04 Aug 2021 01:54:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdg7DPc1fVvfeRYsMAj9zuHXHxH4WMFyt0BnuNiFR52VmL83Bg8evPgUiXWSZNAPGcbnx9HQ== X-Received: by 2002:a17:90a:f486:: with SMTP id bx6mr26967649pjb.26.1628067251626; Wed, 04 Aug 2021 01:54:11 -0700 (PDT) Received: from wangxiaodeMacBook-Air.local ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id 6sm1963202pfg.108.2021.08.04.01.54.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Aug 2021 01:54:11 -0700 (PDT) Subject: Re: [PATCH v10 10/17] virtio: Handle device reset failure in register_virtio_device() 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 , He Zhe , Liu Xiaodong , Joe Perches , songmuchun@bytedance.com, virtualization , netdev@vger.kernel.org, kvm , linux-fsdevel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel References: <20210729073503.187-1-xieyongji@bytedance.com> <20210729073503.187-11-xieyongji@bytedance.com> <6bb6c689-e6dd-cfa2-094b-a0ca4258aded@redhat.com> From: Jason Wang Message-ID: Date: Wed, 4 Aug 2021 16:54:02 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.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/8/4 下午4:50, Yongji Xie 写道: > On Wed, Aug 4, 2021 at 4:32 PM Jason Wang wrote: >> >> 在 2021/8/3 下午5:38, Yongji Xie 写道: >>> On Tue, Aug 3, 2021 at 4:09 PM Jason Wang wrote: >>>> 在 2021/7/29 下午3:34, Xie Yongji 写道: >>>>> The device reset may fail in virtio-vdpa case now, so add checks to >>>>> its return value and fail the register_virtio_device(). >>>> So the reset() would be called by the driver during remove as well, or >>>> is it sufficient to deal only with the reset during probe? >>>> >>> Actually there is no way to handle failure during removal. And it >>> should be safe with the protection of software IOTLB even if the >>> reset() fails. >>> >>> Thanks, >>> Yongji >> >> If this is true, does it mean we don't even need to care about reset >> failure? >> > But we need to handle the failure in the vhost-vdpa case, isn't it? Yes, but: - This patch is for virtio not for vhost, if we don't care virtio, we can avoid the changes - For vhost, there could be two ways probably: 1) let the set_status to report error 2) require userspace to re-read for status It looks to me you want to go with 1) and I'm not sure whether or not it's too late to go with 2). Thanks > > Thanks, > Yongji >