From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1booPI-0002V3-Ri for qemu-devel@nongnu.org; Tue, 27 Sep 2016 05:10:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1booPD-0005pg-Hv for qemu-devel@nongnu.org; Tue, 27 Sep 2016 05:10:32 -0400 Received: from 9.mo178.mail-out.ovh.net ([46.105.75.45]:48852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1booPD-0005p4-B6 for qemu-devel@nongnu.org; Tue, 27 Sep 2016 05:10:27 -0400 Received: from player169.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id D2269FF9154 for ; Tue, 27 Sep 2016 11:10:25 +0200 (CEST) References: <1473943560-14846-1-git-send-email-clg@kaod.org> <1473943560-14846-8-git-send-email-clg@kaod.org> <20160921060845.GC20488@umbus> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: Date: Tue, 27 Sep 2016 11:10:21 +0200 MIME-Version: 1.0 In-Reply-To: <20160921060845.GC20488@umbus> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 07/10] ppc/pnv: add XSCOM infrastructure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: qemu-ppc@nongnu.org, Benjamin Herrenschmidt , qemu-devel@nongnu.org >> +#include >> + >> +static void xscom_complete(uint64_t hmer_bits) >> +{ >> + CPUState *cs = current_cpu; > > Hmm.. is current_cpu a safe thing to use in the case of KVM or MTTCG? yes, as we are running under cpu_exec when doing this call. >> + PowerPCCPU *cpu = POWERPC_CPU(cs); >> + CPUPPCState *env = &cpu->env; >> + >> + cpu_synchronize_state(cs); >> + env->spr[SPR_HMER] |= hmer_bits; >> + >> + /* XXX Need a CPU helper to set HMER, also handle gneeration >> + * of HMIs >> + */ Ben, The CPU helper would be to replicate the value of the SPR_HMER in all the threads of the core I guess ? Thanks, C.