[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: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Fri, 14 Mar 2025 09:40:26 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • 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=GhpU4gM0Rs/fr4IyV3Y7WapXYvpeGeGXthUe6j0fVZU=; b=kH5wYJOhy3G6kBbaOJWd6V3zHsL3A5XgkQ75MqaxkBZBZIARLlp0Od0zzWafE1DGJNPwIVPTmHwmtWcNRRNiW9FnYeavILIb8qW7OIUAppD1CKyJ3sVj4kj1XDZSNF0EWDGts6RxN3T5mIHWwHxoi4h3RvDik3ABN8l4VqlYAoUV6E1fdE65H4wM0WKb+gb4zA/VyWOBEw27qVe4TGTW81X5NKhOIIsj8CdvYM0T1W1bcbXheNp46VzTjZuLQdvsB9TXYrcc9QxJP+BTbOdJg/D/T0XuBeW2OtqXnWVckW1JLNqGQnheDOlGyKFxM944mnumFsnqcJdpMyzEPLhedQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G1K50mZpEkhQOk9yJqfet2X8M/IwBTAtmzKcwj7UwWWin1JsZMTeRSa/uCqiF9kjwC/nGYjC37UP6r9mAqPi2vqf3O5iok+4tROaHWAQU8/MxOxHJ2HBlxi5BPWJDHl7Lh97RK4OqgEjv9oJ7C9W1GDB7Yj0Bhzn8TImrW+4iogt6A7eR4RNH4xMLnKDWyljPtdsOXJU3dBR/numKIhbcAUdVMAwCl420f5OqwfeDseKoDNogpu5KDhYEefbWm9985wlgXRWiOWRMZfdVUynLRRjwDxkYEWey3+8MBVA4yM9Jqf3qeb7YRXN7gTvv3oEelER07Q2XrbLjvuOgx0cVA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.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:40:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 14/03/2025 09:38, Luca Fancellu wrote:
> 
> 
> 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?
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/* ?
Oops, I missed the fact that this is xen/ and asm/. Ignore then.

~Michal




 


Rackspace

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