[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] xen/arm: p2m don't fall over on FEAT_LPA enabled hw


  • To: Alex Bennée <alex.bennee@xxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 3 May 2022 13:45:39 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O0S4P+wMGdro3ettmemfnoQoqv10broPkU6qZu3+1Tw=; b=TR5cu4ol6CQoKLOkgUtMDfXbSPTCrtOWT1Nl0NMcQ2Qu1k4Q+KNyt4curr7tu9jNhaLv+WBqpP6qo7H3tPCh+4INoekKgnpPSrYZrd9gmakDHbJ3SzFfRkniOqJ5X3WYcLQEl+kDgR80rwqDlEuXXoEapTHljUz/41/SH0qDBHZT6drSgyDlaBo+EDfjzvPkXNCcEsl8lqU7gmRo9ixhbAjSoFnMod5+8mxyVRt7WUXpLbrTKhP7RTtg68L9gDqnUWWVKfW6jdYnUzzUVqOTtSjFFaoqtiIj16FkY1Muj3p3obOyCCKktca+cnaDpBnfkB8ij3uHDPxCkAvuRnWM1w==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O0S4P+wMGdro3ettmemfnoQoqv10broPkU6qZu3+1Tw=; b=FXf0IaBZxjZF5NiPW/lQJB97UusdfwStTzrSGiEf5lgXav7xmADXrXNd6ykf7LBSf5H1TEQrqfbK/c0RUyEANLqtPekAcHWe213rCFni+fK+oHu9swR2F9D5ixF8XyF9n6S05HjDLsbPiQs3cYVtdtt8cFKrlVim+OR5gN3LRXQXHEOCd53Rp4Jonp+bVdPw1D5sh37soSMEKGA8q6k2Y9QwdZhxlklRNxKsbzpuqXqzy35QmqyPF05+9ueyAe4shaZxkb8h0TGPSuiAt30eVityegE9+0hjnrYpnPBlFP+/+FCMTDIekgY2YR/uhECLhyFG2tNfz5au6uZx7agXgw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=QSUPa9hpkPN+X5xVNNmvVxIAJX7WT8bQ5EJKvCflhOqXt+cdC7RN/+Gsf3GSCBQrG900UomTHnOIF0YwT7X3EMBYSSTf1N5K2l0tFvGoiP0LB4NZFVGPdH2fCRx0ZsWzoNgaHOyPXaz0LBIr9CXsq0akGNveZCZcvHqRtn/5sk3C+Br6eMGmkRfW9RdO7NL4nbkdtyOUYBXCwgihHpzo5hWIeizdDGQrZ+TtJtCAQQEcGE5BOCeLMlQ5QQRWzj9idRqOpgvE3UpdzQS3KolSTLqOISM6V1Dn1mQ310Svu12FzniLxf53zvQanPGml0wOU4ViQbDojptpn1w3yGzegg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TOmK0G6keQWmkX+9VLUG8SL3pATwel/Y3pIcTA2uc/yBRZuHVryUDY/NS4pHgsM8vfrpIjpyJBlO/jFq1JgCLWQAKmgmmbVLRbs4hEmbb78SjM3rN+PxkCG1+U40+KZNjX5E5jxhur2+Hvh2VJrWauPJABY5C/Vb1NrcfXDtuc1BH11jZkkXe//RnEgDA4lkO/AZg//wvwGtKRHfWuo4VOQjkPDJErRPW4m/1WkC0WAedTrr5DKQE5aOja5me2MwyBZ115udfN/Zs+keujIJb33jXwwfi6+D3rsVkel9F1fZvPpGOLotGdwwbo+7Zf8rqBZs3LoljAvKtgpQDO4GqQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "stratos-dev@xxxxxxxxxxxxxxxxxxx" <stratos-dev@xxxxxxxxxxxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Tue, 03 May 2022 13:46:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYWuuXqjHgGotG8UqKAs+V57fbVK0NMk6A
  • Thread-topic: [PATCH v2] xen/arm: p2m don't fall over on FEAT_LPA enabled hw


> On 28 Apr 2022, at 11:34, Alex Bennée <alex.bennee@xxxxxxxxxx> 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 <alex.bennee@xxxxxxxxxx>
> Cc: Richard Henderson <richard.henderson@xxxxxxxxxx>
> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Cc: Julien Grall <julien@xxxxxxx>
> Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>
> 
> ---
> v2
>  - clamp p2m_ipa_bits = PADDR_BIT instead
> ---

Hi Alex,

I’ve tested the patch on fvp and Xen+Dom0 runs fine.

Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>

Cheers,
Luca


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.