From patchwork Thu Mar 6 04:08:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 3781051 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 659479F369 for ; Thu, 6 Mar 2014 04:08:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9843C20225 for ; Thu, 6 Mar 2014 04:08:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5E482021B for ; Thu, 6 Mar 2014 04:08:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752134AbaCFEI2 (ORCPT ); Wed, 5 Mar 2014 23:08:28 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:41559 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbaCFEI1 (ORCPT ); Wed, 5 Mar 2014 23:08:27 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s2648PPF025156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Mar 2014 04:08:25 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s2648Oo1013228 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Mar 2014 04:08:24 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s2648Ngf018480; Thu, 6 Mar 2014 04:08:23 GMT Received: from lappy.hsd1.ma.comcast.net (/10.154.139.112) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 05 Mar 2014 20:08:23 -0800 From: Sasha Levin To: penberg@kernel.org Cc: kvm@vger.kernel.org, Sasha Levin Subject: [PATCH] kvm tools: mark our PCI card as PIO and MMIO able Date: Wed, 5 Mar 2014 23:08:16 -0500 Message-Id: <1394078896-4971-1-git-send-email-sasha.levin@oracle.com> X-Mailer: git-send-email 1.8.3.2 X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A recent -next patch named "PCI: Ignore BAR contents when firmware left decoding disabled" has pointed out that PCI cards are supposed to declare that they have either PIO or MMIO BARs by disabling them if it didn't. Fix it by correctly marking our emulated PCI card as PIO/MMIO enabled. Signed-off-by: Sasha Levin --- tools/kvm/virtio/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c index fa7aa00..665d492 100644 --- a/tools/kvm/virtio/pci.c +++ b/tools/kvm/virtio/pci.c @@ -360,6 +360,7 @@ int virtio_pci__init(struct kvm *kvm, void *dev, struct virtio_device *vdev, vpci->pci_hdr = (struct pci_device_header) { .vendor_id = cpu_to_le16(PCI_VENDOR_ID_REDHAT_QUMRANET), .device_id = cpu_to_le16(device_id), + .command = PCI_COMMAND_IO | PCI_COMMAND_MEMORY, .header_type = PCI_HEADER_TYPE_NORMAL, .revision_id = 0, .class[0] = class & 0xff,