All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] R52 MPU support (for "Third series for R82 MPU")
@ 2025-08-07 17:45 Ayan Kumar Halder
  2025-08-07 17:45 ` [PATCH v1 1/2] arm/mpu: Enable is_xen_heap_page and co for ARM_32 Ayan Kumar Halder
  2025-08-07 17:45 ` [PATCH v1 2/2] arm/mpu: Disable map_domain_page for MPU Ayan Kumar Halder
  0 siblings, 2 replies; 6+ messages in thread
From: Ayan Kumar Halder @ 2025-08-07 17:45 UTC (permalink / raw)
  To: xen-devel
  Cc: Ayan Kumar Halder, Stefano Stabellini, Julien Grall,
	Bertrand Marquis, Michal Orzel, Volodymyr Babchuk

Hi all,

This series is related to
"[PATCH 0/5] Third series for R82 MPU support". There is no build dependency
between the two series.

At the end of these 2 series, R82 and R52 boot till the same point
(approximately).

Kind regards,
Ayan

Ayan Kumar Halder (2):
  arm/mpu: Enable is_xen_heap_page and co for ARM_32
  arm/mpu: Disable map_domain_page for MPU

 xen/arch/arm/Kconfig              |  2 +-
 xen/arch/arm/include/asm/mm.h     |  2 --
 xen/arch/arm/include/asm/mpu/mm.h |  5 ----
 xen/arch/arm/mpu/domain-page.c    | 45 -------------------------------
 4 files changed, 1 insertion(+), 53 deletions(-)
 delete mode 100644 xen/arch/arm/mpu/domain-page.c

-- 
2.25.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 1/2] arm/mpu: Enable is_xen_heap_page and co for ARM_32
  2025-08-07 17:45 [PATCH v1 0/2] R52 MPU support (for "Third series for R82 MPU") Ayan Kumar Halder
@ 2025-08-07 17:45 ` Ayan Kumar Halder
  2025-08-12 10:30   ` Hari Limaye
  2025-08-07 17:45 ` [PATCH v1 2/2] arm/mpu: Disable map_domain_page for MPU Ayan Kumar Halder
  1 sibling, 1 reply; 6+ messages in thread
From: Ayan Kumar Halder @ 2025-08-07 17:45 UTC (permalink / raw)
  To: xen-devel
  Cc: Ayan Kumar Halder, Stefano Stabellini, Julien Grall,
	Bertrand Marquis, Michal Orzel, Volodymyr Babchuk

In case of ARM_32, all of the RAM will be covered by a permanent contiguous
mapping (where VA == PA) and there will be a single heap. Thus, the memory
allocated from Xen heap uses PGC_xen_heap.
This is similar to the scenario described for
"CONFIG_SEPARATE_XENHEAP=n W/ DIRECT MAP OF ALL RAM" in common/page_alloc.c.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/include/asm/mm.h     | 2 --
 xen/arch/arm/include/asm/mpu/mm.h | 5 -----
 2 files changed, 7 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index fb79aeb088..4eaa81d5e8 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -170,11 +170,9 @@ struct page_info
 #define _PGC_need_scrub   _PGC_allocated
 #define PGC_need_scrub    PGC_allocated
 
-#ifdef CONFIG_ARM_64
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
-#endif
 
 #define is_xen_fixed_mfn(mfn)                                   \
     ((mfn_to_maddr(mfn) >= virt_to_maddr(&_start)) &&           \
diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
index c32fac8905..e1ded6521d 100644
--- a/xen/arch/arm/include/asm/mpu/mm.h
+++ b/xen/arch/arm/include/asm/mpu/mm.h
@@ -27,11 +27,6 @@ extern pr_t xen_mpumap[MAX_MPU_REGION_NR];
 
 #define virt_to_maddr(va) ((paddr_t)((vaddr_t)(va) & PADDR_MASK))
 
-#ifdef CONFIG_ARM_32
-#define is_xen_heap_page(page) ({ BUG_ON("unimplemented"); false; })
-#define is_xen_heap_mfn(mfn) ({ BUG_ON("unimplemented"); false; })
-#endif
-
 /* On MPU systems there is no translation, ma == va. */
 static inline void *maddr_to_virt(paddr_t ma)
 {
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1 2/2] arm/mpu: Disable map_domain_page for MPU
  2025-08-07 17:45 [PATCH v1 0/2] R52 MPU support (for "Third series for R82 MPU") Ayan Kumar Halder
  2025-08-07 17:45 ` [PATCH v1 1/2] arm/mpu: Enable is_xen_heap_page and co for ARM_32 Ayan Kumar Halder
