From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsAGd-00037s-Hd for qemu-devel@nongnu.org; Wed, 04 Jun 2014 08:26:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsAGU-0000Bb-Fg for qemu-devel@nongnu.org; Wed, 04 Jun 2014 08:26:07 -0400 Message-ID: <538F104F.5070600@gmail.com> Date: Wed, 04 Jun 2014 07:25:51 -0500 From: Tom Musta MIME-Version: 1.0 References: <1401787684-31895-1-git-send-email-aik@ozlabs.ru> <1401787684-31895-22-git-send-email-aik@ozlabs.ru> <538E0101.3030605@gmail.com> <538E867F.5060002@ozlabs.ru> In-Reply-To: <538E867F.5060002@ozlabs.ru> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 21/29] target-ppc: Enable FSCR facility check for TAR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Alexander Graf On 6/3/2014 9:37 PM, Alexey Kardashevskiy wrote: > On 06/04/2014 03:08 AM, Tom Musta wrote: >> On 6/3/2014 4:27 AM, Alexey Kardashevskiy wrote: >>> This makes user-privileged read/write fail if TAR facility is not enabled >>> in FSCR. [ ...] >>> >> >> There are potential impacts to user mode here. If I am reading correctly, TAR would not be accessible >> in user mode. > > > And this is bad why exactly? I definitely need to learn about linux-user > more... > Because TAR and bctar are Book I additions to ISA 2.07 and thus we can expect them to show up in applications. Since FSCR is not user-writeable, if FSCR[TAR] is initially zero, there is no means to enable access. Any application using bctar would not run. > >> An obvious fix would be to initialize FSCR to enable TAR access in the user mode build targets. > > > Like that? > > static void gen_spr_power8_fscr(CPUPPCState *env) > { > +#if defined(CONFIG_USER_ONLY) > + target_ulong initval = 1ULL << FSCR_TAR; > +#else > + target_ulong initval = 0; > +#endif > spr_register_kvm(env, SPR_FSCR, "FSCR", > SPR_NOACCESS, SPR_NOACCESS, > &spr_read_generic, &spr_write_generic, > - KVM_REG_PPC_FSCR, 0x00000000); > + KVM_REG_PPC_FSCR, initval); > } > > Yes. I believe that would work.