public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <gcosta@redhat.com>
To: kvm-devel@lists.sourceforge.net
Cc: marcelo@kvack.org, avi@qumranet.com,
	Glauber Costa <gcosta@redhat.com>,
	chrisw@sous-sol.org
Subject: [PATCH 9/15] initialize hot add system.
Date: Fri, 22 Feb 2008 18:34:33 -0300	[thread overview]
Message-ID: <1203716079-4872-10-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1203716079-4872-9-git-send-email-gcosta@redhat.com>

Register the pios, and grab cpu_model for future usage.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
 qemu/hw/acpi.c |   35 +++++++++++++++++++++++++++++++++++
 qemu/hw/pc.c   |    1 +
 2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c
index 18561e0..02f6bab 100644
--- a/qemu/hw/acpi.c
+++ b/qemu/hw/acpi.c
@@ -533,6 +533,41 @@ void qemu_system_powerdown(void)
     }
 }
 #endif
+unsigned long gpe_base = 0xafe0;
+
+struct gpe_regs {
+    uint16_t sts; /* status */
+    uint16_t en;  /* enabled */
+};
+
+static struct gpe_regs gpe;
+
+static uint32_t gpe_readb(void *opaque, uint32_t addr)
+{
+    uint32_t val = 0;
+#if defined(DEBUG)
+    printf("gpe read %lx == %lx\n", addr, val);
+#endif
+    return val;
+}
+
+static void gpe_writeb(void *opaque, uint32_t addr, uint32_t val)
+{
+#if defined(DEBUG)
+    printf("gpe write %lx <== %d\n", addr, val);
+#endif
+}
+
+static char *model;
+
+void qemu_system_hot_add_init(char *cpu_model)
+{
+    register_ioport_write(gpe_base, 4, 1, gpe_writeb, &gpe);
+    register_ioport_read(gpe_base, 4, 1,  gpe_readb, &gpe);
+
+    model = cpu_model;
+}
+
 void qemu_system_cpu_hot_add(int cpu, int state)
 {
 }
diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
index 982377d..ab69e5c 100644
--- a/qemu/hw/pc.c
+++ b/qemu/hw/pc.c
@@ -1020,6 +1020,7 @@ #endif
         }
     }
 
+    qemu_system_hot_add_init(cpu_model);
 #define USE_HYPERCALL
 #ifdef USE_HYPERCALL
     pci_hypercall_init(pci_bus);
-- 
1.4.2


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  reply	other threads:[~2008-02-22 21:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22 21:34 [PATCH 0/15] Review: acpi processor hotplug Glauber Costa
2008-02-22 21:34 ` [PATCH 1/15] Make a GPE register block be acessible Glauber Costa
2008-02-22 21:34   ` [PATCH 2/15] mark extra cpus as present Glauber Costa
2008-02-22 21:34     ` [PATCH 3/15] introduce cpu_set to qemu monitor Glauber Costa
2008-02-22 21:34       ` [PATCH 4/15] mark processors as presents Glauber Costa
2008-02-22 21:34         ` [PATCH 5/15] provide gpe _L0x methods Glauber Costa
2008-02-22 21:34           ` [PATCH 6/15] provide operation region for pio to the gpes Glauber Costa
2008-02-22 21:34             ` [PATCH 7/15] implement method _L00 for GPE0 Glauber Costa
2008-02-22 21:34               ` [PATCH 8/15] isolate cpu initialization function in hw/pc.c Glauber Costa
2008-02-22 21:34                 ` Glauber Costa [this message]
2008-02-22 21:34                   ` [PATCH 10/15] handle gpe data for pio Glauber Costa
2008-02-22 21:34                     ` [PATCH 11/15] manipulate the gpe bits and send sci up the os Glauber Costa
2008-02-22 21:34                       ` [PATCH 12/15] isolate cpu thread creation in qemu-kvm.c Glauber Costa
2008-02-22 21:34                         ` [PATCH 13/15] provide _MAT to acpi processor Glauber Costa
2008-02-22 21:34                           ` [PATCH 14/15] start a new cpu thread Glauber Costa
2008-02-22 21:34                             ` [PATCH 15/15] provide _EJ0 method for processor removal Glauber Costa
2008-02-24  9:33         ` [PATCH 4/15] mark processors as presents Avi Kivity
2008-02-25 14:38           ` Glauber Costa
2008-02-25 14:49             ` Avi Kivity
2008-02-25 14:43               ` Glauber Costa
2008-02-24  9:34       ` [PATCH 3/15] introduce cpu_set to qemu monitor Avi Kivity
2008-02-24  9:44 ` [PATCH 0/15] Review: acpi processor hotplug Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2008-02-26 19:56 [PATCH 0/15] " Glauber Costa
2008-02-26 19:56 ` [PATCH 1/15] Make a GPE register block be acessible Glauber Costa
2008-02-26 19:56   ` [PATCH 2/15] mark extra cpus as present Glauber Costa
2008-02-26 19:56     ` [PATCH 3/15] introduce cpu_set to qemu monitor Glauber Costa
2008-02-26 19:56       ` [PATCH 4/15] mark processors as presents Glauber Costa
2008-02-26 19:56         ` [PATCH 5/15] provide gpe _L0x methods Glauber Costa
2008-02-26 19:56           ` [PATCH 6/15] provide operation region for pio to the gpes Glauber Costa
2008-02-26 19:56             ` [PATCH 7/15] implement method _L00 for GPE0 Glauber Costa
2008-02-26 19:56               ` [PATCH 8/15] isolate cpu initialization function in hw/pc.c Glauber Costa
2008-02-26 19:56                 ` [PATCH 9/15] initialize hot add system Glauber Costa

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=1203716079-4872-10-git-send-email-gcosta@redhat.com \
    --to=gcosta@redhat.com \
    --cc=avi@qumranet.com \
    --cc=chrisw@sous-sol.org \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=marcelo@kvack.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