From nobody Thu Apr 25 22:38:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1589898689; cv=none; d=zohomail.com; s=zohoarc; b=UsAUnvOAYaSOscjB5efcmpwgArKQ69zX5PdbloVimN80ykjzdvSUFAI3z7uRSWIM/IDLVal8ZgsJ1OqgQDhPsh5cxdIDllLUqlFBVVjhdXH/PbKw773i8f8eas80KdB867KS+cc24AMp4B6TSRI2LvJFZHsX45GKxHG1NAyboSQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589898689; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=F28oi3qJ9O6gn02zVIxVnfC9VuwgNGatLkF9AIz4imw=; b=T3Z9caQl17OEgLDixNGULsj75HHFTpKzPHoXJwiwZdc8KJABUJ96FHD+IUZSdtx70VDm3wcef4Pp5U5gfuawRxEDljSdPSiAkXFLk4RNeMbdL7xqdVgMOQdbdcuo/h50ZKLblzCGtgNwJb2EFidoY59q8D7THnxBG5qz5v9kUOc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1589898689081147.27838594382968; Tue, 19 May 2020 07:31:29 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jb3H1-0003fB-BN; Tue, 19 May 2020 14:31:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jb3H0-0003f4-68 for xen-devel@lists.xenproject.org; Tue, 19 May 2020 14:31:14 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 63b1812e-99dd-11ea-b9cf-bc764e2007e4; Tue, 19 May 2020 14:31:13 +0000 (UTC) X-Inumbo-ID: 63b1812e-99dd-11ea-b9cf-bc764e2007e4 Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: CmRLdw6LI7GbmUBiN8Dk3dr+z8cZBmJRvieC/1Iylk3BPxEU3SgNwAHcpTcJzXLbGOqrbm8TWC 15mQPDS2nlav+b5ExdiiPjOUHjTYKE6G5niJ6uI4t7/lkFVAkXlT0X8WmqV3r/Rvh5hPxAeNm4 p2w0rKmhWkL3zVhDxRswNWqGNkFWJEuau6eW2pTMLI5x84vE1Djo/0R+GKhihf5tMptLEzmbht MpO5QkZjry+eDaJZY7wOqTTinQkNdM0rozNXzYhreS0zJFOHUBqdP5cARl2l1PO996SOrG8FPj Af4= X-SBRS: 2.7 X-MesageID: 18167038 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,410,1583211600"; d="scan'208";a="18167038" From: Roger Pau Monne To: Subject: [PATCH v2] xen: fix build without pci passthrough Date: Tue, 19 May 2020 16:31:01 +0200 Message-ID: <20200519143101.75330-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , Paul Durrant , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" has_igd_gfx_passthru is only available when QEMU is built with CONFIG_XEN_PCI_PASSTHROUGH, and hence shouldn't be used in common code without checking if it's available. Fixes: 46472d82322d0 ('xen: convert "-machine igd-passthru" to an accelerat= or property') Signed-off-by: Roger Pau Monn=C3=A9 --- Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: xen-devel@lists.xenproject.org --- Changes since v1: - Do not include osdep in header file. - Always add the setters/getters of igd-passthru, report an error when attempting to set igd-passthru without built in pci-passthrough support. --- hw/xen/xen-common.c | 4 ++++ hw/xen/xen_pt.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c index 70564cc952..d758770da0 100644 --- a/hw/xen/xen-common.c +++ b/hw/xen/xen-common.c @@ -134,7 +134,11 @@ static bool xen_get_igd_gfx_passthru(Object *obj, Erro= r **errp) =20 static void xen_set_igd_gfx_passthru(Object *obj, bool value, Error **errp) { +#ifdef CONFIG_XEN_PCI_PASSTHROUGH has_igd_gfx_passthru =3D value; +#else + error_setg(errp, "Xen PCI passthrough support not built in"); +#endif } =20 static void xen_setup_post(MachineState *ms, AccelState *accel) diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index 179775db7b..7430235a27 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -322,7 +322,13 @@ extern void *pci_assign_dev_load_option_rom(PCIDevice = *dev, unsigned int domain, unsigned int bus, unsigned int= slot, unsigned int function); + +#ifdef CONFIG_XEN_PCI_PASSTHROUGH extern bool has_igd_gfx_passthru; +#else +# define has_igd_gfx_passthru false +#endif + static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev) { return (has_igd_gfx_passthru --=20 2.26.2