Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp454301pxx; Wed, 28 Oct 2020 08:42:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLzxouqbjdws0b4wkVJMVttuT4fUXKKTtvIxiINM8JKmTkPKvutn89OUQwRX09tZrQzwvi X-Received: by 2002:a17:906:a988:: with SMTP id jr8mr7916283ejb.508.1603899763718; Wed, 28 Oct 2020 08:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603899763; cv=none; d=google.com; s=arc-20160816; b=GVJKwcW8ot4CpDsOomiT6ip4ryWxa93K/Elyj1gA5P23n9G69fjr/gK0vLsabqtbCo yB8MfJZVtf7jxpOHqknuJI5GHG2aSZXMrB5QCFfbj7rsLmwQFi3KAd2AWIfLxgqi+qCE izV6pP3CIfPqJXbn+CLcLSHQ74cwSW+JgFmQOdKZdZjFS2WIDgs6AlCbI2U8sdzjqrdf HwxfxU5NgByBJNGclGDn6QBjHVdCybDjE+0JCUw12XoJY2ivBnT4298zBt6DPOhW/0xc z5ulZnQ85WUtg80mR1NVGOWohcKX6nHrzPeYnXa7iqytsgpUsW5BF99S/rYa41Rup23d Q3Fw== 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=baemHGDHXtfWmjACDu60KzN3e9Y1NcToKOEJnPk/gQzLR96Ksi7XGAVAUFTCXNb5qU AGxQOsAThdvMAVKW+Y4So/oKF+PKkIJvMXQ3gSV75xq3DngxCzCmLkIxgN8y8pLEKKG3 1EzOafiG9HXVhgnIf5oNQq5qV+tpmB3uMp4f4oc8aeafzKyGe+noV8ahb3150R7zQd/O 7uQAQyn0kJ7a+NzbuJwvI6pOnJtv2Qq1HjC/01WAz4yLH5BVHzJ5xZsRgicQadBiYnL0 4rUrt1JP0rhJkNpEoIW5DlJORIFjBi02nlkE1a5Oa6pzD2e3jp32KKXxGSVQKFncri3/ V8MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TSJkoHQ2; 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 y19si2789537ejd.730.2020.10.28.08.42.20; Wed, 28 Oct 2020 08:42:43 -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=TSJkoHQ2; 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 S1812912AbgJ0Qqn (ORCPT + 99 others); Tue, 27 Oct 2020 12:46:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:35082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1801571AbgJ0Pmt (ORCPT ); Tue, 27 Oct 2020 11:42:49 -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 9C2F820657; Tue, 27 Oct 2020 15:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603813369; bh=BrzE6FuA9rcWBhFxOTzzLu3ZkxPjMnXxY6yoS+GALEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TSJkoHQ2CzLpoSf4RbIA35fbt8H4L7sFwlvcOYiTVMdMt+cvT6BeoQC7fuTH2M5d5 +xEAh7XvTfOmfBUhnZU9PN0XRlwp+K+UyXhxXrcS4FHUaukPEb4wKy4TwHmIAxwEzL OqpAG7WTVZc4ympVpAe0Vmshp6z9DS7+xxAEe98M= 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.9 528/757] s390/pci: Mark all VFs as not implementing PCI_COMMAND_MEMORY Date: Tue, 27 Oct 2020 14:52:58 +0100 Message-Id: <20201027135515.253588002@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@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