From patchwork Tue Jan 5 11:41:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 7954281 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 909AE9F3E6 for ; Tue, 5 Jan 2016 11:45:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C051020304 for ; Tue, 5 Jan 2016 11:45:16 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE2F520166 for ; Tue, 5 Jan 2016 11:45:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aGQ08-0004i2-BL; Tue, 05 Jan 2016 11:42:08 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aGQ04-0004fa-Je for xen-devel@lists.xensource.com; Tue, 05 Jan 2016 11:42:04 +0000 Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id 64/00-21571-C0CAB865; Tue, 05 Jan 2016 11:42:04 +0000 X-Env-Sender: kraxel@redhat.com X-Msg-Ref: server-16.tower-21.messagelabs.com!1451994120!4082926!1 X-Originating-IP: [209.132.183.28] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46189 invoked from network); 5 Jan 2016 11:42:01 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 5 Jan 2016 11:42:01 -0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id BD623C109088; Tue, 5 Jan 2016 11:41:59 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u05BfwMr012460; Tue, 5 Jan 2016 06:41:58 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 3926680C9F; Tue, 5 Jan 2016 12:41:57 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 5 Jan 2016 12:41:28 +0100 Message-Id: <1451994098-6972-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1451994098-6972-1-git-send-email-kraxel@redhat.com> References: <1451994098-6972-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Cc: igvt-g@ml01.01.org, xen-devel@lists.xensource.com, Eduardo Habkost , Stefano Stabellini , "Michael S. Tsirkin" , Cao jin , vfio-users@redhat.com, Paolo Bonzini , Richard Henderson , Gerd Hoffmann Subject: [Xen-devel] [PATCH v3 01/11] pc: wire up TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE for !xen X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 rename pc_xen_hvm_init_pci to pc_i440fx_init_pci, use it for both xen and non-xen init. That changes behavior of all pc-i440fx-$version machine types where specifying -machine igd-passthru=on used to have no effect and now it has. It is unlikely to cause any trouble though as there used to be no reason to add that option to kvm guests in the first place. Signed-off-by: Gerd Hoffmann Reviewed-by: Eduardo Habkost Reviewed-by: Stefano Stabellini --- hw/i386/pc_piix.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 438cdae..6532e32 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -368,10 +368,9 @@ static void pc_init_isa(MachineState *machine) pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, TYPE_I440FX_PCI_DEVICE); } -#ifdef CONFIG_XEN -static void pc_xen_hvm_init_pci(MachineState *machine) +static void pc_i440fx_init_pci(MachineState *machine) { - const char *pci_type = has_igd_gfx_passthru ? + const char *pci_type = machine->igd_gfx_passthru ? TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE : TYPE_I440FX_PCI_DEVICE; pc_init1(machine, @@ -379,6 +378,7 @@ static void pc_xen_hvm_init_pci(MachineState *machine) pci_type); } +#ifdef CONFIG_XEN static void pc_xen_hvm_init(MachineState *machine) { PCIBus *bus; @@ -388,7 +388,7 @@ static void pc_xen_hvm_init(MachineState *machine) exit(1); } - pc_xen_hvm_init_pci(machine); + pc_i440fx_init_pci(machine); bus = pci_find_primary_bus(); if (bus != NULL) { @@ -404,8 +404,7 @@ static void pc_xen_hvm_init(MachineState *machine) if (compat) { \ compat(machine); \ } \ - pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ - TYPE_I440FX_PCI_DEVICE); \ + pc_i440fx_init_pci(machine); \ } \ DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)