All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 12/15] qtest: add support for target-i386 -M pc
Date: Thu, 12 Jan 2012 10:25:14 +0100	[thread overview]
Message-ID: <4F0EA6FA.4030300@redhat.com> (raw)
In-Reply-To: <4F0DE6B0.4000609@codemonkey.ws>

On 01/11/2012 08:44 PM, Anthony Liguori wrote:
> This is easier said than done.  I started down this road and there's a
> huge amount of code that assumes that first_cpu != NULL.

That's why I said do not create the CPU _threads_. :)  But that wouldn't 
be a big step forward from halted = 1; for example, it would prevent 
using per-CPU work items.  Currently they're only used internally by 
KVM, but you never know.

So you can also create a CPU thread that does nothing.  Here is how it 
could look like, based on the KVM implementation:

static void *qemu_qtest_cpu_thread_fn(void *arg)
{
     CPUState *env = arg;
     int r;

     qemu_mutex_lock(&qemu_global_mutex);
     qemu_thread_get_self(env->thread);
     env->thread_id = qemu_get_thread_id();

     sigset_t waitset;
     sigemptyset(&waitset);
     sigaddset(&waitset, SIG_IPI);

     /* signal CPU creation */
     env->created = 1;
     qemu_cond_signal(&qemu_cpu_cond);

     cpu_single_env = env;
     while (1) {
         cpu_single_env = NULL;
         qemu_mutex_unlock_iothread();
         do {
             int sig;
             r = sigwait(&waitset, &sig);
         } while (r == -1 && (errno == EAGAIN || errno == EINTR));
         if (r == -1) {
             perror("sigtimedwait");
             exit(1);
         }
         qemu_mutex_lock_iothread();
         cpu_single_env = env;
         qemu_wait_io_event_common(env);
     }

     return NULL;
}

Paolo

  reply	other threads:[~2012-01-12  9:25 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10 19:10 [Qemu-devel] [PATCH 01/15] tests: mv tests/* -> tests/tcg Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 02/15] build: split unit test builds to a separate makefile fragment Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 03/15] check-qdict: convert to gtest Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 04/15] check-qfloat: " Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 05/15] check-qint: " Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 06/15] check-qstring: " Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 07/15] check-qlist: " Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 08/15] check-qjson: " Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 09/15] check-qjson: enable disabled tests Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 10/15] test: eliminate libcheck tests and have make check use gtester Anthony Liguori
2012-01-12 12:17   ` Eduardo Habkost
2012-01-13 10:58   ` [Qemu-devel] --enable-check-utests gone, you may have to re-run configure (was: [PATCH 10/15] test: eliminate libcheck tests and have make check use gtester) Markus Armbruster
2012-01-10 19:10 ` [Qemu-devel] [PATCH 11/15] qtest: add test framework Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 12/15] qtest: add support for target-i386 -M pc Anthony Liguori
2012-01-10 19:56   ` Paolo Bonzini
2012-01-11 19:44     ` Anthony Liguori
2012-01-12  9:25       ` Paolo Bonzini [this message]
2012-01-10 19:10 ` [Qemu-devel] [PATCH 13/15] qtest: add C version of test infrastructure Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 14/15] make: add check targets based on gtester Anthony Liguori
2012-01-10 19:10 ` [Qemu-devel] [PATCH 15/15] qtest: add rtc-test test-case Anthony Liguori
2012-01-10 19:59   ` Paolo Bonzini
2012-01-11 17:06     ` Anthony Liguori
2012-01-11 19:27       ` Paolo Bonzini
2012-01-10 22:35 ` [Qemu-devel] [PATCH 01/15] tests: mv tests/* -> tests/tcg Andreas Färber
2012-01-12 16:53 ` 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=4F0EA6FA.4030300@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=anthony@codemonkey.ws \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.