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

Re: [PATCH v4 3/6] xen/arm: mpu: Define Xen start address for MPU systems


  • To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Mon, 28 Oct 2024 14:53:28 +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=arm.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=arcselector10001; 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=RDV2MuxSOjmSu3hnr2329r1eV0r7BKaDaT+KbCMEKj4=; b=elgNKmZRZvHg337ACMfAPVfOm7zPF/eHEkBwZFrx4VZht8MuQHa5vusJTvddOMm+MBGt41ahKaRd2l7wIjUlgWy9GcNvPVmkFgXDxAJ942wiZLfO0HIqkQghJDGNLqVuyWMXYQqLhi/GLwgkFUJ1BGkrT+znYvxFVSgRBUIcLjKoFPLTyLVH3QQRc8cXVU2UA0o5Cah7JB4CL5fBAboQxquDg0mGS/A8HNtYkcCqL7PXggF8jrXl0jOyab1Jn9Ni0giBt6CsDZg5lICWyAkIm/EcH8V3q+NfAsttrTV4OUtNQZ8wJlsP+wyGloFHd+qZEVKvD54FEZLh2L6D1vkPTA==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=RDV2MuxSOjmSu3hnr2329r1eV0r7BKaDaT+KbCMEKj4=; b=qEH3QQS02/K96IZMJtJqYSHgC7LLsgju2sRb01D3OMhPvD7TwNMqVLQ4e33H7bGGwqQcZ6wWTsnffR8zB+qudQds6g0MFyErGe3m2dIFTy33Lr9CvnqdUnR41nzFAj0fpK03Bh/bp4Twvv4f3455hL7fj8QN00tG0NryhAQjH5br1geLYx/C9TQ58wHPwPt3GM3BhJznmBGmZRVhrNnGSdoIYrULdeF1cO+AWbes95A2GvI0UYanE2jRub0S/uXfd16Nt9F92CmmqQ1dcYV3sUJD+JbYTE18kimO116zsrphUDvZCD0LlZb21ZtxrrVmhrLoIWZ9w2pQqenjcVU+OA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=zWAY1N7TSU52xBiDmLytHgvkhlyOlZwtoxlWJEbRrjRc0mK7yfNqlIekM8tTrc3jECfE0yD1p7JrRrsKiwM5HLN0LcQVC6LCD2hZzDu4fvcVTTz63ihdqHMrQkVtJXcx/lWZ5jysOxXII3JjAynzDOoC0fMh7mNQCUbdOlvpChLAu1B+of5y9PWTlaedhVMbzmSie0S8t2iHP4WfGOJIaLrsxzcywRzc6Kb687Oc9L8jH113OBmcrWwEypGXqq+saLPpOUH1urDM/l0uTcrq+AbaoN1QlPtHUm0szoJGWxmx8NhDDg4/O+Nyl0R2971QC15xoINXew1rsdcS919myQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vp2axopoY6TYRo7RLH6jioYJFwMjs8+Aw7zcdvbGs+d1tUjEQiwxQPqHJFCz0GX2fTZzRmppfgRmqnI3tCNyCaP41trepmd9gwDvXbUd/CnEq7YIZy7wdEyiGwXrCOI035W0UQS6zWJkSH1eVsDYDuSF0FnZ5eNi3dVSzUNmqleOA5ofcwBR29WD4vKNUw4IcGg/DqrvRqQ+5mViPXlHXG1zcCmGvoBiQuH6wvopju4gMQUy76CJBwZEO56kvU1rEpxrhlANw1mCf8E1fMgv9nnaXCnOYHsDyA0H0m0ZiJA/n7f+HXNl6bW2zNG43ao7HwPcHsot9F/4d/4hIJIfSw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jiamei Xie <Jiamei.Xie@xxxxxxx>
  • Delivery-date: Mon, 28 Oct 2024 14:53:58 +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: AQHbKTd0Vc85q9/6SUW4ygKFCDwj9bKcP8+A
  • Thread-topic: [PATCH v4 3/6] xen/arm: mpu: Define Xen start address for MPU systems

Hi Ayan,

> On 28 Oct 2024, at 12:45, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx> wrote:
> 
> From: Wei Chen <wei.chen@xxxxxxx>
> 
> On Armv8-A, Xen has a fixed virtual start address (link address too) for all
> Armv8-A platforms. In an MMU based system, Xen can map its loaded address to
> this virtual start address. So, on Armv8-A platforms, the Xen start address 
> does
> not need to be configurable. But on Armv8-R platforms, there is no MMU to map
> loaded address to a fixed virtual address and different platforms will have 
> very
> different address space layout. So Xen cannot use a fixed physical address on
> MPU based system and need to have it configurable.
> 
> So, we introduce a Kconfig option for users to set the start address. The 
> start
> address needs to be aligned to 4KB. We have a check for this alignment.
> 
> MPU allows us to define regions which are 64 bits aligned. This restriction
> comes from the bitfields of PRBAR, PRLAR (the lower 6 bits are 0 extended to
> provide the base and limit address of a region). This means that the start
> address of Xen needs to be at least 64 bits aligned (as it will correspond to
> the start address of memory protection region).
> 
> As for now Xen on MPU tries to use the same memory alignment restrictions as 
> it
> has been for MMU. We have added a build assertion to ensure that the page size
> is 4KB. Unlike MMU where the starting virtual address is 2MB, Xen on MPU needs
> the start address to be 4KB (ie page size) aligned.
> 
> In case if the user forgets to set the start address, then 0xffffffff is used
> as default. This is to trigger the error (on alignment check) and thereby 
> prompt
> user to set the start address.
> 
> Also updated config.h so that it includes mpu/layout.h when CONFIG_MPU is
> defined.
> 
> Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> Signed-off-by: Jiamei.Xie <jiamei.xie@xxxxxxx>
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
>

Looks good to me

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



 


Rackspace

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