qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: ehabkost@redhat.com, mst@redhat.com, ghammer@redhat.com,
	lcapitulino@redhat.com, pbonzini@redhat.com, lersek@redhat.com
Subject: [Qemu-devel] [PATCH v17 9/9] pc/q53: by default put vmgenid device as an function of ISA bridge
Date: Tue, 19 Jan 2016 14:06:29 +0100	[thread overview]
Message-ID: <1453208789-42479-10-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1453208789-42479-1-git-send-email-imammedo@redhat.com>

it will save a PCI slot that would be used otherwise.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Michael S. Tsirkin <mst@redhat.com>
---
 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 ae96272..65b8982 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
 
@@ -415,6 +416,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 412b3cd..e147b95 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
@@ -339,6 +340,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 ea0c1d7..9f54211 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -293,6 +293,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,
-- 
1.8.3.1

  parent reply	other threads:[~2016-01-19 13:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 13:06 [Qemu-devel] [PATCH v17 0/9] Virtual Machine Generation ID Igor Mammedov
2016-01-19 13:06 ` [Qemu-devel] [PATCH v17 1/9] acpi: extend ACPI interface to provide access to ACPI registers and SCI irq Igor Mammedov
2016-01-19 13:06 ` [Qemu-devel] [PATCH v17 2/9] docs: vm generation id device's description Igor Mammedov
2016-01-20 16:40   ` Eric Blake
2016-01-21 12:43     ` Igor Mammedov
2016-01-19 13:06 ` [Qemu-devel] [PATCH v17 3/9] pc: add a Virtual Machine Generation ID device Igor Mammedov
2016-01-19 13:06 ` [Qemu-devel] [PATCH v17 4/9] tests: add a unit test for the vmgenid device Igor Mammedov
2016-01-19 13:06 ` [Qemu-devel] [PATCH v17 5/9] qmp/hmp: add query-vm-generation-id and 'info vm-generation-id' commands Igor Mammedov
2016-01-20 16:44   ` Eric Blake
2016-01-19 13:06 ` [Qemu-devel] [PATCH v17 6/9] qmp/hmp: add set-vm-generation-id commands Igor Mammedov
2016-01-20 16:48   ` Eric Blake
2016-01-21 12:46     ` Igor Mammedov
2016-01-19 13:06 ` [Qemu-devel] [PATCH v17 7/9] add MachineClass->default_props for setting default device properties Igor Mammedov
2016-01-23 14:59   ` Eduardo Habkost
2016-01-26 10:28     ` Igor Mammedov
2016-01-26 14:12       ` Eduardo Habkost
2016-01-19 13:06 ` [Qemu-devel] [PATCH v17 8/9] pc: put PIIX3 in slot 1 explicitly and cleanup functions assignment Igor Mammedov
2016-01-19 13:06 ` Igor Mammedov [this message]
2016-01-19 14:48 ` [Qemu-devel] [PATCH v17 0/9] Virtual Machine Generation ID Igor Mammedov
2016-01-19 16:49   ` Laszlo Ersek
2016-01-20  9:18     ` Igor Mammedov
2016-01-20 14:20       ` Laszlo Ersek
2016-01-21 13:08         ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453208789-42479-10-git-send-email-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=ghammer@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).