[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 05/10] libxl/xl: add memory policy option to iomem





On 30/04/2019 22:02, Stefano Stabellini wrote:
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 89fe80f..a6c5e30 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -415,6 +415,21 @@ static void init_console_info(libxl__gc *gc,
         Only 'channels' when mapped to consoles have a string name. */
  }
+static uint32_t libxl__memory_policy_to_xc(libxl_memory_policy c)
+{
+    switch (c) {
+    case LIBXL_MEMORY_POLICY_ARM_MEM_WB:
+        return MEMORY_POLICY_ARM_MEM_WB;
+    case LIBXL_MEMORY_POLICY_ARM_DEV_NGRE:
+        return MEMORY_POLICY_ARM_DEV_nGRE;
+    case LIBXL_MEMORY_POLICY_X86_UC:
+        return MEMORY_POLICY_X86_UC;
+    case LIBXL_MEMORY_POLICY_DEFAULT:
+    default:

Looking at this again, don't we want to bail out if the policy is unknown? My concern here is the user may configure with something it didn't expect. The risk is the problem will be hard to debug.

I also believe this could be part of libxl_{arm,x86}.c allowing us to filter misuse early. Ian, Wei, any opinion?

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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