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

Re: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions


  • To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Wed, 30 Oct 2024 09:16:57 +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=g7bUOrtY76Iolpt9WJajCbUXNXJEVthI08g2e8pk478=; b=ZDXjJV/cM8Msft72s+uZVAfNhtcYW+T/eNxMxTsXmSZXZaG5UlZwyGAd/o0nqZNunnHDY1wJtiLt3hL8pE47yLG6H5wh9/kjEjlDgYY+1hWK6lQDdlhCo/zJ9a2fTgalRDx5dn8jJ/e0dd+lk5Q8WxblCIErVIOEZyKTagYP1L5rVGGhXK3JRttMmXyXln2SjNAVI6mlGKxEvY9M/rb3829GfiN/+4Fnulsil7WPthbUemYQsGcdclGUtv5eKur4L9hRLNwtTKsRL/vhuOuXlqfTBAPZPUnRwEA4a2ZityCKHKb0A13g961+4auIZjQr+zQuB3M+KSN+siIRwGGiTA==
  • 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=g7bUOrtY76Iolpt9WJajCbUXNXJEVthI08g2e8pk478=; b=MCzwwLuUyinZkgrhxPiWn3L77Ya9/zMrnyAxxW2BX5yhFVdMVRq4rTEzq9A/GvqnENrxqbeD5ThVUpy/haVm7YTiLZbv9rgzLfnkDgRqkIwLtJ2j0INLF8vqPGP92eTmV0yPUIe8YJe2EqsxaCD1vm5kRFOMjBsm7QJCDRcVLApqvnd703db6XL5pvejEMPICLokuqaC2xWTw8k2z1FqY7t1R3bWBU3r6+VCG6ibZwiwgIV7M7fCRRTf37zHRbQkScRH6vrWEZQcubLe6qTdsvSc7MRhDEQJ2s+YhxUxM3NE6i5aJ15T0CtVNgKtQhZcZ7u4E/hgK9HBk6TA3sIKMg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=wZM8DFpMqyehzUt9/DMFitHu+o2g4jyziu2N7AcfHzIH0+TDU2MS177i1dIZUTgTPGFsxyP5C+D+0jY2tMKMbXiQSEtzENrLw2+1z0sv6bR55ZXiFgA5wCQFnrAHprZvnDGnlnFz/iyd6qGV0+UaNKFIlbj+8aV3LsnzgNyaGweuZ8j1+7NHgFOTripIIbWtPzvtIFmSpHBxbCSjURFrC6hRKQ8Pk+75IZ6UjbdQnoGCwiBTH0Re+ECaDtf4aCaNX9tW1YQ1Hd45mjFbtEbyqoZ7pyLKoDPKf9Tdsuy/DFdSkc7/WN07/m5ZnR9uqhSLsc0QajX9hf8t8/x1mBMmMA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o3YfWKBS1odu4fwHPmYOvgc1wo7GAd0cL3HCgb7iii8x8L8JaQabuQ++7QzvwEXY4ocOYRSDVOAnhE5swsuvfaBRINsMUie/SN1ba3rxNbXSW12Q2d7aaXivx8Qfps3lWPN1f1Dx9m6S7IysaGa8Qyi1drHZPGefMEUqQFydFevbnLLkslowHBVzxpKsLteA+2fiU3lMrM6vdvGCSctXthPAshZRPZ7AvjJJHNwpGs/iCsjIo67yI64AXV0YLxjcc4ju1QwnC7BNQdpGluMx3K0Gyd1/37jKDhvcgOhp/DpBc9vUXYCmwe8AZS1Xx038bOToOzoyxJcpi5rmARDQpg==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 30 Oct 2024 09:17:23 +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: AQHbKTd3r9ds8GMpC0a1KoGz65CsELKfBnMA
  • Thread-topic: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions

Hi Ayan,

While I rebased the branch on top of your patches, I saw you’ve changed the 
number of regions
mapped at boot time, can I ask why? 

Compared to 
https://patchwork.kernel.org/project/xen-devel/patch/20230626033443.2943270-25-Penny.Zheng@xxxxxxx/:

> +FUNC(enable_boot_cpu_mm)
> +
> +    /* Get the number of regions specified in MPUIR_EL2 */
> +    mrs   x5, MPUIR_EL2
> +
> +    /* x0: region sel */
> +    mov   x0, xzr
> +    /* Xen text section. */
> +    ldr   x1, =_stext
> +    ldr   x2, =_etext
> +    prepare_xen_region x0, x1, x2, x3, x4, x5, attr_prbar=REGION_TEXT_PRBAR
> +
> +    /* Xen read-only data section. */
> +    ldr   x1, =_srodata
> +    ldr   x2, =_erodata
> +    prepare_xen_region x0, x1, x2, x3, x4, x5, attr_prbar=REGION_RO_PRBAR
> +
> +    /* Xen read-only after init and data section. (RW data) */
> +    ldr   x1, =__ro_after_init_start
> +    ldr   x2, =__init_begin
> +    prepare_xen_region x0, x1, x2, x3, x4, x5

         ^— this, for example, will block Xen to call init_done(void) later, I 
understand this is earlyboot,
               but I guess we don’t want to make subsequent changes to this 
part when introducing the
               patches to support start_xen()

> +
> +    /* Xen code section. */
> +    ldr   x1, =__init_begin
> +    ldr   x2, =__init_data_begin
> +    prepare_xen_region x0, x1, x2, x3, x4, x5, attr_prbar=REGION_TEXT_PRBAR
> +
> +    /* Xen data and BSS section. */
> +    ldr   x1, =__init_data_begin
> +    ldr   x2, =__bss_end
> +    prepare_xen_region x0, x1, x2, x3, x4, x5
> +
> +    ret
> +
> +END(enable_boot_cpu_mm)

I suggest to keep exactly the regions as are in Penny’s patch.

Cheers,
Luca

 


Rackspace

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