@ 2025-08-07 17:45 ` Ayan Kumar Halder
  2025-08-12 10:49   ` Hari Limaye
  1 sibling, 1 reply; 6+ messages in thread
From: Ayan Kumar Halder @ 2025-08-07 17:45 UTC (permalink / raw)
  To: xen-devel
  Cc: Ayan Kumar Halder, Stefano Stabellini, Julien Grall,
	Bertrand Marquis, Michal Orzel, Volodymyr Babchuk

There is no domheap for ARM_32. All of the RAM is mapped and VA == PA.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/Kconfig           |  2 +-
 xen/arch/arm/mpu/domain-page.c | 45 ----------------------------------
 2 files changed, 1 insertion(+), 46 deletions(-)
 delete mode 100644 xen/arch/arm/mpu/domain-page.c

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index a0c8160474..5355534f3d 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -1,7 +1,7 @@
 config ARM_32
 	def_bool y
 	depends on "$(ARCH)" = "arm32"
-	select ARCH_MAP_DOMAIN_PAGE
+	select ARCH_MAP_DOMAIN_PAGE if MMU
 
 config ARM_64
 	def_bool y
diff --git a/xen/arch/arm/mpu/domain-page.c b/xen/arch/arm/mpu/domain-page.c
deleted file mode 100644
index df5e06b6db..0000000000
--- a/xen/arch/arm/mpu/domain-page.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <xen/bug.h>
-#include <xen/domain_page.h>
-#include <xen/mm-frame.h>
-#include <xen/types.h>
-
-void *map_domain_page_global(mfn_t mfn)
-{
-    BUG_ON("unimplemented");
-    return NULL;
-}
-
-/* Map a page of domheap memory */
-void *map_domain_page(mfn_t mfn)
-{
-    BUG_ON("unimplemented");
-    return NULL;
-}
-
-/* Release a mapping taken with map_domain_page() */
-void unmap_domain_page(const void *ptr)
-{
-    BUG_ON("unimplemented");
-}
-
-mfn_t domain_page_map_to_mfn(const void *ptr)
-{
-    BUG_ON("unimplemented");
-    return INVALID_MFN;
-}
-
-void unmap_domain_page_global(const void *va)
-{
-    BUG_ON("unimplemented");
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/2] arm/mpu: Enable is_xen_heap_page and co for ARM_32
  2025-08-07 17:45 ` [PATCH v1 1/2] arm/mpu: Enable is_xen_heap_page and co for ARM_32 Ayan Kumar Halder
@ 2025-08-12 10:30   ` Hari Limaye
  2025-08-14  8:24     ` Ayan Kumar Halder
  0 siblings, 1 reply; 6+ messages in thread
From: Hari Limaye @ 2025-08-12 10:30 UTC (permalink / raw)
  To: Ayan Kumar Halder
  Cc: xen-devel, Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Michal Orzel, Volodymyr Babchuk

Hi Ayan,

> On Thu, Aug 07, 2025 at 06:45:28PM +0000, Ayan Kumar Halder wrote:
> In case of ARM_32, all of the RAM will be covered by a permanent contiguous
> mapping (where VA == PA) and there will be a single heap. Thus, the memory
> allocated from Xen heap uses PGC_xen_heap.
> This is similar to the scenario described for
> "CONFIG_SEPARATE_XENHEAP=n W/ DIRECT MAP OF ALL RAM" in common/page_alloc.c.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---

This patch breaks the build for ARM_32, CONFIG_MMU targets due to
multiple definition of `is_xen_heap_page` and `is_xen_heap_mfn`. The
pre-existing definitions are located at xen/arch/arm/include/asm/mmu/mm.h:30:9

Cheers,
Hari


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 2/2] arm/mpu: Disable map_domain_page for MPU
  2025-08-07 17:45 ` [PATCH v1 2/2] arm/mpu: Disable map_domain_page for MPU Ayan Kumar Halder
