Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp281511pxx; Wed, 28 Oct 2020 04:57:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkhfV+lmDTuIArhMJDqQ/jveHt/ANVZw+mxex/JUzddZaPdsD++h6bBqI8VUZdWoc0GXbB X-Received: by 2002:aa7:d28a:: with SMTP id w10mr7368339edq.192.1603886220076; Wed, 28 Oct 2020 04:57:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603886220; cv=none; d=google.com; s=arc-20160816; b=rlMVMriGmC8hvszVqKGUBcW7l4jEK7PckFsjZb1bLSlpUCoRBQZK9V20pO32ttrB89 076TvHtRlj2Fwiahzn6UXlwQN68S7Y+SRxtFkHd6GIPAjzl0sHB5aY9HN0wHVRPB3WhF qJn5p7hX1FX+vm1UK0+bV03Ed92uotjV/jDsB3VchnpCGaaVuNAhany21UYzAMqjeo/j 4zJgG8L/VLDngFH8gOBcWiMpiDEH+XMY9UpgREa2bnlNoF6KA7FBgWfD7/R5iXmwRnRY SKNobYQfl3louhhng2O7U9EVqBpjaXyWsl8mALmV8dIdbmb294s6TDuGrJzrV0uFh8EE oUuA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Lv4iXVnp878Urp/au9iGzwDOHQuuJkJqSEjGEqPcVp8=; b=CAAXluNLG+qBhFGwW7ENzCVpky2OebpHFA/pys+jmTHgWouwgS+dLcTxoHGDd+QkPO Y80J2XknHCpPndWEwVbIM4HsR/ZLbUDgQodK4xQ8BwP0G0/yDGGxRJmz4MWHXnH0sghv WwrTZbbm6UViggMQMdG2M/l47/3kVNgwMVYmgDGg8iRoc3eATFek+vQ0yOlspX9ONSyA y/ctSOHMU+m4HdbE1k0hBGAbLAVwHexnGlQws0vm9YEu+Grmqud00CtVq44u/qAf8kvG Wq6w9KpNn9jVeLCzKj7nTOA6XrC3c8Xhe/1cRfHL6mvO70TTvKGYfxoPGBeNrInT0Sl3 YAKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gwgP0klY; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si3663191edn.100.2020.10.28.04.56.38; Wed, 28 Oct 2020 04:57:00 -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=@kernel.org header.s=default header.b=gwgP0klY; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794876AbgJ0POG (ORCPT + 99 others); Tue, 27 Oct 2020 11:14:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:42900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1793709AbgJ0PH5 (ORCPT ); Tue, 27 Oct 2020 11:07:57 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DFCD7206F4; Tue, 27 Oct 2020 15:07:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811275; bh=ioN8SjQ1dFIQceqdVFeNAj/70KdTxlSPJglqQVWuGZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gwgP0klYdPdFKW6bSaO3whRKYOLfiXkR2SmqEERgykjg6fGYAF9ss/BQn1wAK00Be duxtxf1JFWR0ta6yOZHlz8HZvTdWF/b6F0OunBILReQAD9O7gv3H12qLHUyMpOvt1D TXKijqMCvpvfXVc0JwicYGHnn0T07Vu2BMlkvvz8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Rosato , Bjorn Helgaas , Alex Williamson , Sasha Levin Subject: [PATCH 5.8 435/633] PCI/IOV: Mark VFs as not implementing PCI_COMMAND_MEMORY Date: Tue, 27 Oct 2020 14:52:58 +0100 Message-Id: <20201027135543.127074008@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Rosato [ Upstream commit 12856e7acde4702b7c3238c15fcba86ff6aa507f ] For VFs, the Memory Space Enable bit in the Command Register is hard-wired to 0. Add a new bit to signify devices where the Command Register Memory Space Enable bit does not control the device's response to MMIO accesses. Fixes: abafbc551fdd ("vfio-pci: Invalidate mmaps and block MMIO access on disabled memory") Signed-off-by: Matthew Rosato Acked-by: Bjorn Helgaas Signed-off-by: Alex Williamson Signed-off-by: Sasha Levin --- drivers/pci/iov.c | 1 + include/linux/pci.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index b37e08c4f9d1a..4afd4ee4f7f04 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -180,6 +180,7 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id) virtfn->device = iov->vf_device; virtfn->is_virtfn = 1; virtfn->physfn = pci_dev_get(dev); + virtfn->no_command_memory = 1; if (id == 0) pci_read_vf_config_common(virtfn); diff --git a/include/linux/pci.h b/include/linux/pci.h index 34c1c4f45288f..1bc3c020672fd 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -439,6 +439,7 @@ struct pci_dev { unsigned int is_probed:1; /* Device probing in progress */ unsigned int link_active_reporting:1;/* Device capable of reporting link active */ unsigned int no_vf_scan:1; /* Don't scan for VFs after IOV enablement */ + unsigned int no_command_memory:1; /* No PCI_COMMAND_MEMORY */ pci_dev_flags_t dev_flags; atomic_t enable_cnt; /* pci_enable_device has been called */ -- 2.25.1