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

Re: [PATCH] xen/arm64: Fix incorrect DIRECTMAP_SIZE calculation


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 17 Jan 2023 10:50:52 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • 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=h9wkKzoKSt9RjFkmTx9EneVW25YHZ5K/J3+amcAa1ps=; b=FVe50hSLEysUI/wK4qLhXUb2S7/QFJeBJ6EIzKM1THRCo1gspZPMbmBNzseL5Sj9glJ3NSZVr4R9ZhOfVbbz0vcs2tGqL+YqzgGUeB0zNW2GXLfeTUnBRSxBc4+dn0DJmj1igHyN9ZsH4fSRJwBsmywYs85tKQpy5jLV4BKaiyxN+M89E75hBEagck7sTAiq9jhQJEHG04oMLaxD3Lgqo8MIQobCY4I+C+tWqn8T44ndYhCeZzF2zsuy3hdDQvqcMMY0kWyKXpXlZDbbxhhcl8cSzJIrca/1etsGkJSbBeEIfOQeEZ/St9iEpQAAIMUlX50eZLtURLMPFj7RmwTAJA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JYDd5v9JMrnN2CtU7SlCk8x3fWdiQ5BpV23ZWkUj1Jzq5094W2KSdEPiRrHsfiMXj6J6SgpsT4/GivP/6uuDGOWDNrFoGR6txYdPFQZRQeHLtycfcTZajsspBpJkR9lVsCOZwHB2bJ4F5kgQM4MYALQhCEunPWc+61S6tPQrCtSjbmVq9vm/lC7sxuskXSf37nFb+tQDSCWeAzo88eqHlqMwdXzFafMwLc2KPl5kCMzNEaMlHpJLP/8GFVPS054gt1DyVMvN5vgGpMe+8hJSa4OeODUGtSMp3cRZnsNhvh+eh9UeKoNfrM9/9tYIVr41HwyxWkm9qehqvtFTre0mMQ==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 17 Jan 2023 09:51:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 17/01/2023 10:35, Julien Grall wrote:
> 
> 
> Hi Michal,
> 
> It is not clear to me why this was sent In-reply-to the other patch. If
> they are meant to form a series, then this should have a cover letter +
> each patch should be numbered.
> 
> If they are truly separate, then please don't thread them.
They were meant to be separated. I will form a series for v2 to make the 
commiting easier.

> 
> On 16/01/2023 14:41, Michal Orzel wrote:
>> The direct mapped area occupies L0 slots from 256 to 265 (i.e. 10 slots),
> 
> I would write "265 included"  or similar so it shows why this is a problem.
Ok.

> 
>> resulting in 5TB (512GB * 10) of virtual address space. However, due to
>> incorrect slot subtraction (we take 9 slots into account) we set
>> DIRECTMAP_SIZE to 4.5TB instead. Fix it.
> 
> I would clarify that we only support up to 2TB. So this is a latent
> issue. This would make clear that...
Ok.

> 
>>
>> Fixes: 5263507b1b4a ("xen: arm: Use a direct mapping of RAM on arm64")
> 
> ... while this is fixing a bug, it is not going to be a candidate for
> backport.
> 
>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
>> ---
>>   xen/arch/arm/include/asm/config.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/include/asm/config.h 
>> b/xen/arch/arm/include/asm/config.h
>> index 0fefed1b8aa9..16213c8b677f 100644
>> --- a/xen/arch/arm/include/asm/config.h
>> +++ b/xen/arch/arm/include/asm/config.h
>> @@ -157,7 +157,7 @@
>>   #define FRAMETABLE_NR          (FRAMETABLE_SIZE / sizeof(*frame_table))
>>
>>   #define DIRECTMAP_VIRT_START   SLOT0(256)
>> -#define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (265-256))
>> +#define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (266 - 256))
>>   #define DIRECTMAP_VIRT_END     (DIRECTMAP_VIRT_START + DIRECTMAP_SIZE - 1)
>>
>>   #define XENHEAP_VIRT_START     directmap_virt_start
> 
> Cheers,
> 
> --
> Julien Grall

~Michal



 


Rackspace

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