[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 17/36] xen/arm: add get_max_color function
- To: Marco Solieri <marco.solieri@xxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Julien Grall <julien@xxxxxxx>
- Date: Fri, 11 Mar 2022 19:09:54 +0000
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Marco Solieri <marco.solieri@xxxxxxxxxx>, Andrea Bastoni <andrea.bastoni@xxxxxxxxxxxxxxx>, Luca Miccio <lucmiccio@xxxxxxxxx>
- Delivery-date: Fri, 11 Mar 2022 19:09:59 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Marco,
On 04/03/2022 17:46, Marco Solieri wrote:
From: Luca Miccio <lucmiccio@xxxxxxxxx>
In order to initialize the colored allocator data structure, the maximum
amount of colors defined by the hardware has to be know.
Add a helper function that returns this information.
Signed-off-by: Luca Miccio <lucmiccio@xxxxxxxxx>
---
xen/arch/arm/coloring.c | 5 +++++
xen/arch/arm/include/asm/coloring.h | 8 ++++++++
This helper is simple enough that I think it would be better to fold in
the first patch using it.
2 files changed, 13 insertions(+)
diff --git a/xen/arch/arm/coloring.c b/xen/arch/arm/coloring.c
index 4748d717d6..d1ac193a80 100644
--- a/xen/arch/arm/coloring.c
+++ b/xen/arch/arm/coloring.c
@@ -209,6 +209,11 @@ unsigned long color_from_page(struct page_info *pg)
return ((addr_col_mask & page_to_maddr(pg)) >> PAGE_SHIFT);
}
+uint32_t get_max_colors(void)
+{
+ return max_col_num;
+}
+
bool __init coloring_init(void)
{
int i;
diff --git a/xen/arch/arm/include/asm/coloring.h
b/xen/arch/arm/include/asm/coloring.h
index 318e2a4521..22e67dc9d8 100644
--- a/xen/arch/arm/include/asm/coloring.h
+++ b/xen/arch/arm/include/asm/coloring.h
@@ -49,6 +49,9 @@ void coloring_dump_info(struct domain *d);
* specifications.
*/
unsigned long color_from_page(struct page_info *pg);
+
+/* Return the maximum available number of colors supported by the hardware */
+uint32_t get_max_colors(void);
#else /* !CONFIG_COLORING */
static inline bool __init coloring_init(void)
{
@@ -59,5 +62,10 @@ static inline void coloring_dump_info(struct domain *d)
{
return;
}
+
+static inline uint32_t get_max_colors(void)
+{
+ return 0;
+}
#endif /* CONFIG_COLORING */
#endif /* !__ASM_ARM_COLORING_H__ */
Cheers,
--
Julien Grall
|