From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: [PATCH v2 06/15] lib/x86/smp: Fix compiler warnings Date: Tue, 17 Dec 2013 12:17:57 +0100 Message-ID: <52B032E5.6080203@siemens.com> References: <52B028D7.6060405@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , kvm , Arthur Chunqi Li To: Paolo Bonzini Return-path: Received: from david.siemens.de ([192.35.17.14]:17581 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140Ab3LQLSI (ORCPT ); Tue, 17 Dec 2013 06:18:08 -0500 In-Reply-To: <52B028D7.6060405@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2013-12-17 11:35, Paolo Bonzini wrote: > Il 16/12/2013 10:57, Jan Kiszka ha scritto: >> Add missing include of desc.h for prototypes of setup_idt and >> set_idt_entry and cast away the volatile of ipi_data - it's not volatile >> while we run the IPI handler. >> >> Signed-off-by: Jan Kiszka > > The right fix is to change the declaration from > > static volatile void *ipi_data; // Pointer to volatile void > > to > > static void *volatile ipi_data; // Volatile pointer to void Indeed, find v2 below. Jan ---8<--- Add missing include of desc.h for prototypes of setup_idt and set_idt_entry and adjust type of ipi_data to what it should actually be: a volatile pointer the a void. Signed-off-by: Jan Kiszka --- lib/x86/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/x86/smp.c b/lib/x86/smp.c index d4c8106..1eb49f2 100644 --- a/lib/x86/smp.c +++ b/lib/x86/smp.c @@ -3,6 +3,7 @@ #include "smp.h" #include "apic.h" #include "fwcfg.h" +#include "desc.h" #define IPI_VECTOR 0x20 @@ -10,7 +11,7 @@ typedef void (*ipi_function_type)(void *data); static struct spinlock ipi_lock; static volatile ipi_function_type ipi_function; -static volatile void *ipi_data; +static void *volatile ipi_data; static volatile int ipi_done; static volatile bool ipi_wait; static int _cpu_count; -- 1.8.1.1.298.ge7eed54