From nobody Tue Apr 30 05:03:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559676592; cv=none; d=zoho.com; s=zohoarc; b=Y6dhMe9Gx7i4IzN7fu0SnGo0huJNmO9LhcECnsMlY93p1fYPOAI9Q8hURKoln1HyF1CuhGhjdLiDBiRsPSqnJ2h455OvJrvuPmWWto+qAVhem17sQ96SuKWL5iPRW+KOo/yXmWX+tfL5ZrnyH5OvSpcz3aXdWihsakSteuCaOrw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559676592; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=C4Ug5HiZEEb0yiBtI2blhXJKvvxiVMHT3xvNz+GbAp4=; b=bYRrv4Yn397lhkNtrJdyqy+RFg6NEhbwZK3SzYuCspI20d8SS10yCESDk8tIlAPKbo2XJfjyAmwPvkfsiQOB7vPwEywbNll3MG710r2EaEuJ4CUgSdTod28ttQXt0MQNrOdtzPG7jJq5c64pBzOr+AiFaCbht5jtNdXUSc5jrAw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559676592000223.56175098614096; Tue, 4 Jun 2019 12:29:52 -0700 (PDT) Received: from localhost ([127.0.0.1]:56934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYF7r-0003XL-N1 for importer@patchew.org; Tue, 04 Jun 2019 15:29:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYF6p-0003D1-Ez for qemu-devel@nongnu.org; Tue, 04 Jun 2019 15:28:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYF6o-00078y-Hz for qemu-devel@nongnu.org; Tue, 04 Jun 2019 15:28:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60418) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hYF6o-0006Qm-Br for qemu-devel@nongnu.org; Tue, 04 Jun 2019 15:28:34 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 02A294ACDF; Tue, 4 Jun 2019 19:28:20 +0000 (UTC) Received: from gimli.home (ovpn-116-22.phx2.redhat.com [10.3.116.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E84A60FD5; Tue, 4 Jun 2019 19:28:16 +0000 (UTC) From: Alex Williamson To: qemu-devel@nongnu.org Date: Tue, 04 Jun 2019 13:28:16 -0600 Message-ID: <155967644964.13849.2755992114077073414.stgit@gimli.home> User-Agent: StGit/0.19-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 04 Jun 2019 19:28:25 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] vfio/pci: Hide Resizable BAR capability X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.williamson@redhat.com, James Courtier-Dutton Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The resizable BAR capability is currently exposed read-only from the kernel and we don't yet implement a protocol for virtualizing it to the VM. Exposing it to the guest read-only introduces poor behavior as the guest has no reason to test that a control register write is accepted by the hardware. This can lead to cases where the guest OS assumes the BAR has been resized, but it hasn't. This has been observed when assigning AMD Vega GPUs. Note, this does not preclude future enablement of resizable BARs, but it's currently incorrect to expose this capability as read-only, so better to not expose it at all. Reported-by: James Courtier-Dutton Tested-by: James Courtier-Dutton Signed-off-by: Alex Williamson --- hw/vfio/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 8e555db12ec0..948e7aac5b0b 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2118,6 +2118,7 @@ static void vfio_add_ext_cap(VFIOPCIDevice *vdev) case 0: /* kernel masked capability */ case PCI_EXT_CAP_ID_SRIOV: /* Read-only VF BARs confuse OVMF */ case PCI_EXT_CAP_ID_ARI: /* XXX Needs next function virtualization= */ + case PCI_EXT_CAP_ID_REBAR: /* Can't expose read-only */ trace_vfio_add_ext_cap_dropped(vdev->vbasedev.name, cap_id, ne= xt); break; default: