From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60633 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkGMg-0001JH-Od for qemu-devel@nongnu.org; Tue, 01 Feb 2011 08:33:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkGMc-0002H9-GF for qemu-devel@nongnu.org; Tue, 01 Feb 2011 08:33:50 -0500 Received: from thoth.sbs.de ([192.35.17.2]:28833) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkGMc-0002H4-6c for qemu-devel@nongnu.org; Tue, 01 Feb 2011 08:33:46 -0500 Message-ID: <4D480BB9.2030209@siemens.com> Date: Tue, 01 Feb 2011 14:33:45 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <7e0c7b87e31857bf017d7dd96074ed11e7257529.1296133797.git.jan.kiszka@siemens.com> <20110201131404.GA13162@amt.cnet> In-Reply-To: <20110201131404.GA13162@amt.cnet> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 16/22] Introduce VCPU self-signaling service List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: Avi Kivity , "kvm@vger.kernel.org" , "qemu-devel@nongnu.org" On 2011-02-01 14:14, Marcelo Tosatti wrote: > On Thu, Jan 27, 2011 at 02:10:00PM +0100, Jan Kiszka wrote: >> Introduce qemu_cpu_kick_self to send SIG_IPI to the calling VCPU >> context. First user will be kvm. >> >> Signed-off-by: Jan Kiszka >> --- >> cpus.c | 21 +++++++++++++++++++++ >> qemu-common.h | 1 + >> 2 files changed, 22 insertions(+), 0 deletions(-) >> >> diff --git a/cpus.c b/cpus.c >> index bba59e5..88bed4e 100644 >> --- a/cpus.c >> +++ b/cpus.c >> @@ -531,6 +531,17 @@ void qemu_cpu_kick(void *env) >> return; >> } >> >> +void qemu_cpu_kick_self(void) >> +{ >> +#ifndef _WIN32 >> + assert(cpu_single_env); >> + >> + raise(SIG_IPI); >> +#else >> + abort(); >> +#endif >> +} >> + >> void qemu_notify_event(void) >> { >> CPUState *env = cpu_single_env; >> @@ -808,6 +819,16 @@ void qemu_cpu_kick(void *_env) >> } >> } >> >> +void qemu_cpu_kick_self(void) >> +{ >> + assert(cpu_single_env); >> + >> + if (!cpu_single_env->thread_kicked) { >> + qemu_thread_signal(cpu_single_env->thread, SIG_IPI); >> + cpu_single_env->thread_kicked = true; >> + } >> +} >> + > > There is no need to use cpu_single_env, can pass CPUState instead. > It's done intentionally this way: function shall not be used for a remote env. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux