All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH 17/20] qemu-kvm: Use upstream main loop initialization
Date: Fri, 27 May 2011 14:19:21 +0200	[thread overview]
Message-ID: <d1b9b6778e8991d4cdf03610a1ec54bc58ca6c32.1306498737.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1306498737.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1306498737.git.jan.kiszka@siemens.com>

Switch to CONFIG_IOTHREAD version of qemu_kvm_init_main_loop and drop
qemu_kvm_init_main_loop as well as kvm_init_ap.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 cpus.c     |   62 +-----------------------------------------------------------
 kvm-all.c  |    2 -
 qemu-kvm.h |    1 -
 3 files changed, 1 insertions(+), 64 deletions(-)

diff --git a/cpus.c b/cpus.c
index a4bac1a..7bd888a 100644
--- a/cpus.c
+++ b/cpus.c
@@ -529,9 +529,7 @@ static void qemu_tcg_init_cpu_signals(void)
 }
 #endif /* _WIN32 */
 
-/*#ifndef CONFIG_IOTHREAD*/
-static void qemu_kvm_init_main_loop(void);
-
+#ifndef CONFIG_IOTHREAD
 int qemu_init_main_loop(void)
 {
     int ret;
@@ -540,13 +538,11 @@ int qemu_init_main_loop(void)
     if (ret) {
         return ret;
     }
-    qemu_kvm_init_main_loop();
 
     qemu_init_sigbus();
 
     return qemu_event_init();
 }
-#ifndef CONFIG_IOTHREAD
 
 void qemu_main_loop_start(void)
 {
@@ -653,7 +649,6 @@ static QemuCond qemu_system_cond;
 static QemuCond qemu_pause_cond;
 static QemuCond qemu_work_cond;
 
-#ifdef UNUSED_IOTHREAD_IMPL
 int qemu_init_main_loop(void)
 {
     int ret;
@@ -683,7 +678,6 @@ int qemu_init_main_loop(void)
 
     return 0;
 }
-#endif /* UNUSED_IOTHREAD_IMPL */
 
 void qemu_main_loop_start(void)
 {
@@ -1200,10 +1194,6 @@ unsigned long kvm_get_thread_id(void)
     return syscall(SYS_gettid);
 }
 
-static void sig_ipi_handler(int n)
-{
-}
-
 static void kvm_main_loop_wait(CPUState *env, int timeout)
 {
     struct timespec ts;
@@ -1338,58 +1328,8 @@ int kvm_init_vcpu(CPUState *env)
     return 0;
 }
 
-int kvm_init_ap(void)
-{
-    struct sigaction action;
-
-    qemu_mutex_lock(&qemu_global_mutex);
-
-    signal(SIG_IPI, sig_ipi_handler);
-
-    memset(&action, 0, sizeof(action));
-    action.sa_flags = SA_SIGINFO;
-    action.sa_sigaction = (void (*)(int, siginfo_t*, void*))sigbus_handler;
-    sigaction(SIGBUS, &action, NULL);
-    prctl(PR_MCE_KILL, 1, 1, 0, 0);
-    return 0;
-}
-
 bool qemu_system_is_ready(void)
 {
     return qemu_system_ready;
 }
-
-static void qemu_kvm_init_main_loop(void)
-{
-    sigset_t mask;
-    int sigfd;
-
-    sigemptyset(&mask);
-    sigaddset(&mask, SIGIO);
-    sigaddset(&mask, SIGALRM);
-    sigaddset(&mask, SIGBUS);
-    sigprocmask(SIG_BLOCK, &mask, NULL);
-
-    sigfd = qemu_signalfd(&mask);
-    if (sigfd == -1) {
-        fprintf(stderr, "failed to create signalfd\n");
-        exit(1);
-    }
-
-    fcntl(sigfd, F_SETFL, O_NONBLOCK);
-
-    qemu_set_fd_handler2(sigfd, NULL, sigfd_handler, NULL,
-                         (void *)(unsigned long) sigfd);
-
-    qemu_cond_init(&qemu_cpu_cond);
-    qemu_cond_init(&qemu_system_cond);
-    qemu_cond_init(&qemu_pause_cond);
-    qemu_cond_init(&qemu_work_cond);
-    qemu_mutex_init(&qemu_fair_mutex);
-    qemu_mutex_init(&qemu_global_mutex);
-    qemu_mutex_lock(&qemu_global_mutex);
-
-    qemu_thread_get_self(&io_thread);
-}
-
 #endif /* CONFIG_KVM */
diff --git a/kvm-all.c b/kvm-all.c
index e6a2b65..7b032ba 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -821,8 +821,6 @@ int kvm_init(void)
         return ret;
     }
 
