From patchwork Tue Dec 17 11:17:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3360691 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 350FDC0D4A for ; Tue, 17 Dec 2013 11:18:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 269BB2034F for ; Tue, 17 Dec 2013 11:18:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86B122034D for ; Tue, 17 Dec 2013 11:18:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751256Ab3LQLSK (ORCPT ); Tue, 17 Dec 2013 06:18:10 -0500 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 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.13.6/8.13.6) with ESMTP id rBHBHvnW020414; Tue, 17 Dec 2013 12:17:57 +0100 Received: from mchn199C.mchp.siemens.de ([139.25.40.156]) by mail1.siemens.de (8.14.3/8.14.3) with ESMTP id rBHBHvc0023390; Tue, 17 Dec 2013 12:17:57 +0100 Message-ID: <52B032E5.6080203@siemens.com> Date: Tue, 17 Dec 2013 12:17:57 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Paolo Bonzini CC: Gleb Natapov , kvm , Arthur Chunqi Li Subject: [PATCH v2 06/15] lib/x86/smp: Fix compiler warnings References: <52B028D7.6060405@redhat.com> In-Reply-To: <52B028D7.6060405@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;