Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp231533pxx; Wed, 28 Oct 2020 03:33:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT5GUJSVVFkB9t0t1h33vwCJGH92yZDu7nJDEBebyOJDzRgEguFLD2x09ja7lo3AkvmoMm X-Received: by 2002:a17:906:388d:: with SMTP id q13mr6634710ejd.92.1603881197756; Wed, 28 Oct 2020 03:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603881197; cv=none; d=google.com; s=arc-20160816; b=Dyi5Pqq+JrY1pKln4O6Aon/DHr3kmjPAwGTH9xF32GLeJiTZfl7qe6IvxKRSrDppTD vciDotmGgH5FVAQIfrq1SDoK6Vr/5+TvE5y4zHr2XIdqrr2K9m++n1u7UQE+n1/BMl/H SfwiyH5ThKJ6fuasGW3x0gBn12NqIcFtQJi30i5aS8Bte5ZHVOky2NDWVZrbOdQ5Tuw/ iHnNTmuw7EG/87jkY9BPtMTbHjNQHZniPfXYFz7ens/WHWB/UTJTpBOikvhw1SmfgeEg XgxbncS9Wi/aAs4BOsUyLjQBj2BG57uO7kNDq2XIGLDnONzaZdvrfz7JKqIXT+vK2EKS irww== 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=/x04DpjZIt3yEWHBR32/Ds93m1ECpT2/v2BMaklDGp8=; b=0Clg7ozPBJlRX9dE/ObNTfhb2+l/1lqTKAcWPVxlwtZ7xYHV3400T4H9roDsXGgKpp 3tilxA7Z03YzRElHyXaAVoAM5Y6P/Nc/HZ3UwKt8xr8jqRCX3ds92WwQJSxz8t4v8zqS zNM6IqTxLu9a0JGrrCuwGGqQMQSoaLI30VnRXkdnc5VHn8fHHMeDGDa7mJmoJtOlaPzy csuF1spHmnJoE3nv1X3soXYNL5MrZZkQ7UBY5vOlDGgI8bmM8dlXF/emGk8r/uMU0dPI crLBHq0kd2O7M7m16Por7wHRJre+k6zMiGGPF7pu2YtLKrr9/ePKSd5vPpsN9+36CyjK 3wyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zThCVrBb; 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 i19si2816688ejh.153.2020.10.28.03.32.54; Wed, 28 Oct 2020 03:33:17 -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=zThCVrBb; 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 S1762421AbgJ0Omn (ORCPT + 99 others); Tue, 27 Oct 2020 10:42:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:39632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762028AbgJ0Oke (ORCPT ); Tue, 27 Oct 2020 10:40:34 -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 8EFB9207BB; Tue, 27 Oct 2020 14:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809634; bh=bsVjQgMMI+3K6+qbu7Hn5nCLM4uokNpwOjDHFgd1LmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zThCVrBb7Kbph65kYTP4dkYVyWkj0yeIu7U7Yq7IEDs1mfF6lLtxiLmIVnxBNjwK/ N2J+mgREOFcYz+Zdl+zPAAGflEZYqRh77Y8sj9uLFy6wDoorlDO5W6zjZBX0gTk/TY UenRG7TyWc3HiuNWYf+c47t4JrnhTunnETapta0w= 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.4 265/408] PCI/IOV: Mark VFs as not implementing PCI_COMMAND_MEMORY Date: Tue, 27 Oct 2020 14:53:23 +0100 Message-Id: <20201027135507.337440558@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 9c116cbaa95d8..e15220385666f 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -158,6 +158,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 e92bd9b32f369..6a6a819c5b49b 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -423,6 +423,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