[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU
- To: Ayan Kumar Halder <ayankuma@xxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Mon, 21 Oct 2024 16:24:41 +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=KDnD/43S0t9dyaAndg3CRk1IIb+YgmQLM873xTrWWZ8=; b=bcZaUhFCUtBYDcF9VX75qrKzEDetel3q4sJkR+1/49zZ/M2JC6L4VtlrDg3U3uw6SlbXOSy7NU/M7zCtk8h2XURY5YxELGmItuGaQddxIWT/DEbvOFY4Omp7uy2AROhImvVdxkapRBv4EU0VaGBMs90BRCXp5l0urOIwm7r99aCDxx/O8G3+7Pn9xLgUdAHMWa2GH5acXlYfDZbJ2H9i9hTZdc1VCzsc6jZYvbGr0kYc/kvhFmAvx4WXs44+PxwYYHpL58VwKO1hz/nvthvE2Dr6G8wqmZmt3kSOk7Lnhp2p3T/j6qeLTJHZou0xQptBmX8OSZcmlrCpsI/10Jfdmg==
- 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=KDnD/43S0t9dyaAndg3CRk1IIb+YgmQLM873xTrWWZ8=; b=NVhwCwU72KivbitDcWoZHpHGyYQGWlsKYJ1BbnjTkqc9YYWxNtH3lXkgFUQswGTqTeK2WioNSwGt22vcy6Kckkgvl8SaQ9hGRTxMlth6t6aGl36oEm5a0oZIWm1YuWt+bNltuG//wrn/Lf51uAskDpIgf81dnCUmkAQIW6AX6eYLZS3HCgP9HXeZEjr+2+pcuxCBoYEfCNM9gix5I/4wpcqnICkV0jKMdBeA6wnF/2fv7mOgGqMMI3PCbRR3fPGBPigBKZeMln6irVoTtA/MVVKS3jPfxFLnhHumTfm75KMbbTrnaBR1mQTChuOQcSiCrfae9XNND4aBleSlXwwTlA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=PjwwPgKG2+WnRLoZNtQiEx4v4VhNllxsSy/73F9snJfyVnzo8vMnjSmRmCuqa3s7Vs33HaeS1h19gvBJx1gxObxqe1hig41rQPl5insmV3NHLpyJRfBmbjBveXssQKDlU0CZhQ5qkAe4bwlF6nD2HSJMQ8WHO8dRPplyUbUoztknIQTCNeeAZm+c4udbNzz0j9Mbu7wjysj4p9O39cntD8TsWksvYCQ7dEdN4d3k1Ge2uPkIupQJwPRr0yX5OouveZyfQvOkTa2Wi0or2BtWWBwFg4IwzQZaJOKmXMuKotM4Da5FCTR1UWrvivh56fZy7lAMQoImm8miKyaQSeRS+g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KqPt8sio7Rk7GYcf4/Q1VY6PBX4dasBO8wwPjTYDWwzmiUn4sRTOGmaUAivYNpqXZxiZ8wbdOeW4aatLi8kT13wmrJORYn3FK3wQcI5jznhQUJJuvmopYBOaEzRg5ykmAgIwAzD1tiufXK2YqzyNV9FL3Mk8WOVSMrPJ0y6E8moyVMEI7FP2RDioRbzrLkEf0VK3lC0LLx4nw/CMz8hDb4ojP2BDNpK1K/LpM0RRmSpEn/gjwDv68LlArB6Lb4l0F6SiEKgIEHmFU/6ZdgrCC5hDMN2wnWYXWgyhW/j1++xvppeyLRd8u55EoUx/0c6bW2KJ0HxXCtbDrgYlgzPrbg==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Mon, 21 Oct 2024 16:25:20 +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: AQHbGx2Ge9N55hTx/U2iD9lYiTVQprKNIysAgARC6gCAAA8agA==
- Thread-topic: [PATCH v3 5/6] xen/arm: mpu: Enable MPU
Hi Ayan,
>>> + */
>>> +FUNC_LOCAL(enable_mpu)
>>> + mrs x0, SCTLR_EL2
>>> + bic x0, x0, #SCTLR_ELx_BR /* Disable Background region */
>>> + orr x0, x0, #SCTLR_Axx_ELx_M /* Enable MPU */
>>> + orr x0, x0, #SCTLR_Axx_ELx_C /* Enable D-cache */
>>> + orr x0, x0, #SCTLR_Axx_ELx_WXN /* Enable WXN */
>>
>> NIT: Can't we have a single "orr" instruction to set all the flags?
> Yes, I will change this.
>>
>>> + dsb sy
>>
>> I still question this use of "dsb sy"...
>
> Actually I kept this to ensure that all outstanding memory access are
> completed before MPU is enabled.
>
> However, prepare_xen_region() is invoked before this and it has a 'dsb sy' at
> the end.
>
> So we can drop this barrier.
I suggest to keep the barrier here and drop the one in prepare_xen_region
instead,
have a look in my branch:
https://gitlab.com/xen-project/xen/-/merge_requests/7/diffs?commit_id=f42a2816f9bd95f2f6957887be910cb9acd140b5
During my testing I was having trouble without this barrier.
Cheers,
Luca
|