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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 19B23C433F5 for ; Mon, 9 May 2022 18:30:35 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.324734.546915 (Exim 4.92) (envelope-from ) id 1no89D-0006j7-IK; Mon, 09 May 2022 18:30:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 324734.546915; Mon, 09 May 2022 18:30:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1no89D-0006j0-FD; Mon, 09 May 2022 18:30:19 +0000 Received: by outflank-mailman (input) for mailman id 324734; Mon, 09 May 2022 18:30:18 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1no89C-0006iu-4e for xen-devel@lists.xenproject.org; Mon, 09 May 2022 18:30:18 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1no89B-0003H6-Op; Mon, 09 May 2022 18:30:17 +0000 Received: from [54.239.6.187] (helo=[192.168.22.23]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1no89B-0005z6-If; Mon, 09 May 2022 18:30:17 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=1cMY2WjmVzdoY//sq9qPo+5OBr0bW9FtGCyCu7eFM8E=; b=0y/bKBGWJP3ub+/dr9ebbLLBSU Vb6OdlUn/I2bDGyJ6HyXZnh16NnVY/kXQMcjy/uGfcnwxkQuoeC9p4/KB7Kk3iRw/WMPcCGOqIM84 EyK8kudD34265ZoDrA0HjBuIvWBTyXEqj7eKrAzpVBsgIzJkEiWvjLZqLiq1q/Z81Eh0=; Message-ID: <64d47797-3789-694b-0eb5-08fc7527ff5b@xen.org> Date: Mon, 9 May 2022 19:30:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v2] xen/arm: p2m don't fall over on FEAT_LPA enabled hw To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , xen-devel@lists.xenproject.org Cc: stratos-dev@op-lists.linaro.org, Richard Henderson , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis References: <20220428103410.2723837-1-alex.bennee@linaro.org> From: Julien Grall In-Reply-To: <20220428103410.2723837-1-alex.bennee@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Alex, On 28/04/2022 11:34, Alex Bennée wrote: > When we introduced FEAT_LPA to QEMU's -cpu max we discovered older > kernels had a bug where the physical address was copied directly from > ID_AA64MMFR0_EL1.PARange field. The early cpu_init code of Xen commits > the same error by blindly copying across the max supported range. > > Unsurprisingly when the page tables aren't set up for these greater > ranges hilarity ensues and the hypervisor crashes fairly early on in > the boot-up sequence. This happens when we write to the control > register in enable_mmu(). > > Attempt to fix this the same way as the Linux kernel does by gating > PARange to the maximum the hypervisor can handle. I also had to fix up > code in p2m which panics when it sees an "invalid" entry in PARange. > > Signed-off-by: Alex Bennée > Cc: Richard Henderson > Cc: Stefano Stabellini > Cc: Julien Grall > Cc: Volodymyr Babchuk > Cc: Bertrand Marquis Acked-by: Julien Grall Cheers, -- Julien Grall