From patchwork Tue Mar 8 14:27:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 8534821 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6DD71C0553 for ; Tue, 8 Mar 2016 14:30:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D20B20165 for ; Tue, 8 Mar 2016 14:30:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 866542012D for ; Tue, 8 Mar 2016 14:30:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1adIbo-0002Ve-Pw; Tue, 08 Mar 2016 14:27:36 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1adIbn-0002UJ-Co for xen-devel@lists.xensource.com; Tue, 08 Mar 2016 14:27:35 +0000 Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id 1B/F4-03301-651EED65; Tue, 08 Mar 2016 14:27:34 +0000 X-Env-Sender: kraxel@redhat.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1457447252!29742127!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: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 49108 invoked from network); 8 Mar 2016 14:27:33 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 8 Mar 2016 14:27:33 -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 CB9AB8C56B; Tue, 8 Mar 2016 14:27:31 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u28ERU6s008983; Tue, 8 Mar 2016 09:27:30 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 86B5C82756; Tue, 8 Mar 2016 15:27:29 +0100 (CET) From: Gerd Hoffmann To: kevin.tian@intel.com, Alex Williamson , Stefano Stabellini Date: Tue, 8 Mar 2016 15:27:20 +0100 Message-Id: <1457447247-4865-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1457447247-4865-1-git-send-email-kraxel@redhat.com> References: <1457447247-4865-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 , "Michael S. Tsirkin" , "open list:All patches CC here" , Gerd Hoffmann , Paolo Bonzini , Richard Henderson Subject: [Xen-devel] [PATCH v4 1/8] pc: remove has_igd_gfx_passthru global X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 Signed-off-by: Gerd Hoffmann Reviewed-by: Stefano Stabellini Reviewed-by: Eduardo Habkost --- hw/i386/pc_piix.c | 2 +- hw/xen/xen_pt.h | 5 +++-- vl.c | 10 ---------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 6f8c2cd..40c58a5 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -364,7 +364,7 @@ static void pc_init_isa(MachineState *machine) #ifdef CONFIG_XEN static void pc_xen_hvm_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, diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index c2f8e1f..4048a5a 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -4,6 +4,7 @@ #include "qemu-common.h" #include "hw/xen/xen_common.h" #include "hw/pci/pci.h" +#include "hw/boards.h" #include "xen-host-pci-device.h" void xen_pt_log(const PCIDevice *d, const char *f, ...) GCC_FMT_ATTR(2, 3); @@ -322,10 +323,10 @@ extern void *pci_assign_dev_load_option_rom(PCIDevice *dev, unsigned int domain, unsigned int bus, unsigned int slot, unsigned int function); -extern bool has_igd_gfx_passthru; static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev) { - return (has_igd_gfx_passthru + MachineState *machine = MACHINE(qdev_get_machine()); + return (machine->igd_gfx_passthru && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA)); } int xen_pt_register_vga_regions(XenHostPCIDevice *dev); diff --git a/vl.c b/vl.c index adeddd9..bdc2879 100644 --- a/vl.c +++ b/vl.c @@ -1374,13 +1374,6 @@ static inline void semihosting_arg_fallback(const char *file, const char *cmd) } } -/* Now we still need this for compatibility with XEN. */ -bool has_igd_gfx_passthru; -static void igd_gfx_passthru(void) -{ - has_igd_gfx_passthru = current_machine->igd_gfx_passthru; -} - /***********************************************************/ /* USB devices */ @@ -4524,9 +4517,6 @@ int main(int argc, char **argv, char **envp) exit(1); } - /* Check if IGD GFX passthrough. */ - igd_gfx_passthru(); - /* init generic devices */ if (qemu_opts_foreach(qemu_find_opts("device"), device_init_func, NULL, NULL)) {