From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1booj4-0003dV-Ik for qemu-devel@nongnu.org; Tue, 27 Sep 2016 05:30:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1booiz-0004aN-Vk for qemu-devel@nongnu.org; Tue, 27 Sep 2016 05:30:57 -0400 Received: from 9.mo178.mail-out.ovh.net ([46.105.75.45]:35682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1booiz-0004a9-Pm for qemu-devel@nongnu.org; Tue, 27 Sep 2016 05:30:53 -0400 Received: from player169.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id 96F0BFF9F99 for ; Tue, 27 Sep 2016 11:30:51 +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: <403f0f67-abee-6fcd-bf69-1339623fe228@kaod.org> Date: Tue, 27 Sep 2016 11:30:30 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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 On 09/27/2016 11:10 AM, C=E9dric Le Goater wrote: >>> +#include >>> + >>> +static void xscom_complete(uint64_t hmer_bits) >>> +{ >>> + CPUState *cs =3D current_cpu; >> >> Hmm.. is current_cpu a safe thing to use in the case of KVM or MTTCG? >=20 > yes, as we are running under cpu_exec when doing this call. well, this is not true under the monitor.=20 So we will have to come up with something to handle xscom read/writes=20 from the monitor. Could we use first_cpu in that case ?=20 Thanks, C.=20 >>> + PowerPCCPU *cpu =3D POWERPC_CPU(cs); >>> + CPUPPCState *env =3D &cpu->env; >>> + >>> + cpu_synchronize_state(cs); >>> + env->spr[SPR_HMER] |=3D hmer_bits; >>> + >>> + /* XXX Need a CPU helper to set HMER, also handle gneeration >>> + * of HMIs >>> + */ >=20 > Ben,=20 >=20 > The CPU helper would be to replicate the value of the SPR_HMER in all > the threads of the core I guess ?=20 >=20 > Thanks, >=20 > C. >=20