From nobody Fri May 3 07:17:08 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575885059; cv=none; d=zohomail.com; s=zohoarc; b=KUUDpxKxI5TtPom3PnNTk+a8j19BHwo65M9SDdGseDulZJ5hIHAIrU1zQNLTWmtwn2mhFw5arZU4d8R46r1HJW7tsg68rzFhXEjtnY7a7MP7LCdZWus0rN0Qs/9427kMZzK4GNqYnC7FE7L3RJUWCO/HuDof24yOXgKiA8EX7A0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575885059; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BQz4RdlPqs8bY8KjRxIOmrqo13oX1GO7rxgDy3FxfrI=; b=I/rHXhZB7PtAZfLLVp2trphKm8SUiMfvymRqbqlmHvXIBTlX/bn1Cah7UYqo8wasQGwQk5eTg1aS7p4QiKY7HnePDD+AkdRGAsd4GVjfGZh54OI7kwB4YvAyDO+ReZ/wwsAyym5VoiXt+TpjgFbyI+BAZrvgHUeQvqxCM2dkcTM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1575885059862961.835865893827; Mon, 9 Dec 2019 01:50:59 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgT-0004O5-M7; Mon, 09 Dec 2019 09:50:29 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgS-0004No-5R for xen-devel@lists.xenproject.org; Mon, 09 Dec 2019 09:50:28 +0000 Received: from us-smtp-1.mimecast.com (unknown [207.211.31.120]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 5395896e-1a69-11ea-87af-12813bfff9fa; Mon, 09 Dec 2019 09:50:26 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-361-0HquLGLpPjifq5N-al5RAA-1; Mon, 09 Dec 2019 04:50:24 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 995EA107ACC4; Mon, 9 Dec 2019 09:50:22 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-142.brq.redhat.com [10.40.205.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7D1819C5B; Mon, 9 Dec 2019 09:50:17 +0000 (UTC) X-Inumbo-ID: 5395896e-1a69-11ea-87af-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575885026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DQT1twDpLbPdu5i3g7UASwR5tJqP0VI32dQgZGzQBd4=; b=NXqvT18Ugsnf+aN8CNzmJzGkRCBTlWlmWMD2oS2bFczMcX8VhwTkh9Ypi5FqXnBXIVFF38 aozIErpotH56pHxOynFQOj4idpUbn7bfAZcya2KYcKFh/R3TQ/g2PTdsD1SGAMyyFT3F9G iAAg6m5BlNB92Bup0MS3Hd1Q4tY0/Hw= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 9 Dec 2019 10:49:57 +0100 Message-Id: <20191209095002.32194-2-philmd@redhat.com> In-Reply-To: <20191209095002.32194-1-philmd@redhat.com> References: <20191209095002.32194-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: 0HquLGLpPjifq5N-al5RAA-1 X-Mimecast-Spam-Score: 0 Subject: [Xen-devel] [PATCH-for-5.0 v3 1/6] hw/pci-host/i440fx: Correct the header description X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Stefano Stabellini , "Michael S. Tsirkin" , Paul Durrant , Markus Armbruster , Alex Williamson , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Missed during the refactor in commits 14a026dd58 and 0f25d865a, this file is now only about the i440FX chipset. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/pci-host/i440fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index f27131102d..3fc94426ea 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -1,5 +1,5 @@ /* - * QEMU i440FX/PIIX3 PCI Bridge Emulation + * QEMU i440FX PCI Bridge Emulation * * Copyright (c) 2006 Fabrice Bellard * --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Fri May 3 07:17:08 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575885070; cv=none; d=zohomail.com; s=zohoarc; b=IgMKZ/fMXEym8cXwsmwvlgeDd0kE6Ha7d3XWm/5z6WMAdu2i8v25ArMyFKrnQ1mXtRE4T9h0nwD/KIL9MjbuJJ/Q7Yrbi2KQa88tOYNdJy5Xl3f2JgKA6bYgOXX8oeXEw5a3wef3H5MYi1Tp9oWvkv5yATdjmtVwPZHA6dOYZ1o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575885070; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6GpHH7afjXyaN9mYUnkiU2UGjtW5aLndIr023Uwl/xM=; b=Z5LKLMBdzQRXljRfgRJO/ze7Vw0pMnq2xOj1+6C5MaTgOf4V5wuZDECzxxdSv7chN2Y3WMTRW4yEO7zvq5b2jGDCB3RQy2yau1z5ORN0iF9shqBpfIEybRIvXCdtQykRPNKd5JLJAYST8FxKUCF0kdcKEzWHY6OjDUz8rpz54Nw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 15758850709211002.2958828074112; Mon, 9 Dec 2019 01:51:10 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgX-0004PM-UY; Mon, 09 Dec 2019 09:50:33 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgX-0004P4-2F for xen-devel@lists.xenproject.org; Mon, 09 Dec 2019 09:50:33 +0000 Received: from us-smtp-1.mimecast.com (unknown [207.211.31.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 5605b459-1a69-11ea-87af-12813bfff9fa; Mon, 09 Dec 2019 09:50:30 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-119-iZ-_Yi-lPHK3MEi807cAbQ-1; Mon, 09 Dec 2019 04:50:28 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 581F01800D45; Mon, 9 Dec 2019 09:50:27 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-142.brq.redhat.com [10.40.205.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32B2519C5B; Mon, 9 Dec 2019 09:50:22 +0000 (UTC) X-Inumbo-ID: 5605b459-1a69-11ea-87af-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575885030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=65dn2EaMCTP37YOCYHLxZUlHztk6cKACuH+ML1W/q/Y=; b=FbT1BtM+ats12IGQYugzBIR4/YSU68bbLczAyWMSNsDdjA/P20a5qLWxruUiI6WG3kJl9p 6OsY6Uo+ahQuB+FyQJz+D73bnOsDaafE2oSUZE1v7Oqw0yU0o7nd5oGb2cNa88Clq7gSuE fniY2zBc6fyAXKRTkDf0O3X8XSqUM4A= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 9 Dec 2019 10:49:58 +0100 Message-Id: <20191209095002.32194-3-philmd@redhat.com> In-Reply-To: <20191209095002.32194-1-philmd@redhat.com> References: <20191209095002.32194-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: iZ-_Yi-lPHK3MEi807cAbQ-1 X-Mimecast-Spam-Score: 0 Subject: [Xen-devel] [PATCH-for-5.0 v3 2/6] hw/pci-host/i440fx: Extract PCII440FXState to "hw/pci-host/i440fx.h" X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Stefano Stabellini , "Michael S. Tsirkin" , Paul Durrant , Markus Armbruster , Alex Williamson , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Make the PCII440FXState structure public, so it can be used out of this source file. This will allow us to extract the IGD Passthrough Host Bridge, which is a children of the TYPE_I440FX_PCI_DEVICE. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- include/hw/pci-host/i440fx.h | 19 +++++++++++++++++-- hw/pci-host/i440fx.c | 18 ------------------ 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h index f54e6466e4..cc58d82ed4 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -13,12 +13,27 @@ =20 #include "hw/hw.h" #include "hw/pci/pci_bus.h" - -typedef struct PCII440FXState PCII440FXState; +#include "hw/pci-host/pam.h" =20 #define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost" #define TYPE_I440FX_PCI_DEVICE "i440FX" =20 +#define I440FX_PCI_DEVICE(obj) \ + OBJECT_CHECK(PCII440FXState, (obj), TYPE_I440FX_PCI_DEVICE) + +typedef struct PCII440FXState { + /*< private >*/ + PCIDevice parent_obj; + /*< public >*/ + + MemoryRegion *system_memory; + MemoryRegion *pci_address_space; + MemoryRegion *ram_memory; + PAMMemoryRegion pam_regions[13]; + MemoryRegion smram_region; + MemoryRegion smram, low_smram; +} PCII440FXState; + #define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX" =20 PCIBus *i440fx_init(const char *host_type, const char *pci_type, diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 3fc94426ea..fbdc563599 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -31,7 +31,6 @@ #include "hw/sysbus.h" #include "qapi/error.h" #include "migration/vmstate.h" -#include "hw/pci-host/pam.h" #include "qapi/visitor.h" #include "qemu/error-report.h" =20 @@ -51,23 +50,6 @@ typedef struct I440FXState { uint32_t short_root_bus; } I440FXState; =20 -#define I440FX_PCI_DEVICE(obj) \ - OBJECT_CHECK(PCII440FXState, (obj), TYPE_I440FX_PCI_DEVICE) - -struct PCII440FXState { - /*< private >*/ - PCIDevice parent_obj; - /*< public >*/ - - MemoryRegion *system_memory; - MemoryRegion *pci_address_space; - MemoryRegion *ram_memory; - PAMMemoryRegion pam_regions[13]; - MemoryRegion smram_region; - MemoryRegion smram, low_smram; -}; - - #define I440FX_PAM 0x59 #define I440FX_PAM_SIZE 7 #define I440FX_SMRAM 0x72 --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Fri May 3 07:17:08 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575885077; cv=none; d=zohomail.com; s=zohoarc; b=iU3P3Hlv09jMY9Ji6aH9Bswoh71l+pSog949arYCYL2aauGHNkDVIa3g6Ur9N9hEf120KK5WekhsJ4wGtqTwwLY0jjXi9f607sAkXnCpnu6DRQhrrwloyymJZ2EQCPXMJ57vxnl7qfvJ1jxmXZbaM8zWf8Ccn0yajrPdm+gZHpE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575885077; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=21HB2qEr1fHbDsso4uWTFaFjwc+Hgz0cilrGJOKOHC4=; b=Fo145ap/A1MKimnHL6hMhLej3DEhni2pfWv8ko3qRT6REU2RhG9rn7PhjV+V6MHZU7/aTWdw187Pa0FMyduzttzhrRmJ73UnTRfoC7qO3hVtQogQtAyrl+bEFWPuJoZJQ8WFpGxlIv3+t/i5mYeDfMiTnusoFayMeABh105+uY8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 157588507746850.624121239320175; Mon, 9 Dec 2019 01:51:17 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgk-0004TA-7p; Mon, 09 Dec 2019 09:50:46 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgj-0004Sn-49 for xen-devel@lists.xenproject.org; Mon, 09 Dec 2019 09:50:45 +0000 Received: from us-smtp-1.mimecast.com (unknown [207.211.31.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 5e77a15b-1a69-11ea-87af-12813bfff9fa; Mon, 09 Dec 2019 09:50:44 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-13-gfa2tifNPLWJqkaOzwt-IQ-1; Mon, 09 Dec 2019 04:50:41 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A7CD800D53; Mon, 9 Dec 2019 09:50:40 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-142.brq.redhat.com [10.40.205.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5472519C5B; Mon, 9 Dec 2019 09:50:27 +0000 (UTC) X-Inumbo-ID: 5e77a15b-1a69-11ea-87af-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575885044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nQooNv4KuAJbOCpnZQESZEyWieR/hAlT1WGgxUjJTpQ=; b=U3HV4rr7iW79bGAKPiRi+Rd8YGmb53rNOOlxOe+UHSKPEVZ738PbEKBO8bIpRz5lfJh0jK an7mObpz0dFn/6F2SSK9+ASkaRL37n/Q03TPIi2j1AnvKFP34dt/boOSB0hKd+mWi1p8K3 isCGQuhhBlUuc4rzv0aJ1TfETmYZ/Lw= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 9 Dec 2019 10:49:59 +0100 Message-Id: <20191209095002.32194-4-philmd@redhat.com> In-Reply-To: <20191209095002.32194-1-philmd@redhat.com> References: <20191209095002.32194-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: gfa2tifNPLWJqkaOzwt-IQ-1 X-Mimecast-Spam-Score: 0 Subject: [Xen-devel] [PATCH-for-5.0 v3 3/6] hw/pci-host/i440fx: Use size_t to iterate over ARRAY_SIZE() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Stefano Stabellini , "Michael S. Tsirkin" , Paul Durrant , Markus Armbruster , Alex Williamson , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We don't enforce the -Wsign-conversion CPPFLAG, but it doesn't hurt to avoid this warning: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka '= unsigned long') [-Wsign-conversion] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/pci-host/i440fx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index fbdc563599..0cc80b276d 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -419,12 +419,11 @@ out: static void igd_pt_i440fx_realize(PCIDevice *pci_dev, Error **errp) { uint32_t val =3D 0; - int i, num; + size_t i; int pos, len; Error *local_err =3D NULL; =20 - num =3D ARRAY_SIZE(igd_host_bridge_infos); - for (i =3D 0; i < num; i++) { + for (i =3D 0; i < ARRAY_SIZE(igd_host_bridge_infos); i++) { pos =3D igd_host_bridge_infos[i].offset; len =3D igd_host_bridge_infos[i].len; host_pci_config_read(pos, len, &val, &local_err); --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Fri May 3 07:17:08 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575885083; cv=none; d=zohomail.com; s=zohoarc; b=UMSyIbCL3EHJCuBT/mZ9wCzi17bszSU2QvII70jwgvgIreI/iq5BY0Gz4jWhxQLA0BPulCOOh/eznNlsVPVX1SjJEn9dbD0xz5qq/sG95O0L0E3dd+zTosCl2L1gaKHL6/BpF3OywSCkDHjVNOzK45x7XOW3cJqZEZkN++H64fQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575885083; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oxs97I6mMRnbRhO57z/SYczcg0TUs133r54tzTfC2TM=; b=Ywr39BRuorAZYrFthGPz6KdeYEOZdl5KgJxBxGlPvN3suL+bdVJ0bkVcnRnOOhdC0yIh/NSzoLArwU4JcimzMALyQr/TAweu66dWUvWatiKS62YY66KpgpEiWRw+ZGkS0U4o8Jeve59wsk0gXJJMh1N1vyPeX6JvIZPdZMrTaxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1575885083529275.55978977731183; Mon, 9 Dec 2019 01:51:23 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgn-0004Ua-HZ; Mon, 09 Dec 2019 09:50:49 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgm-0004UC-Io for xen-devel@lists.xenproject.org; Mon, 09 Dec 2019 09:50:48 +0000 Received: from us-smtp-1.mimecast.com (unknown [207.211.31.120]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 608c5210-1a69-11ea-87af-12813bfff9fa; Mon, 09 Dec 2019 09:50:48 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-29-Z6Cj3bucPzC0clLYFX03TA-1; Mon, 09 Dec 2019 04:50:46 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 515A01005512; Mon, 9 Dec 2019 09:50:45 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-142.brq.redhat.com [10.40.205.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBBF719C5B; Mon, 9 Dec 2019 09:50:40 +0000 (UTC) X-Inumbo-ID: 608c5210-1a69-11ea-87af-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575885048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2iD6T3th+ueTgWBqM5ey4lwC4HSji2/frVsA2WgJMg0=; b=I4s9Kfy6GrSZBIcNR4Q8VwQZEEu34DLpthVAIRd+AY1kDahU8PHTo2m/I5py/Ew6GwIRON oYw+72zq6C9OJzPy9iseMrJ9rF/3mg4Z9vHgkS76VB46cJo1Sr2Mm5sSLbnwMkYAxvjUmt M+RHyGZ004uc528auRXPWA59xIAm1iw= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 9 Dec 2019 10:50:00 +0100 Message-Id: <20191209095002.32194-5-philmd@redhat.com> In-Reply-To: <20191209095002.32194-1-philmd@redhat.com> References: <20191209095002.32194-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: Z6Cj3bucPzC0clLYFX03TA-1 X-Mimecast-Spam-Score: 0 Subject: [Xen-devel] [PATCH-for-5.0 v3 4/6] hw/pci-host/i440fx: Use definitions instead of magic values X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Stefano Stabellini , "Michael S. Tsirkin" , Paul Durrant , Markus Armbruster , Alex Williamson , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Use definitions from "hw/pci/pci_regs.h". This also helps when using git-grep. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/pci-host/i440fx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 0cc80b276d..414138595b 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -376,13 +376,13 @@ typedef struct { =20 /* Here we just expose minimal host bridge offset subset. */ static const IGDHostInfo igd_host_bridge_infos[] =3D { - {0x08, 2}, /* revision id */ - {0x2c, 2}, /* sybsystem vendor id */ - {0x2e, 2}, /* sybsystem id */ - {0x50, 2}, /* SNB: processor graphics control register */ - {0x52, 2}, /* processor graphics control register */ - {0xa4, 4}, /* SNB: graphics base of stolen memory */ - {0xa8, 4}, /* SNB: base of GTT stolen memory */ + {PCI_REVISION_ID, 2}, + {PCI_SUBSYSTEM_VENDOR_ID, 2}, + {PCI_SUBSYSTEM_ID, 2}, + {0x50, 2}, /* SNB: processor graphics control regis= ter */ + {0x52, 2}, /* processor graphics control register */ + {0xa4, 4}, /* SNB: graphics base of stolen memory */ + {0xa8, 4}, /* SNB: base of GTT stolen memory */ }; =20 static void host_pci_config_read(int pos, int len, uint32_t *val, Error **= errp) --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Fri May 3 07:17:08 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575885094; cv=none; d=zohomail.com; s=zohoarc; b=EV3kr0ZfpryJqcEfbVH/qQFSTXkN3i2nrKmgBXeRVUx8dySoe+Ks/oiGYNoNyXi8C9YFmcYhJyFTwvzdbwMmam5ysl2e02UpNQKnUj2d/i/OSk7tk5EtcjQE6m2Nc1Nt7q3dszg/uuT8GliYFgH805Vt41q+514BsMfrPsaZKno= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575885094; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TK9TpaI2OZteCEcSrkR4ubK9DxV6EyhJzryJm7XYgW8=; b=FUmA4M3FEXF5OAcSvTeL9P2HyZ8kT9eOB4/KRw0KYMc8BlR0366VNng617b+5/XlOe66qHtJTIlj1VWKlkuIOKWIC0MzjesJfLBOI6AOBMZY0T0E8nX4fsVfCOf1U3Zg+S1NzZZBOt+KWzVpqKjaaEHfG6LkzqXK/F+Q1FjvS8M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 157588509420291.79785755358114; Mon, 9 Dec 2019 01:51:34 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgu-0004Y5-3c; Mon, 09 Dec 2019 09:50:56 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgt-0004Xe-Ax for xen-devel@lists.xenproject.org; Mon, 09 Dec 2019 09:50:55 +0000 Received: from us-smtp-delivery-1.mimecast.com (unknown [207.211.31.120]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 638c6703-1a69-11ea-87af-12813bfff9fa; Mon, 09 Dec 2019 09:50:54 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-73-55SXMpbaMIG-zKzwsagGjA-1; Mon, 09 Dec 2019 04:50:52 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A8729107ACC4; Mon, 9 Dec 2019 09:50:50 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-142.brq.redhat.com [10.40.205.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4BF319C5B; Mon, 9 Dec 2019 09:50:45 +0000 (UTC) X-Inumbo-ID: 638c6703-1a69-11ea-87af-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575885053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1vV4BdXxrJs33eazwg4k8OQaJDOeixo6CZUflsfdJpk=; b=Wq/ID6ZSCyg3uTZmpe+foqyoU0fnxKlfId2jc+CJePqKBt1PB/ElJYNF0rDscGtkZJP+5Y x/OI9Sfddc4gEOdi+D3UC8MfxGgy+VlgD5+PjgJEaRGw0ZF4H3s9W1NdyALMuVAfR+s8Vo xoX79Oq0LKQ6nQ5/TWeXlr9UZC6x/YI= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 9 Dec 2019 10:50:01 +0100 Message-Id: <20191209095002.32194-6-philmd@redhat.com> In-Reply-To: <20191209095002.32194-1-philmd@redhat.com> References: <20191209095002.32194-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: 55SXMpbaMIG-zKzwsagGjA-1 X-Mimecast-Spam-Score: 0 Subject: [Xen-devel] [PATCH-for-5.0 v3 5/6] hw/pci-host/i440fx: Extract the IGD passthrough host bridge device X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Stefano Stabellini , "Michael S. Tsirkin" , Paul Durrant , Markus Armbruster , Alex Williamson , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We can use a i440FX without the IGD passthrough host bridge. Extract it into a new file, 'hw/pci-host/igd_pt.c'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Paul Durrant --- v3: - Rename as 'xen_igd_pt.c' (Alex Williamson) - Add an entry in MAINTAINERS::Xen --- hw/pci-host/i440fx.c | 84 -------------------------- hw/pci-host/xen_igd_pt.c | 120 ++++++++++++++++++++++++++++++++++++++ MAINTAINERS | 1 + hw/pci-host/Makefile.objs | 1 + 4 files changed, 122 insertions(+), 84 deletions(-) create mode 100644 hw/pci-host/xen_igd_pt.c diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 414138595b..bae7b42327 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -368,89 +368,6 @@ static const TypeInfo i440fx_info =3D { }, }; =20 -/* IGD Passthrough Host Bridge. */ -typedef struct { - uint8_t offset; - uint8_t len; -} IGDHostInfo; - -/* Here we just expose minimal host bridge offset subset. */ -static const IGDHostInfo igd_host_bridge_infos[] =3D { - {PCI_REVISION_ID, 2}, - {PCI_SUBSYSTEM_VENDOR_ID, 2}, - {PCI_SUBSYSTEM_ID, 2}, - {0x50, 2}, /* SNB: processor graphics control regis= ter */ - {0x52, 2}, /* processor graphics control register */ - {0xa4, 4}, /* SNB: graphics base of stolen memory */ - {0xa8, 4}, /* SNB: base of GTT stolen memory */ -}; - -static void host_pci_config_read(int pos, int len, uint32_t *val, Error **= errp) -{ - int rc, config_fd; - /* Access real host bridge. */ - char *path =3D g_strdup_printf("/sys/bus/pci/devices/%04x:%02x:%02x.%d= /%s", - 0, 0, 0, 0, "config"); - - config_fd =3D open(path, O_RDWR); - if (config_fd < 0) { - error_setg_errno(errp, errno, "Failed to open: %s", path); - goto out; - } - - if (lseek(config_fd, pos, SEEK_SET) !=3D pos) { - error_setg_errno(errp, errno, "Failed to seek: %s", path); - goto out_close_fd; - } - - do { - rc =3D read(config_fd, (uint8_t *)val, len); - } while (rc < 0 && (errno =3D=3D EINTR || errno =3D=3D EAGAIN)); - if (rc !=3D len) { - error_setg_errno(errp, errno, "Failed to read: %s", path); - } - -out_close_fd: - close(config_fd); -out: - g_free(path); -} - -static void igd_pt_i440fx_realize(PCIDevice *pci_dev, Error **errp) -{ - uint32_t val =3D 0; - size_t i; - int pos, len; - Error *local_err =3D NULL; - - for (i =3D 0; i < ARRAY_SIZE(igd_host_bridge_infos); i++) { - pos =3D igd_host_bridge_infos[i].offset; - len =3D igd_host_bridge_infos[i].len; - host_pci_config_read(pos, len, &val, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } - pci_default_write_config(pci_dev, pos, val, len); - } -} - -static void igd_passthrough_i440fx_class_init(ObjectClass *klass, void *da= ta) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); - - k->realize =3D igd_pt_i440fx_realize; - dc->desc =3D "IGD Passthrough Host bridge"; -} - -static const TypeInfo igd_passthrough_i440fx_info =3D { - .name =3D TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE, - .parent =3D TYPE_I440FX_PCI_DEVICE, - .instance_size =3D sizeof(PCII440FXState), - .class_init =3D igd_passthrough_i440fx_class_init, -}; - static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge, PCIBus *rootbus) { @@ -495,7 +412,6 @@ static const TypeInfo i440fx_pcihost_info =3D { static void i440fx_register_types(void) { type_register_static(&i440fx_info); - type_register_static(&igd_passthrough_i440fx_info); type_register_static(&i440fx_pcihost_info); } =20 diff --git a/hw/pci-host/xen_igd_pt.c b/hw/pci-host/xen_igd_pt.c new file mode 100644 index 0000000000..efcc9347ff --- /dev/null +++ b/hw/pci-host/xen_igd_pt.c @@ -0,0 +1,120 @@ +/* + * QEMU Intel IGD Passthrough Host Bridge Emulation + * + * Copyright (c) 2006 Fabrice Bellard + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "hw/pci/pci.h" +#include "hw/pci/pci_host.h" +#include "hw/pci-host/i440fx.h" +#include "qapi/error.h" + +typedef struct { + uint8_t offset; + uint8_t len; +} IGDHostInfo; + +/* Here we just expose minimal host bridge offset subset. */ +static const IGDHostInfo igd_host_bridge_infos[] =3D { + {PCI_REVISION_ID, 2}, + {PCI_SUBSYSTEM_VENDOR_ID, 2}, + {PCI_SUBSYSTEM_ID, 2}, + {0x50, 2}, /* SNB: processor graphics control regis= ter */ + {0x52, 2}, /* processor graphics control register */ + {0xa4, 4}, /* SNB: graphics base of stolen memory */ + {0xa8, 4}, /* SNB: base of GTT stolen memory */ +}; + +static void host_pci_config_read(int pos, int len, uint32_t *val, Error **= errp) +{ + int rc, config_fd; + /* Access real host bridge. */ + char *path =3D g_strdup_printf("/sys/bus/pci/devices/%04x:%02x:%02x.%d= /%s", + 0, 0, 0, 0, "config"); + + config_fd =3D open(path, O_RDWR); + if (config_fd < 0) { + error_setg_errno(errp, errno, "Failed to open: %s", path); + goto out; + } + + if (lseek(config_fd, pos, SEEK_SET) !=3D pos) { + error_setg_errno(errp, errno, "Failed to seek: %s", path); + goto out_close_fd; + } + + do { + rc =3D read(config_fd, (uint8_t *)val, len); + } while (rc < 0 && (errno =3D=3D EINTR || errno =3D=3D EAGAIN)); + if (rc !=3D len) { + error_setg_errno(errp, errno, "Failed to read: %s", path); + } + + out_close_fd: + close(config_fd); + out: + g_free(path); +} + +static void igd_pt_i440fx_realize(PCIDevice *pci_dev, Error **errp) +{ + uint32_t val =3D 0; + size_t i; + int pos, len; + Error *local_err =3D NULL; + + for (i =3D 0; i < ARRAY_SIZE(igd_host_bridge_infos); i++) { + pos =3D igd_host_bridge_infos[i].offset; + len =3D igd_host_bridge_infos[i].len; + host_pci_config_read(pos, len, &val, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + pci_default_write_config(pci_dev, pos, val, len); + } +} + +static void igd_passthrough_i440fx_class_init(ObjectClass *klass, void *da= ta) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); + + k->realize =3D igd_pt_i440fx_realize; + dc->desc =3D "IGD Passthrough Host bridge"; +} + +static const TypeInfo igd_passthrough_i440fx_info =3D { + .name =3D TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE, + .parent =3D TYPE_I440FX_PCI_DEVICE, + .instance_size =3D sizeof(PCII440FXState), + .class_init =3D igd_passthrough_i440fx_class_init, +}; + +static void igd_pt_i440fx_register_types(void) +{ + type_register_static(&igd_passthrough_i440fx_info); +} + +type_init(igd_pt_i440fx_register_types) diff --git a/MAINTAINERS b/MAINTAINERS index 5e5e3e52d6..62bcf5e94e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -419,6 +419,7 @@ F: hw/block/dataplane/xen* F: hw/xen/ F: hw/xenpv/ F: hw/i386/xen/ +F: hw/pci-host/xen_igd_pt.c F: include/hw/block/dataplane/xen* F: include/hw/xen/ F: include/sysemu/xen-mapcache.h diff --git a/hw/pci-host/Makefile.objs b/hw/pci-host/Makefile.objs index efd752b766..fa6d1556c0 100644 --- a/hw/pci-host/Makefile.objs +++ b/hw/pci-host/Makefile.objs @@ -14,6 +14,7 @@ common-obj-$(CONFIG_VERSATILE_PCI) +=3D versatile.o common-obj-$(CONFIG_PCI_SABRE) +=3D sabre.o common-obj-$(CONFIG_FULONG) +=3D bonito.o common-obj-$(CONFIG_PCI_I440FX) +=3D i440fx.o +common-obj-$(CONFIG_PCI_I440FX) +=3D xen_igd_pt.o common-obj-$(CONFIG_PCI_EXPRESS_Q35) +=3D q35.o common-obj-$(CONFIG_PCI_EXPRESS_GENERIC_BRIDGE) +=3D gpex.o common-obj-$(CONFIG_PCI_EXPRESS_XILINX) +=3D xilinx-pcie.o --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Fri May 3 07:17:08 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575885111; cv=none; d=zohomail.com; s=zohoarc; b=C0uU/XhWuV3g1d0eBUttJ9NXCx/DCedHPTik65Op35n5TyMjvRYb4E61QwKDqfNGMn6LT/umsxNMBM9nXJZObMd3Omrc5Kcqgyx+bSaqNnDPXaWLKZieqidsPR5TjuZ7SU0XMjkQ8JM/bjmU7Wptuhs4MJZ/K/jBv//eeZfAbcQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575885111; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bNZ048HEE3GOBe35eR/JaF4oFNHiQddzTn+4BgC6pxA=; b=lj/V+n3tKD378v4XH5pV/dryNM3UzrsE3tS/quWdBmuktfJUXX6oHcHCjJvLOlMqZOaLJTaHsgYW/iFWJfrtFvEEnXmN77ajQ5+YyZZt6fakZHy8a/Xgy8ylknzL/mgVd40EcvuaeTcYARw2fcn7dWkSDYSucd5yoseSIEpqV60= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1575885111884954.8290048119826; Mon, 9 Dec 2019 01:51:51 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFhE-0004gb-DT; Mon, 09 Dec 2019 09:51:16 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFhD-0004g8-3a for xen-devel@lists.xenproject.org; Mon, 09 Dec 2019 09:51:15 +0000 Received: from us-smtp-1.mimecast.com (unknown [205.139.110.120]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 704cba1e-1a69-11ea-a914-bc764e2007e4; Mon, 09 Dec 2019 09:51:14 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-222-LSW49e5NNvasJ4mh1-Fhgw-1; Mon, 09 Dec 2019 04:51:03 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 47580800C74; Mon, 9 Dec 2019 09:51:02 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-142.brq.redhat.com [10.40.205.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72AB919C5B; Mon, 9 Dec 2019 09:50:51 +0000 (UTC) X-Inumbo-ID: 704cba1e-1a69-11ea-a914-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575885074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JyTRNBIq6COiBd2fUeZp5zZWcFeEuRMkF4nfuRBiSRw=; b=cvY3ccTvyWjHZkBcrv17ASvPGEMR8baKsfU/sZsMnzuY/UsiXgDAJWlTLi1J+N0FmPekyl MLfkOEmEz7Jr8Dp5hrBVXwPTNbDd3a7E7eQbX7ni0YN7KzDpeyKjiLlmgCe8/K8XHi+R/e yWqrKJvwYKsYXRFHH5jHUEelLBD9OLo= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 9 Dec 2019 10:50:02 +0100 Message-Id: <20191209095002.32194-7-philmd@redhat.com> In-Reply-To: <20191209095002.32194-1-philmd@redhat.com> References: <20191209095002.32194-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: LSW49e5NNvasJ4mh1-Fhgw-1 X-Mimecast-Spam-Score: 0 Subject: [Xen-devel] [PATCH-for-5.0 v3 6/6] hw/pci-host: Add Kconfig entry to select the IGD Passthrough Host Bridge X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Stefano Stabellini , "Michael S. Tsirkin" , Paul Durrant , Markus Armbruster , Alex Williamson , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Add the XEN_IGD_PASSTHROUGH Kconfig option. Xen build has that option selected by default. Non-Xen builds now have to select this feature manually. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Paul Durrant --- v3: Only default with Xen (Alex Williamson) I did not used 'depends on XEN' as suggested by Alex but 'default y if XEN', so one can build XEN without this feature (for example, on other ARCH than X86). --- hw/pci-host/Kconfig | 5 +++++ hw/pci-host/Makefile.objs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig index b0aa8351c4..24ba8ea046 100644 --- a/hw/pci-host/Kconfig +++ b/hw/pci-host/Kconfig @@ -1,6 +1,11 @@ config PAM bool =20 +config XEN_IGD_PASSTHROUGH + bool + default y if XEN + select PCI_I440FX + config PREP_PCI bool select PCI diff --git a/hw/pci-host/Makefile.objs b/hw/pci-host/Makefile.objs index fa6d1556c0..9c466fab01 100644 --- a/hw/pci-host/Makefile.objs +++ b/hw/pci-host/Makefile.objs @@ -14,7 +14,7 @@ common-obj-$(CONFIG_VERSATILE_PCI) +=3D versatile.o common-obj-$(CONFIG_PCI_SABRE) +=3D sabre.o common-obj-$(CONFIG_FULONG) +=3D bonito.o common-obj-$(CONFIG_PCI_I440FX) +=3D i440fx.o -common-obj-$(CONFIG_PCI_I440FX) +=3D xen_igd_pt.o +common-obj-$(CONFIG_XEN_IGD_PASSTHROUGH) +=3D xen_igd_pt.o common-obj-$(CONFIG_PCI_EXPRESS_Q35) +=3D q35.o common-obj-$(CONFIG_PCI_EXPRESS_GENERIC_BRIDGE) +=3D gpex.o common-obj-$(CONFIG_PCI_EXPRESS_XILINX) +=3D xilinx-pcie.o --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel