Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1349245pxk; Thu, 10 Sep 2020 13:11:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5I8rgUGQscC26Faj1897ubReLm/6lA91Hm6okuCfJnFeyHh6FLFxkHpVFfhK7TF6LxEZf X-Received: by 2002:a17:906:b47:: with SMTP id v7mr10260881ejg.310.1599768710883; Thu, 10 Sep 2020 13:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599768710; cv=none; d=google.com; s=arc-20160816; b=kOEROjeeYWn0s6VXxY8oygncx9RhzCwofDwLgZYbm6ZljcBQ2kKsqv5BqSZ1mMsuaM IRP5v2HmOQpu3tLvSzO4QzuIw3DS+wUrqJz1iSsUzIlQ0TgwG3lawlK+g2X6WiD0i78b vmHrpFLw7Ird00GgeIbHOo5FDjI6YFNd/sE9ry4BmbBb1nftoicofWdxPGRjN2qGRU7M wE4kFp3yGtE5KNy9DaEbiS2UyKNcQOM+FrHR6RhDxlJGJjLk3hS80pnaFeRlVdnyP39U NiXEhbGCb8VmUobLdhBlOEm6zAN/TEcyQJ3QhT69jtLBJ649JAqYxVI766NG5owzOep2 cybA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=+OUmHMAzekDWnfUWHy+QvXx0etSZ8Wq/8Ekd3eDbQ+M=; b=GdCII6PRy0pyQpDbY5lR55ie07XPJ+/wEBJ4Z3xNFn+PZRyLi2tAOIzPzF+3wNefpl kA/ISGk+MZOy6NdA9m0343y7vd5TujPJxwcAM3Zue6PqGaFRpwWgjMhDHmhulWMcIWrL 1uiVw9CHm8rPy53VKXhscvwRvoUEqIHLOq3niSNe1kyhDb13hsOOoWWELevgoic21FHw MYsi1lZmNgILDxm7kAxLNlDNnLkUVdfudjwI05y8COZibq4gbihBFxRYk51HLFREH+Xb R1w6vkR0QmtPjQeFQDc4JclBNys+jGCYDS6HOsZ85XKgr0ocQUSrVJbl4bJ/q8OES+wt ECzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=tAiMT4Wz; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mb10si4246393ejb.35.2020.09.10.13.11.28; Thu, 10 Sep 2020 13:11:50 -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=@ibm.com header.s=pp1 header.b=tAiMT4Wz; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbgIJUKn (ORCPT + 99 others); Thu, 10 Sep 2020 16:10:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50270 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730854AbgIJPAR (ORCPT ); Thu, 10 Sep 2020 11:00:17 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08AEj6vj187669; Thu, 10 Sep 2020 11:00:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=pp1; bh=+OUmHMAzekDWnfUWHy+QvXx0etSZ8Wq/8Ekd3eDbQ+M=; b=tAiMT4WzrMUI13Hc4ew/XyEGMJCdvtYvfWWT1oVWREzC+2BXsqPo/bfkJktX0QngcePF svtBxfmofu8nZYK9KwxkHtT6jJ4KMwNdL51+aq7xsYNwJGxOtpyrA5s5YRF4pAnYyYBD XDa05luz0NuHFN979/r3CH1lxhGLOGolmr/P9f9NGLn7zu1J/qhTNMoKSNeCv6fELhto aeRCDEx70fvrmA6oTT9p+DzztoQvrXJZflkGf1/2wIfa7Leaho6nEj14VFQd7el4qeCx jmYHHnRFSpxyUP2ZGpUVvGGAs9o66Xh76moXSxxNH6D/7DO6yKR9CcN1/AvNYbxbnZBH yw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33fp698ex9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Sep 2020 11:00:08 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08AEk6Sb190560; Thu, 10 Sep 2020 11:00:07 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 33fp698eve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Sep 2020 11:00:07 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08AEqW13018133; Thu, 10 Sep 2020 15:00:06 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02dal.us.ibm.com with ESMTP id 33c2a9t8g5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Sep 2020 15:00:05 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08AF04Rb53346702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Sep 2020 15:00:04 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 362EC78069; Thu, 10 Sep 2020 15:00:04 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC0167807B; Thu, 10 Sep 2020 15:00:02 +0000 (GMT) Received: from oc4221205838.ibm.com (unknown [9.211.91.207]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 10 Sep 2020 15:00:02 +0000 (GMT) From: Matthew Rosato To: alex.williamson@redhat.com, bhelgaas@google.com Cc: schnelle@linux.ibm.com, pmorel@linux.ibm.com, mpe@ellerman.id.au, oohall@gmail.com, cohuck@redhat.com, kevin.tian@intel.com, hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v5 1/3] PCI/IOV: Mark VFs as not implementing PCI_COMMAND_MEMORY Date: Thu, 10 Sep 2020 10:59:55 -0400 Message-Id: <1599749997-30489-2-git-send-email-mjrosato@linux.ibm.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1599749997-30489-1-git-send-email-mjrosato@linux.ibm.com> References: <1599749997-30489-1-git-send-email-mjrosato@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-10_03:2020-09-10,2020-09-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 priorityscore=1501 clxscore=1015 phishscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 mlxlogscore=879 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009100130 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Matthew Rosato --- 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 b37e08c..4afd4ee 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 8355306..3ff72312 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -445,6 +445,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 */ -- 1.8.3.1