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

[Xen-devel] [PATCH 2/3] xen/arm: Add PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE



Add a new quirk to map all disabled device in dom0, for omap5 kernel would
try to access the modules that are listed in DT and then do a soft-reset to
get those modules to a known state.

Signed-off-by: Chen Baozi <baozich@xxxxxxxxx>
---
 xen/arch/arm/domain_build.c    | 3 ++-
 xen/arch/arm/platforms/omap5.c | 3 ++-
 xen/include/asm-arm/platform.h | 6 ++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 4f91327..b6f5b72 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -714,7 +714,8 @@ static int handle_node(struct domain *d, struct kernel_info 
*kinfo,
      *  solution can be use later for pass through.
      */
     if ( !dt_device_type_is_equal(np, "memory") &&
-         dt_device_is_available(np) )
+         (dt_device_is_available(np) ||
+          platform_has_quirk(PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE)))
     {
         res = map_device(d, np);
 
diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index a40d016..a583e2b 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -123,7 +123,8 @@ static int omap5_specific_mapping(struct domain *d)
 
 static uint32_t omap5_quirks(void)
 {
-    return PLATFORM_QUIRK_DOM0_MAPPING_11;
+    return PLATFORM_QUIRK_DOM0_MAPPING_11 |
+           PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE;
 }
 
 static const char const *omap5_dt_compat[] __initdata =
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index 43afebb..09360a4 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -44,6 +44,12 @@ struct platform_desc {
  * Useful on platform where System MMU is not yet implemented
  */
 #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
+/*
+ * Quirk to map disabled device
+ * Useful on platform where dom0 kernel would access device addresses
+ * whether it is disabled or not.
+ */
+#define PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE (1 << 1)
 
 int __init platform_init(void);
 int __init platform_init_time(void);
-- 
1.8.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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