Received: from eggs.gnu.org ([2001:4830:134:3::10]:44047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBbCX-0002ma-IQ for qemu-devel@nongnu.org; Thu, 26 Apr 2018 03:20:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBbCS-0006TQ-RO for qemu-devel@nongnu.org; Thu, 26 Apr 2018 03:20:21 -0400 Received: from 1.mo2.mail-out.ovh.net ([46.105.63.121]:35451) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBbCS-0006T0-KU for qemu-devel@nongnu.org; Thu, 26 Apr 2018 03:20:16 -0400 Received: from player774.ha.ovh.net (unknown [10.109.122.114]) by mo2.mail-out.ovh.net (Postfix) with ESMTP id 2282612F7B2 for ; Thu, 26 Apr 2018 09:20:14 +0200 (CEST) References: <20180417071722.9399-1-david@gibson.dropbear.id.au> <20180417071722.9399-4-david@gibson.dropbear.id.au> <20180426064600.GI8800@umbus.fritz.box> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <5f09ca4d-3c01-7e89-fa87-6340060cf579@kaod.org> Date: Thu, 26 Apr 2018 09:20:11 +0200 MIME-Version: 1.0 In-Reply-To: <20180426064600.GI8800@umbus.fritz.box> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH for-2.13 03/10] target/ppc: Remove unnecessary initialization of LPCR_UPRT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: groug@kaod.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 04/26/2018 08:46 AM, David Gibson wrote: > On Wed, Apr 25, 2018 at 11:52:18AM +0200, C=E9dric Le Goater wrote: >> On 04/17/2018 09:17 AM, David Gibson wrote: >>> In cpu_ppc_set_papr() the UPRT and GTSE bits of the LPCR are initiali= zed >>> based on on ppc64_radix_guest(). Which seems reasonable, except that >>> ppc64_radix_guest() is based on spapr->patb_entry which is only set u= p >>> in spapr_machine_reset, called much later than cpu_ppc_set_papr(). >>> >>> So the initialization here is pointless. The base cpu initialization >>> already sets a value that's good enough until the guest uses an hcall= to >>> configure it's preferred MMU mode. >>> >>> Signed-off-by: David Gibson >>> --- >>> target/ppc/translate_init.c | 16 ---------------- >>> 1 file changed, 16 deletions(-) >>> >>> diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.= c >>> index bb79d23b50..14f346f441 100644 >>> --- a/target/ppc/translate_init.c >>> +++ b/target/ppc/translate_init.c >>> @@ -8897,22 +8897,6 @@ void cpu_ppc_set_papr(PowerPCCPU *cpu, PPCVirt= ualHypervisor *vhyp) >>> lpcr->default_value &=3D ~LPCR_RMLS; >>> lpcr->default_value |=3D 1ull << LPCR_RMLS_SHIFT; >>> =20 >>> - if (env->mmu_model =3D=3D POWERPC_MMU_3_00) { >>> - /* By default we choose legacy mode and switch to new hash o= r radix >>> - * when a register process table hcall is made. So disable p= rocess >>> - * tables and guest translation shootdown by default >>> - * >>> - * Hot-plugged CPUs inherit from the guest radix setting und= er >>> - * KVM but not under TCG. Update the default LPCR to keep ne= w >>> - * CPUs in sync when radix is enabled. >>> - */ >> >> >> This is breaking CPU hotplug under TCG. Should we reintroduce the same= =20 >> settings in spapr_cpu_reset() now ? >=20 > Sod. Yeah, this code is important for the hotplug case. >=20 > But, no, I don't think it should go into reset, I think it should go > into the rtas start-cpu path; it only makes sense for secondary CPUs. yes. I will send a fix. Thanks, C.=20