Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp479169pxx; Wed, 28 Oct 2020 09:15:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqMs1HBkWo/XD8ZbiavtFv1Cf5jrftDS2gG2bK4nmro+k5uQSmKcCyROIIKtZYhD/4Z0nd X-Received: by 2002:a17:906:6a07:: with SMTP id o7mr8118369ejr.454.1603901709374; Wed, 28 Oct 2020 09:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603901709; cv=none; d=google.com; s=arc-20160816; b=EN6a5vaJZ2Xf+kUm0aTGWvsBCZhfUT2atpDtNt4S7qg0Y4OvzJruN26XJZInnKoi/p qfg1HexpdYV+Y9SoJiKmVpBCqpH/6CUuseokUPdF5GXmm9WgngMOyrVygJwtxLwo0LXH pRThaHcCqcCuk4fCJ+nsZ1XcHJvXKtLRBKEkVONeRG1qVSX/nUMuGJRvMjX0OhHUvRHP J+lV8PCMxDeObGcq60THgTLTxKWccyV8uMe6SQDaOqL5fpyllLtZECwOB/65mdtB/Nwj AkSV+Xer05ubxfa080Irc6dFvY/YJj41Eq0ilD6El2wMPhxWfmGYenHN+J8jSAq4eXjR mhMw== 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=y0qzp9RCAwPgOcgiHpcFpTJjGEDspRKdG9Ce6twcL7I=; b=fpBsxwCnND6lWALcomkDgdDk6AS9pBtYwKsW+vZVskYmgP2Ocu46EVblE4wi3jspG7 wPyZzEjXV9jOPKAoznsSGhjEfDs1ESTc3yZsjDBeQggzKPD0xgupWHh36Cteck3KddVV wVmxeFIMmnhYFCCTxiwRQqMxFS+6+88Mg59CrUTzsd7I8GfXK/Vf1+YlpWZmUum6aC1A bAFBox/kmRm4/dsIGJ2XwDaZ7yhVpucgSBUNzXHJOHsnAKy3uShM/JUYJ+fBdcLwDF3x 1zX9HSJ27b9xRGmUrCXGmX5z8MDCkPQTUlFV99lX/nglEVtOY5pl7+s+vtUA2g7DUEkh SGJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v7bH3h4J; 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 q15si2514699edi.432.2020.10.28.09.14.47; Wed, 28 Oct 2020 09:15:09 -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=v7bH3h4J; 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 S1815465AbgJ0RC3 (ORCPT + 99 others); Tue, 27 Oct 2020 13:02:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:43014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1793729AbgJ0PID (ORCPT ); Tue, 27 Oct 2020 11:08:03 -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 96321206E5; Tue, 27 Oct 2020 15:08:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811281; bh=BrzE6FuA9rcWBhFxOTzzLu3ZkxPjMnXxY6yoS+GALEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v7bH3h4JiUuo5NkArCqK9g8qa2fuMcdesobM9wNcbRNEwx7FOGXzgapwt+KfgBkgx FrUPy8W4IFeplDMaE5B7wuhcZjT1NgQfXXiSqFIuWlKtqXd8v0/YOfKsfiaK6ALDPT DJTfX1AyxNIZkAk7Q9ndb5tREOP2ya2BZ5cyhb5Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Rosato , Niklas Schnelle , Pierre Morel , Alex Williamson , Sasha Levin Subject: [PATCH 5.8 437/633] s390/pci: Mark all VFs as not implementing PCI_COMMAND_MEMORY Date: Tue, 27 Oct 2020 14:53:00 +0100 Message-Id: <20201027135543.221876826@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 08b6e22b850c28b6032da1e4d767a33116e23dfb ] For s390 we can have VFs that are passed-through without the associated PF. Firmware provides an emulation layer to allow these devices to operate independently, but is missing emulation of the Memory Space Enable bit. For these as well as linked VFs, set no_command_memory which specifies these devices do not implement PCI_COMMAND_MEMORY. Fixes: abafbc551fdd ("vfio-pci: Invalidate mmaps and block MMIO access on disabled memory") Signed-off-by: Matthew Rosato Reviewed-by: Niklas Schnelle Reviewed-by: Pierre Morel Signed-off-by: Alex Williamson Signed-off-by: Sasha Levin --- arch/s390/pci/pci_bus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/s390/pci/pci_bus.c b/arch/s390/pci/pci_bus.c index 5967f30141563..c93486a9989bc 100644 --- a/arch/s390/pci/pci_bus.c +++ b/arch/s390/pci/pci_bus.c @@ -197,9 +197,10 @@ void pcibios_bus_add_device(struct pci_dev *pdev) * With pdev->no_vf_scan the common PCI probing code does not * perform PF/VF linking. */ - if (zdev->vfn) + if (zdev->vfn) { zpci_bus_setup_virtfn(zdev->zbus, pdev, zdev->vfn); - + pdev->no_command_memory = 1; + } } static int zpci_bus_add_device(struct zpci_bus *zbus, struct zpci_dev *zdev) -- 2.25.1