From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 1/8] test: allow functions to execute on non-irq context remotely Date: Thu, 25 Mar 2010 18:25:56 +0200 Message-ID: <4BAB8E94.5090902@redhat.com> References: <20100324212408.790319364@amt.cnet> <20100324212725.523800252@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33323 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752275Ab0CYQZ7 (ORCPT ); Thu, 25 Mar 2010 12:25:59 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2PGPwb3008910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 25 Mar 2010 12:25:58 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2PGPvJo009249 for ; Thu, 25 Mar 2010 12:25:58 -0400 In-Reply-To: <20100324212725.523800252@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 03/24/2010 11:24 PM, Marcelo Tosatti wrote: > Which allows code to execute on remote cpus while receiving interrupts. > > Also move late smp initialization to common code, and the smp loop > to C code. > > + > +void smp_loop(void) > +{ > + void (*fn)(void *data); > + void *data; > + > + asm volatile ("hlt"); > Racy. The interrupt can happen before the hlt, which will kill the cpu. Needs to be cli while not smp_function(): sti; hlt cli sti smp_function()(smp_data()) Also need to make sure two on_cpu_noipi()s don't stomp on each other. -- error compiling committee.c: too many arguments to function