From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92318C468BD for ; Sun, 9 Jun 2019 17:17:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BF462067C for ; Sun, 9 Jun 2019 17:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560100647; bh=K3HweLCpeokOm366BXIvoHi/dJtHz0DI3sdBKIKEuDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Y61jHxcdblpnXqHvgEkXR7J5tSvC8bA8sok817kpq5dqstbsceUEsPDiuOdNmDmkC svbACnlzX9s4wRDGI8fMlBLxWVIjYlVRqYKBCwYTddspT9LbwtkbjFh5PuZaTBK9PH Ejrq6b3mOjx2eHlHIJ64NJ0zUJeJLyPTLXyzKHO0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732064AbfFIQvz (ORCPT ); Sun, 9 Jun 2019 12:51:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:52420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732059AbfFIQvz (ORCPT ); Sun, 9 Jun 2019 12:51:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0B651205ED; Sun, 9 Jun 2019 16:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560099114; bh=K3HweLCpeokOm366BXIvoHi/dJtHz0DI3sdBKIKEuDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kAz6yprGT6JRtrnM7bkoJgJzAAoFrIahNcsu9hl//GEzYx9ndAXSDeDhytk4Oo8mF TmnhiWQdyCJotBuJJOerXuqNvlMgGCzCbG8rHbvd7Pghv9x852sRPTNC5W1nhqN+WB 3DAvqKEcjCzCMIiR0BJGu27VFUMEOw8uNXx9XOjM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Beulich , Konrad Rzeszutek Wilk , Prarit Bhargava , Juergen Gross , Ben Hutchings Subject: [PATCH 4.9 15/83] xen/pciback: Dont disable PCI_COMMAND on PCI device reset. Date: Sun, 9 Jun 2019 18:41:45 +0200 Message-Id: <20190609164128.850524258@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609164127.843327870@linuxfoundation.org> References: <20190609164127.843327870@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Konrad Rzeszutek Wilk commit 7681f31ec9cdacab4fd10570be924f2cef6669ba upstream. There is no need for this at all. Worst it means that if the guest tries to write to BARs it could lead (on certain platforms) to PCI SERR errors. Please note that with af6fc858a35b90e89ea7a7ee58e66628c55c776b "xen-pciback: limit guest control of command register" a guest is still allowed to enable those control bits (safely), but is not allowed to disable them and that therefore a well behaved frontend which enables things before using them will still function correctly. This is done via an write to the configuration register 0x4 which triggers on the backend side: command_write \- pci_enable_device \- pci_enable_device_flags \- do_pci_enable_device \- pcibios_enable_device \-pci_enable_resourcess [which enables the PCI_COMMAND_MEMORY|PCI_COMMAND_IO] However guests (and drivers) which don't do this could cause problems, including the security issues which XSA-120 sought to address. Reported-by: Jan Beulich Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Prarit Bhargava Signed-off-by: Juergen Gross Cc: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- drivers/xen/xen-pciback/pciback_ops.c | 2 -- 1 file changed, 2 deletions(-) --- a/drivers/xen/xen-pciback/pciback_ops.c +++ b/drivers/xen/xen-pciback/pciback_ops.c @@ -126,8 +126,6 @@ void xen_pcibk_reset_device(struct pci_d if (pci_is_enabled(dev)) pci_disable_device(dev); - pci_write_config_word(dev, PCI_COMMAND, 0); - dev->is_busmaster = 0; } else { pci_read_config_word(dev, PCI_COMMAND, &cmd);