Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F480C433F5 for ; Tue, 25 Jan 2022 10:41:40 +0000 (UTC) Received: from localhost ([::1]:44092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCJGd-00044Q-6U for qemu-devel@archiver.kernel.org; Tue, 25 Jan 2022 05:41:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCJDF-0000m9-UL for qemu-devel@nongnu.org; Tue, 25 Jan 2022 05:38:10 -0500 Received: from smtpout4.mo529.mail-out.ovh.net ([217.182.185.173]:56897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCJDC-00073k-Dh for qemu-devel@nongnu.org; Tue, 25 Jan 2022 05:38:09 -0500 Received: from mxplan5.mail.ovh.net (unknown [10.108.20.240]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 840A9D9DDC2E; Tue, 25 Jan 2022 11:38:01 +0100 (CET) Received: from kaod.org (37.59.142.97) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 25 Jan 2022 11:38:00 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-97G002c3819104-9d13-481c-9312-47b94da6ccb8, 81DEFC5675B4A2B0B4575F732D37872089199EF9) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: <369019d6-7d60-80c6-e6f5-0a171be510c2@kaod.org> Date: Tue, 25 Jan 2022 11:38:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH qemu] spapr: Force 32bit when resetting a core Content-Language: en-US From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= To: Peter Maydell , Alexey Kardashevskiy References: <20220107072423.2278113-1-aik@ozlabs.ru> <423c655a-b87f-9d08-208a-2e73196adfbc@kaod.org> In-Reply-To: <423c655a-b87f-9d08-208a-2e73196adfbc@kaod.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.97] X-ClientProxiedBy: DAG9EX2.mxp5.local (172.16.2.82) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: db550de8-54f1-4e7d-ba1f-afc60883881b X-Ovh-Tracer-Id: 15206685620058229609 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrvdelgdduiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuhffvfhgjtgfgihesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeeihfefffffgedtkeegtdekffevudeggfegffethfffhefhhfevhfdtudejhfdvieenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddrleejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhnsggprhgtphhtthhopedupdhrtghpthhtohepghhrohhugheskhgrohgurdhorhhg Received-SPF: pass client-ip=217.182.185.173; envelope-from=clg@kaod.org; helo=smtpout4.mo529.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Henrique Barboza , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson , Greg Kurz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 1/19/22 12:05, Cédric Le Goater wrote: > On 1/16/22 17:45, Peter Maydell wrote: >> On Fri, 7 Jan 2022 at 07:29, Alexey Kardashevskiy wrote: >>> >>> "PowerPC Processor binding to IEEE 1275" says in >>> "8.2.1. Initial Register Values" that the initial state is defined as >>> 32bit so do it for both SLOF and VOF. >>> >>> This should not cause behavioral change as SLOF switches to 64bit very >>> early anyway. As nothing enforces LE anywhere, this drops it for VOF. >>> >>> The goal is to make VOF work with TCG as otherwise it barfs with >>> qemu: fatal: TCG hflags mismatch (current:0x6c000004 rebuilt:0x6c000000) >> >> If you get this assert it means that something is changing >> the CPU state and not calling the function to recalculate >> the hflags (which are basically caching part of the CPU state). >> So I don't know whether this patch is correct or not in updating >> MSR bits, but in any case I think it is only masking the >> missing-hflags-update that is causing the assertion... > > > yes. Currently, spapr_vof_reset() is called from the pseries > machine reset handler and modifies brutally the MSR without > calling hreg_compute_hflags()to update the hflags. Hence > the warning. > > The proposal moves the MSR update under the pseries CPU reset > handler: spapr_reset_vcpu() where it should be. spapr_reset_vcpu() > also updates the LPCR register and calls hreg_compute_hflags() > when done. > > The question we all had was why it was set to 64bit initially > by commit 8b9f2118ca40 which seems to be in contradiction with > the PAPR specs saying the CPUs should start in 32bit mode. > It is not clear but I didn't see any regression on pseries or > on the macbook machine using 970 CPUs. I think we are fine. With that said, Reviewed-by: Cédric Le Goater Thanks, C.