From patchwork Fri Jan 22 13:21:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 8090101 Return-Path: X-Original-To: patchwork-qemu-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 BD25F9F6FA for ; Fri, 22 Jan 2016 13:27:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B58720457 for ; Fri, 22 Jan 2016 13:27:08 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31B2B2042A for ; Fri, 22 Jan 2016 13:27:07 +0000 (UTC) Received: from localhost ([::1]:53771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMbk2-0002eL-L5 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Jan 2016 08:27:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMbec-0000vv-28 for qemu-devel@nongnu.org; Fri, 22 Jan 2016 08:21:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMbeZ-0002Sh-M6 for qemu-devel@nongnu.org; Fri, 22 Jan 2016 08:21:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMbeZ-0002Sa-EP for qemu-devel@nongnu.org; Fri, 22 Jan 2016 08:21:27 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 21B5BC0AC92B for ; Fri, 22 Jan 2016 13:21:27 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.34.112.60]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0MDL5gN021584; Fri, 22 Jan 2016 08:21:25 -0500 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Fri, 22 Jan 2016 14:21:02 +0100 Message-Id: <1453468862-118912-10-git-send-email-imammedo@redhat.com> In-Reply-To: <1453468862-118912-1-git-send-email-imammedo@redhat.com> References: <1453468862-118912-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: ehabkost@redhat.com, mst@redhat.com, ghammer@redhat.com, lersek@redhat.com, lcapitulino@redhat.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH v18 9/9] pc/q53: by default put vmgenid device as an function of ISA bridge X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 it will save a PCI slot that would be used otherwise. Signed-off-by: Igor Mammedov Suggested-by: Michael S. Tsirkin --- hw/i386/pc_piix.c | 12 ++++++++++++ hw/i386/pc_q35.c | 12 ++++++++++++ include/hw/i386/ich9.h | 3 ++- include/hw/i386/pc.h | 1 + 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 2ea3d84..a31e8c6 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -54,6 +54,7 @@ #endif #include "migration/migration.h" #include "kvm_i386.h" +#include "hw/misc/vmgenid.h" #define MAX_IDE_BUS 2 @@ -414,6 +415,17 @@ static void pc_xen_hvm_init(MachineState *machine) static void pc_i440fx_machine_options(MachineClass *m) { + static GlobalProperty dev_defaults[] = { + { + .driver = VMGENID_DEVICE, + .property = "addr", + .value = stringify(PIIX3_PCI_SLOT) "." + stringify(PIIX3_VMGENID_FUNC), + }, + {} + }; + + m->default_props = dev_defaults; m->family = "pc_piix"; m->desc = "Standard PC (i440FX + PIIX, 1996)"; m->hot_add_cpu = pc_hot_add_cpu; diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 6128b02..0a1df78 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -45,6 +45,7 @@ #include "hw/usb.h" #include "qemu/error-report.h" #include "migration/migration.h" +#include "hw/misc/vmgenid.h" /* ICH9 AHCI has 6 ports */ #define MAX_SATA_PORTS 6 @@ -338,6 +339,17 @@ static void pc_compat_1_4(MachineState *machine) static void pc_q35_machine_options(MachineClass *m) { + static GlobalProperty dev_defaults[] = { + { + .driver = VMGENID_DEVICE, + .property = "addr", + .value = stringify(ICH9_LPC_DEV) "." + stringify(ICH9_LPC_VMGENID_FUNC), + }, + {} + }; + + m->default_props = dev_defaults; m->family = "pc_q35"; m->desc = "Standard PC (Q35 + ICH9, 2009)"; m->hot_add_cpu = pc_hot_add_cpu; diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index b9d2b04..271b0c7 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -129,8 +129,9 @@ Object *ich9_lpc_find(void); #define ICH9_A2_LPC "ICH9 A2 LPC" #define ICH9_A2_LPC_SAVEVM_VERSION 0 -#define ICH9_LPC_DEV 31 +#define ICH9_LPC_DEV 0x1f #define ICH9_LPC_FUNC 0 +#define ICH9_LPC_VMGENID_FUNC 6 #define ICH9_A2_LPC_REVISION 0x2 #define ICH9_LPC_NB_PIRQS 8 /* PCI A-H */ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 4da5178..28b917a 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -296,6 +296,7 @@ typedef struct PCII440FXState PCII440FXState; #define PIIX3_IDE_FUNC 1 #define PIIX3_USB_FUNC 2 #define PIIX3_PIIX4_PM_FUNC 3 +#define PIIX3_VMGENID_FUNC 7 PCIBus *i440fx_init(const char *host_type, const char *pci_type, PCII440FXState **pi440fx_state,