Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp98251pxy; Fri, 30 Apr 2021 00:58:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxziXawz09Dg1awud/8OMHKWzEncruHH2xfeN9swCWyFQGkn/n0O9cK0Qwr6+6q052FmQJP X-Received: by 2002:a65:420d:: with SMTP id c13mr3538806pgq.370.1619769529809; Fri, 30 Apr 2021 00:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619769529; cv=none; d=google.com; s=arc-20160816; b=ziVMZrM8IP9dl3l4u45VmxriAE14pudXFUZUecSiNaM2RoOsWFrd0rhJ6KeGUPQI9J TgTcMEa1OV+Sa9osB32dLjKIKSfEwHm9xuYFts5f3x/lm3Tq5fqiewrDwm0CLIOSAPgn 7aGW3WbHA4G8Dl+toSjnemryBZ+mHG+4niF6wjuyguphHxzr32u1Z8UYB/5QkyGKsoao xWYUVlKlcpZZI+09cSVFG0HrD8guK1E7UuZ9oeuQWXlZMdflm0y15rhtc3O/eDIwcz9v V8KCm58RB28m2CpkNXNVNxa/qos4uaF5CnpA0HMZTArEbXntfciHEDsGIaNOckfe2i14 JN5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:date:message-id:cc:to:subject:from; bh=f80X7pbNs2IMCz3yxpiUyPmYcraclmrXpiykj2x477Q=; b=MJGO+dXWuZ1t33BT/7ZDeQiAZeqGfgFwQMRnrtK43li5i2EZR9tbU6XUG3DwPRbUcG J4/w8sOh9UTEG3/MVIXA0BJB7IHDQS3DUWWZKkTQvceGM0bcY08uXYh9W9NLbZT/zbSI eVhmhAB926Qro/glc/5Woj0Iv5RmizJ+g7YWz3WmHSeoESBY32zT5XtEU08KsQTzrnUf NJR7nNimrss6IvqiY1c5m4VwGfU9dwCvfKmsKlG6aCkQGFsgKuAyuzZuJUzx6ep+r8P6 K06purjeBGsTY2CIkgorEiPJchLAGt/BBU+LQHa2qa/E53hse45LvkJ+cI+CjdgX8q7T ziuw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si2536800pla.41.2021.04.30.00.58.36; Fri, 30 Apr 2021 00:58:49 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229768AbhD3H6q (ORCPT + 99 others); Fri, 30 Apr 2021 03:58:46 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:17830 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbhD3H6p (ORCPT ); Fri, 30 Apr 2021 03:58:45 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FWl662qVnzBtGb; Fri, 30 Apr 2021 15:55:26 +0800 (CST) Received: from [127.0.0.1] (10.69.38.196) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Fri, 30 Apr 2021 15:57:47 +0800 From: Yicong Yang Subject: [Question] Indefinitely block in the host when remove the PF driver To: Alex Williamson , , , Linux Kernel Mailing List CC: "Zengtao (B)" , Linuxarm , Yicong Yang Message-ID: Date: Fri, 30 Apr 2021 15:57:47 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.69.38.196] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When I try to remove the PF driver in the host, the process will be blocked if the related VF of the device is added in the Qemu as an iEP. here's what I got in the host: [root@localhost 0000:75:00.0]# rmmod hisi_zip [99760.571352] vfio-pci 0000:75:00.1: Relaying device request to user (#0) [99862.992099] vfio-pci 0000:75:00.1: Relaying device request to user (#10) [...] and in the Qemu: estuary:/$ lspci -tv -[0000:00]-+-00.0 Device 1b36:0008 +-01.0 Device 1af4:1000 +-02.0 Device 1af4:1009 \-03.0 Device 19e5:a251 <----- the related VF device estuary:/$ qemu-system-aarch64: warning: vfio 0000:75:00.1: Bus 'pcie.0' does not support hotplugging qemu-system-aarch64: warning: vfio 0000:75:00.1: Bus 'pcie.0' does not support hotplugging qemu-system-aarch64: warning: vfio 0000:75:00.1: Bus 'pcie.0' does not support hotplugging qemu-system-aarch64: warning: vfio 0000:75:00.1: Bus 'pcie.0' does not support hotplugging [...] The rmmod process will be blocked until I kill the Qemu process. That's the only way if I want to end the rmmod. So my question is: is such block reasonable? If the VF devcie is occupied or doesn't support hotplug in the Qemu, shouldn't we fail the rmmod and return something like -EBUSY rather than make the host blocked indefinitely? Add the VF under a pcie root port will avoid this. Is it encouraged to always add the VF under a pcie root port rather than directly add it as an iEP? Thanks, Yicong