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

Re: [XEN PATCH v7 08/20] xen/arm: ffa: note dependency on 4k pages


  • To: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 24 Feb 2023 15:27:11 +0000
  • Accept-language: en-GB, en-US
  • 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=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=sLuA7n4YeEA5pGgCF0/yJiUAM9VSnZKIFtqScOmWx7M=; b=m0+DME/CRTbKBHjyRAFtuWMACP0F8p2nx3JKonv57xCpMG6nhseN+NogUlRwOys8u9tbf5r3xShlqzaoH9q2hO0km7mujuXFA4It0r09Aim8ke8z4QgNS2eLuA6yx1ANSdWl/S9SW0rVYS17IP6rE31ysmkIlMZ5GOmMnfszRBVAry9nn3vaZDheAyQiDJiIP7KvKFDGv/EN/5xMIbwg8V9WD74/xKahfq/p1Cr4CsNaWidhGyUkTuLiWoX8fjfub8y0zojcAAvMg8zhFbP5Xcs5SddGy71EkXMCD6XO128JlY8lu0uGwNmaqv8EBTyli7JxmFBl3ryCdqqmYr9CEA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H31qi+I9XJD6mPOnIVqaZvT/RaqovVXTqlw83FBVm7Q/fwznVzXlV5oUGRYOjL9mjAGHYdVoXkFDALUKHoQCs5xe4E+SJEZhoHmkRzLDrwHZImA5LTO7QOcSjBuvdqBYAPvGNNNCjRa0D5GyNrI1j1AXFVGxa7fdASZdFepQKj3FnLAGkcR5gL0E/3y9vowkz/5kV3+itZ6FVNs6LuxahxlMV7oakRqY3F8SH6VR86KIcMo1j9zM0fYNLdvk1N5EPBRbhoYLSFtCugtAKlVLt8JYid+RTPwqxRUF4d95HhfRsShxzdVYSedIVpBzD+LUOu8x9G0/MHXKn9y3gOHfjA==
  • 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>, Marc Bonnici <Marc.Bonnici@xxxxxxx>, Achin Gupta <Achin.Gupta@xxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Fri, 24 Feb 2023 15:27:57 +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: AQHZRtMZN0hUXh0yA0u/TS4KHErP767eOzoA
  • Thread-topic: [XEN PATCH v7 08/20] xen/arm: ffa: note dependency on 4k pages

HI Jens,

> On 22 Feb 2023, at 16:33, Jens Wiklander <jens.wiklander@xxxxxxxxxx> wrote:
> 
> Adds a BUILD_BUG_ON() to assert the dependency on 4k pages in the FF-A
> mediator.
> 
> Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>

NIT: I would s/note/enforce/ in the title:
xen/arm: ffa: enforce 4k pages

Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
> 
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index d04bac9cc47f..8b0b80ce1ff5 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -56,6 +56,16 @@
> #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
>                                                  FFA_MY_VERSION_MINOR)
> 
> +/*
> + * The FF-A specification explicitly works with 4K pages as a measure of
> + * memory size, for example, FFA_RXTX_MAP takes one parameter "RX/TX page
> + * count" which is the number of contiguous 4K pages allocated. Xen may use
> + * a different page size depending on the configuration to avoid confusion
> + * with PAGE_SIZE use a special define when it's a page size as in the FF-A
> + * specification.
> + */
> +#define FFA_PAGE_SIZE                   SZ_4K
> +
> /* Framework direct request/response */
> #define FFA_MSG_FLAG_FRAMEWORK          BIT(31, U)
> #define FFA_MSG_TYPE_MASK               0xFFU;
> @@ -242,6 +252,17 @@ static bool ffa_probe(void)
>     unsigned int major_vers;
>     unsigned int minor_vers;
> 
> +    /*
> +     * FF-A often works in units of 4K pages and currently it's assumed
> +     * that we can map memory using that granularity. See also the comment
> +     * above the FFA_PAGE_SIZE define.
> +     *
> +     * It is possible to support a PAGE_SIZE larger than 4K in Xen, but
> +     * until that is fully handled in this code make sure that we only use
> +     * 4K page sizes.
> +     */
> +    BUILD_BUG_ON(PAGE_SIZE != FFA_PAGE_SIZE);
> +
>     /*
>      * psci_init_smccc() updates this value with what's reported by EL-3
>      * or secure world.
> -- 
> 2.34.1
> 




 


Rackspace

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