@ 2025-08-12 10:49   ` Hari Limaye
  0 siblings, 0 replies; 6+ messages in thread
From: Hari Limaye @ 2025-08-12 10:49 UTC (permalink / raw)
  To: Ayan Kumar Halder
  Cc: xen-devel, Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Michal Orzel, Volodymyr Babchuk

Hi Ayan,

> On Thu, Aug 07, 2025 at 06:45:29PM +0000, Ayan Kumar Halder wrote:
> There is no domheap for ARM_32. All of the RAM is mapped and VA == PA.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
>  xen/arch/arm/Kconfig           |  2 +-
>  xen/arch/arm/mpu/domain-page.c | 45 ----------------------------------
>  2 files changed, 1 insertion(+), 46 deletions(-)
>  delete mode 100644 xen/arch/arm/mpu/domain-page.c
> 
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index a0c8160474..5355534f3d 100644
> --- a/xen/arch/arm/Kconfig

This patch is breaking ARM_32, MPU builds for me. I think this also needs:

```
diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
index 50f8fe4326..4963c8b550 100644
--- a/xen/arch/arm/mpu/Makefile
+++ b/xen/arch/arm/mpu/Makefile
@@ -1,6 +1,5 @@
 obj-$(CONFIG_ARM_32) += arm32/
 obj-$(CONFIG_ARM_64) += arm64/
-obj-$(CONFIG_ARM_32) += domain-page.o
 obj-y += mm.o
 obj-y += p2m.o
 obj-y += setup.init.o
 ```

Cheers,
Hari


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/2] arm/mpu: Enable is_xen_heap_page and co for ARM_32
  2025-08-12 10:30   ` Hari Limaye
@ 2025-08-14  8:24     ` Ayan Kumar Halder
  0 siblings, 0 replies; 6+ messages in thread
From: Ayan Kumar Halder @ 2025-08-14  8:24 UTC (permalink / raw)
  To: Hari Limaye, Ayan Kumar Halder
  Cc: xen-devel, Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Michal Orzel, Volodymyr Babchuk


On 12/08/2025 11:30, Hari Limaye wrote:
> Hi Ayan,
Hi Hari,
>
>> On Thu, Aug 07, 2025 at 06:45:28PM +0000, Ayan Kumar Halder wrote:
>> In case of ARM_32, all of the RAM will be covered by a permanent contiguous
>> mapping (where VA == PA) and there will be a single heap. Thus, the memory
>> allocated from Xen heap uses PGC_xen_heap.
>> This is similar to the scenario described for
>> "CONFIG_SEPARATE_XENHEAP=n W/ DIRECT MAP OF ALL RAM" in common/page_alloc.c.
>>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>> ---
> This patch breaks the build for ARM_32, CONFIG_MMU targets due to
> multiple definition of `is_xen_heap_page` and `is_xen_heap_mfn`. The
> pre-existing definitions are located at xen/arch/arm/include/asm/mmu/mm.h:30:9

Thanks for checking this and apologies for the build break. I should 
have tested this before sending.

I have sent out

[PATCH v2 0/2] R52 MPU support (for "Third series for R82 MPU")

This time I tested 
https://gitlab.com/xen-project/people/ayankuma/xen/-/pipelines/1982700286 
<https://gitlab.com/xen-project/people/ayankuma/xen/-/pipelines/1982700286> :)

- Ayan


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-14  8:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 17:45 [PATCH v1 0/2] R52 MPU support (for "Third series for R82 MPU") Ayan Kumar Halder
2025-08-07 17:45 ` [PATCH v1 1/2] arm/mpu: Enable is_xen_heap_page and co for ARM_32 Ayan Kumar Halder
2025-08-12 10:30   ` Hari Limaye
2025-08-14  8:24     ` Ayan Kumar Halder
2025-08-07 17:45 ` [PATCH v1 2/2] arm/mpu: Disable map_domain_page for MPU Ayan Kumar Halder
2025-08-12 10:49   ` Hari Limaye

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.