-    kvm_init_ap();
-
     cpu_interrupt_handler = kvm_handle_interrupt;
 
     return 0;
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 2420f82..a4c811c 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -266,7 +266,6 @@ struct kvm_pit_state {
 #endif                          /* !CONFIG_KVM */
 
 int kvm_create_vcpu(CPUState *env);
-int kvm_init_ap(void);
 void kvm_save_lapic(CPUState *env);
 void kvm_load_lapic(CPUState *env);
 
-- 
1.7.1


  parent reply	other threads:[~2011-05-27 12:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27 12:19 [PATCH 00/20] qemu-kvm: Cleanup and switch to upstream - The Season Final Jan Kiszka
2011-05-27 12:19 ` [PATCH 01/20] qemu-kvm: Move thread-related code to cpus.c Jan Kiszka
2011-05-27 12:19 ` [PATCH 02/20] qemu-kvm: Enable CONFIG_IOTHREAD Jan Kiszka
2011-05-27 12:19 ` [PATCH 03/20] qemu-kvm: Switch to iothread version of qemu_notify_event Jan Kiszka
2011-05-27 12:19 ` [PATCH 04/20] qemu-kvm: Use upstream mutex and conds Jan Kiszka
2011-05-27 12:19 ` [PATCH 05/20] qemu-kvm: Restrict validity of cpu_single_env Jan Kiszka
2011-05-27 12:19 ` [PATCH 06/20] qemu-kvm: Use upstream qemu_mutex_lock/unlock_iothread Jan Kiszka
2011-05-27 12:19 ` [PATCH 07/20] qemu-kvm: Clean up kvm_update_interrupt_request Jan Kiszka
2011-05-29 16:16   ` Avi Kivity
2011-05-29 16:37     ` Jan Kiszka
2011-05-29 16:41       ` Avi Kivity
2011-05-27 12:19 ` [PATCH 08/20] qemu-kvm: Replace kvm_update_interrupt_request with qemu_cpu_kick Jan Kiszka
2011-05-29 16:19   ` Avi Kivity
2011-05-29 16:41     ` Jan Kiszka
2011-05-29 16:44       ` Avi Kivity
2011-05-29 17:55         ` Jan Kiszka
2011-05-30 15:10           ` Avi Kivity
2011-05-27 12:19 ` [PATCH 09/20] qemu-kvm: Use upstream run_on_cpu and flush_queued_work Jan Kiszka
2011-05-27 12:19 ` [PATCH 10/20] qemu-kvm: Drop kvm_cond_wait Jan Kiszka
2011-05-27 12:19 ` [PATCH 11/20] qemu-kvm: Replace kvm_cpu_is_stopped with cpu_is_stopped Jan Kiszka
2011-05-27 12:19 ` [PATCH 12/20] qemu-kvm: Remove obsolete current_env Jan Kiszka
2011-05-27 12:19 ` [PATCH 13/20] qemu-kvm: Use upstream vcpu pause/resume Jan Kiszka
2011-05-27 12:19 ` [PATCH 14/20] qemu-kvm: Move main loop setup code Jan Kiszka
2011-05-27 12:19 ` [PATCH 15/20] qemu-kvm: Use upstream's way of signaling debug stops Jan Kiszka
2011-05-27 12:19 ` [PATCH 16/20] qemu-kvm: Use upstream main loop Jan Kiszka
2011-05-27 12:19 ` Jan Kiszka [this message]
2011-05-27 12:19 ` [PATCH 18/20] qemu-kvm: Replace kvm_get_thread_id with qemu_get_thread_id Jan Kiszka
2011-05-27 12:19 ` [PATCH 19/20] qemu-kvm: Use upstream kvm vcpu initialization Jan Kiszka
2011-05-27 12:19 ` [PATCH 20/20] qemu-kvm: Use upstream vcpu loop Jan Kiszka
2011-05-29 16:24 ` [PATCH 00/20] qemu-kvm: Cleanup and switch to upstream - The Season Final Avi Kivity
2011-05-31 13:36 ` Marcelo Tosatti

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=d1b9b6778e8991d4cdf03610a1ec54bc58ca6c32.1306498737.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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.