From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [RFC v2 2/6] qtest: add support for target-i386 -M pc
Date: Thu, 1 Dec 2011 12:43:28 -0600 [thread overview]
Message-ID: <1322765012-3164-3-git-send-email-aliguori@us.ibm.com> (raw)
In-Reply-To: <1322765012-3164-1-git-send-email-aliguori@us.ibm.com>
This involves forcing the CPU into the halted state if qtest is enabled and
replacing the local APIC with the qtest interrupt controller.
It should be pretty straight forward to do the same for other machine types on
other architectures.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
hw/pc.c | 7 ++++++-
hw/pc_piix.c | 9 ++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index 33778fe..bba8adc 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -43,6 +43,7 @@
#include "ui/qemu-spice.h"
#include "memory.h"
#include "exec-memory.h"
+#include "qtest.h"
/* output Bochs bios info messages */
//#define DEBUG_BIOS
@@ -926,7 +927,11 @@ static void pc_cpu_reset(void *opaque)
CPUState *env = opaque;
cpu_reset(env);
- env->halted = !cpu_is_bsp(env);
+ if (qtest_enabled()) {
+ env->halted = 1;
+ } else {
+ env->halted = !cpu_is_bsp(env);
+ }
}
static CPUState *pc_new_cpu(const char *cpu_model)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 970f43c..570d5fb 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -46,6 +46,7 @@
#ifdef CONFIG_XEN
# include <xen/hvm/hvm_info_table.h>
#endif
+#include "qtest.h"
#define MAX_IDE_BUS 2
@@ -152,11 +153,13 @@ static void pc_init1(MemoryRegion *system_memory,
}
isa_bus_irqs(gsi);
- if (!xen_enabled()) {
+ if (xen_enabled()) {
+ i8259 = xen_interrupt_controller_init();
+ } else if (qtest_enabled()) {
+ i8259 = qtest_interrupt_controller_init();
+ } else {
cpu_irq = pc_allocate_cpu_irq();
i8259 = i8259_init(cpu_irq[0]);
- } else {
- i8259 = xen_interrupt_controller_init();
}
for (i = 0; i < ISA_NUM_IRQS; i++) {
--
1.7.4.1
next prev parent reply other threads:[~2011-12-02 1:10 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-01 18:43 [Qemu-devel] [RFC v2 0/6] qtest unit test framework Anthony Liguori
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 1/6] qtest: add " Anthony Liguori
2011-12-05 14:27 ` Luiz Capitulino
2011-12-01 18:43 ` Anthony Liguori [this message]
2011-12-02 7:52 ` [Qemu-devel] [RFC v2 2/6] qtest: add support for target-i386 -M pc Paolo Bonzini
2011-12-29 17:40 ` Peter Maydell
2011-12-29 18:47 ` Anthony Liguori
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 3/6] Add core python test framework Anthony Liguori
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 4/6] Add uart test case Anthony Liguori
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 5/6] Add RTC " Anthony Liguori
2011-12-05 14:32 ` Luiz Capitulino
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 6/6] Add C version of rtc-test Anthony Liguori
2011-12-02 17:25 ` Kevin Wolf
2011-12-02 17:26 ` Anthony Liguori
2011-12-02 17:45 ` Kevin Wolf
2011-12-02 18:20 ` Luiz Capitulino
2011-12-02 18:43 ` Anthony Liguori
2011-12-05 8:51 ` Kevin Wolf
2011-12-04 10:03 ` [Qemu-devel] [RFC v2 0/6] qtest unit test framework Dor Laor
2011-12-05 15:29 ` Anthony Liguori
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=1322765012-3164-3-git-send-email-aliguori@us.ibm.com \
--to=aliguori@us.ibm.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).