[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 10/10] arm/mpu: Create the skeleton for MPU compilation
- To: "Orzel, Michal" <michal.orzel@xxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Fri, 14 Mar 2025 08:38:54 +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=yIpJ/QXbFcaNW6CU1AOMQJHYaIjIQ2zyIL8VYp/zNEM=; b=g71cH2IBHp3XrQc/oTJkpOFzUCNJXZg4Ssg19PuqR9rK2nl35oGft3sJ+Im9ckZZCT2rFRbTfi9lhauN3V0pxPT0GinPba6lHPYXacZoBSTu+NDgHyMfMDWZF7cUQb+0DuiGBLZw3EnZPYmrSWNsTKWGden0GhNCnLphTdyEGudvTIDYn9i52ILMu71eHxnEffqxRFbWF3zefTN9fXcEfV03GLMshh84UKvIdch72/Ca6FQcIjcJ5ax+N1IFxdfEvszcKrjYJJ38GmdBY7kefo86ZggX8ull014ErY40GoB3KQbMqrhc9+T/e2poQ//BRquxvnw/WibFZyKInYbd4w==
- 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=yIpJ/QXbFcaNW6CU1AOMQJHYaIjIQ2zyIL8VYp/zNEM=; b=uAFMzKERgOf9DRm+aCf5BVrPDq9hBqRs7RLmpVYA8JDHxhQ9doGpw0MiC+FRsrDmiAcD+JVHMwWc9cgkY2VieYm0BuYsy8JjSLCn8X5dKwTPIUW7itK/N2/8nZb5W/vhRTDQcu5nFSrPq0+2+TzqEukGeYETswPYtjodhPWTN4y8Pht1huHCiDaa32vYCMhI4RIpaB92zG6QY/pN0H4JDS1iF81+j3UmkkXrGH6u5z1IeLrHx8KdmY8IruLSo77OcS8Ma5CRBSTDiRNM2Qbknas4MMyjaw9kh6Jki6q/X2Fpj6OuM7yGYw6y4bHSnQp+fUgG7IQ862KvDCBH5nmsew==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=hd4u36cZFSnqhGHwvvXz9HwW1wTFt0LqfwAOAS0IfZJLxI35/gI6/679I1y4KHRF3InaKyDQ6bFoqgFKRrK/BwJ6bDnlPBq4qrJlwrJAPVpmS2/oYEBNZdzesHIMma1bVoEkGdW9Qy9gyLmxabavDfIgGjIXNrtKHU1c8f8slM1YIhXCfGMsJLQhmhz7CKZgOamTy59neMWV51MQwJIW+6Jen1XJlm/MPS8G+OyYXkUUhuckQci1zrK5SBR0wBrHhAUh6uik7uXNPg7UUqVqEHh34WGKnwAzYbM4RqfDhIrAYQHj0Pxq2+HEJ5j1KUH44P5SB/Rrx8dS4laMIrB8rw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iBVueHNuRDpn6vZsWrr/SD5fYeI5Gg/6/VFCjP5Pprp/XIQP7s49xq5OqMJwkaaqLns/Lf9XYsLC32WA/i94+1m32gKizrTLHoM04qQGWjfJp7kHhpQCCdG4osGbKwaTSW5wYC7adKYOV2m7v2K3FYxbb8g6boHaYBAGKwRNlURmGS2J0SkQxepIwMjDKGIUNbuu8mJ8Rs0Fvmjg0kNI4Kv4S62YfEkIBTlrOFyk3AtRGRkt1eIpcBqMa1wOTFuDzg/vUghZOyGfO1dWjQWqb7Bs9z93MBjQSBM6lOCxosEu0HQW4+zvo2qyxjLNKssnlNbqu/fUL0NDe0oLk9t1OQ==
- 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>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Fri, 14 Mar 2025 08:39:25 +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: AQHblLrsg7FroDMiZEOgcGIzwb6YQ7NyT28A
- Thread-topic: [PATCH 10/10] arm/mpu: Create the skeleton for MPU compilation
Hi Michal,
> On 14 Mar 2025, at 08:27, Orzel, Michal <michal.orzel@xxxxxxx> wrote:
>
>
>
> On 12/03/2025 14:52, Luca Fancellu wrote:
>>
>>
>> This commit introduces the skeleton for the MPU memory management
>> subsystem that allows the compilation.
> You forgot to mention that you're talking about Arm64 only. For Arm32, Ayan
> has
> a series containing a few patches to enable compilation.
Yes I’ll be more specific here that we enable arm64 MPU build
>
> P.S.
> Once your series are merged, I'll send a patch enabling CI compilation for
> both
> Arm64 and Arm32 MPU.
thanks a lot for that
>>
>> +
>> +#include <xen/mm.h>
> I can't see anything mm.h related here. I'd expect types.h/stdbool.h and bug.h
I’ll add
>
>> +
>> +int prepare_secondary_mm(int cpu)
>> +{
>> + BUG_ON("unimplemented");
>> + return -EINVAL;
>> +}
>> +
>> +void update_boot_mapping(bool enable)
>> +{
>> + BUG_ON("unimplemented");
>> +}
>> +
>> +/*
>> + * Local variables:
>> + * mode: C
>> + * c-file-style: "BSD"
>> + * c-basic-offset: 4
>> + * indent-tabs-mode: nil
>> + * End:
>> + */
>> diff --git a/xen/arch/arm/include/asm/mpu/p2m.h
>> b/xen/arch/arm/include/asm/mpu/p2m.h
>> new file mode 100644
>> index 000000000000..e5c0e302167c
>> --- /dev/null
>> +++ b/xen/arch/arm/include/asm/mpu/p2m.h
>> @@ -0,0 +1,20 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
> Empty line here please
>
>> +#ifndef __ARM_MPU_P2M_H__
>> +#define __ARM_MPU_P2M_H__
>> +
>> +/* Not used on MPU system */
> I personally don't see a value in such comments. Initially when there were
> just
> 1, 2 instances I was ok, but then I realized you keep adding them. It's pretty
> clear that if a stub does not have BUG_ON, it means it's not used. I worry the
> files will look awful with so many "Not used on MPU system" comments. If at
> all,
> the only place they would make sense is if they were in MMU/MPU common code.
> Can
> we get rid of them completely?
Sure, I’ll get rid of them
>
>> +static inline void p2m_clear_root_pages(struct p2m_domain *p2m) {}
> You should at least forward declare struct p2m_domain.
Ok I’ll fix, should I include asm/p2m.h for the visibility of this structure or
because we won’t use that I should just forward declare?
>>
>> static inline bool arch_acquire_resource_check(struct domain *d)
>> diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
>> index f1417cd1b9db..a963b35db88d 100644
>> --- a/xen/arch/arm/mpu/Makefile
>> +++ b/xen/arch/arm/mpu/Makefile
>> @@ -1,3 +1,4 @@
>> obj-y += mm.o
>> obj-y += p2m.o
>> obj-y += setup.init.o
>> +obj-y += vmap-mpu.o
> What's the point of adding -mpu suffix to the file located already under /mpu?
ok I’ll rename to vmap
>> diff --git a/xen/arch/arm/mpu/setup.c b/xen/arch/arm/mpu/setup.c
>> index 45214bfeb661..28119e008341 100644
>> --- a/xen/arch/arm/mpu/setup.c
>> +++ b/xen/arch/arm/mpu/setup.c
>> @@ -2,12 +2,36 @@
>>
>> #include <xen/bug.h>
>> #include <xen/init.h>
>> +#include <xen/types.h>
>> +#include <asm/setup.h>
> Please sort alphabetically
Isn’t xen/* first followed by asm/* ?
Cheers,
Luca
|