Re: [Xen-devel] [PATCH v3 06/24] xen/arm: Map disabled device in DOM0
On Tue, 2015-01-13 at 14:25 +, Julien Grall wrote: The check to avoid mapping disabled device in DOM0 was added in the anticipation disabled devices and in anticipation of device passthrough of the device passthrough. But, a brand new property will be added later to mark device which will passthrough. At the same time, remove the memory type which will be passedthrough or maybe which will be passthrough? (It's hard to say because passthrough isn't really a word...) check because those nodes has been blacklisted. Futhermore, some platform (such as the OMAP) may try to poke device even Furthermore. if the property status is set to disabled. Signed-off-by: Julien Grall julien.gr...@linaro.org Cc: Andrii Tseglytskyi andrii.tseglyts...@globallogic.com With that and the change Stefano requested: Acked-by: Ian Campbell ian.campb...@citrix.com --- Changes in v3: - Patch added - xen/arm: follow-up to allow DOM0 manage IRQ and MMIO has been split in 2 patch [1] - Drop the check for memory type. Thoses nodes have been blacklisted. [1] https://patches.linaro.org/34669/ --- xen/arch/arm/domain_build.c| 19 +++ xen/arch/arm/platforms/omap5.c | 12 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 8f1b48e..f68755f 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1104,22 +1104,9 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, return 0; } -/* - * Some device doesn't need to be mapped in Xen: - * - Memory: the guest will see a different view of memory. It will - * be allocated later. - * - Disabled device: Linux is able to cope with status=disabled - * property. Therefore these device doesn't need to be mapped. This - * solution can be use later for pass through. - */ -if ( !dt_device_type_is_equal(node, memory) - dt_device_is_available(node) ) -{ -res = map_device(d, node); - -if ( res ) -return res; -} +res = map_device(d, node); +if ( res) +return res; /* * The property name is used to have a different name on older FDT diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c index 9d6e504..e7bf30d 100644 --- a/xen/arch/arm/platforms/omap5.c +++ b/xen/arch/arm/platforms/omap5.c @@ -155,17 +155,6 @@ static const char * const dra7_dt_compat[] __initconst = NULL }; -static const struct dt_device_match dra7_blacklist_dev[] __initconst = -{ -/* OMAP Linux kernel handles devices with status disabled in a - * weird manner - tries to reset them. While their memory ranges - * are not mapped, this leads to data aborts, so skip these devices - * from DT for dom0. - */ -DT_MATCH_NOT_AVAILABLE(), -{ /* sentinel */ }, -}; - PLATFORM_START(omap5, TI OMAP5) .compatible = omap5_dt_compat, .init_time = omap5_init_time, @@ -185,7 +174,6 @@ PLATFORM_START(dra7, TI DRA7) .dom0_gnttab_start = 0x4b00, .dom0_gnttab_size = 0x2, -.blacklist_dev = dra7_blacklist_dev, PLATFORM_END /* ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v3 06/24] xen/arm: Map disabled device in DOM0
On Tue, 13 Jan 2015, Julien Grall wrote: The check to avoid mapping disabled device in DOM0 was added in the anticipation of the device passthrough. But, a brand new property will be added later to mark device which will passthrough. At the same time, remove the memory type check because those nodes has been blacklisted. Sorry, I don't understand the explanation on why you removed the check on dt_device_type_is_equal(node, memory) too. Futhermore, some platform (such as the OMAP) may try to poke device even if the property status is set to disabled. Signed-off-by: Julien Grall julien.gr...@linaro.org Cc: Andrii Tseglytskyi andrii.tseglyts...@globallogic.com --- Changes in v3: - Patch added - xen/arm: follow-up to allow DOM0 manage IRQ and MMIO has been split in 2 patch [1] - Drop the check for memory type. Thoses nodes have been blacklisted. [1] https://patches.linaro.org/34669/ --- xen/arch/arm/domain_build.c| 19 +++ xen/arch/arm/platforms/omap5.c | 12 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 8f1b48e..f68755f 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1104,22 +1104,9 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, return 0; } -/* - * Some device doesn't need to be mapped in Xen: - * - Memory: the guest will see a different view of memory. It will - * be allocated later. - * - Disabled device: Linux is able to cope with status=disabled - * property. Therefore these device doesn't need to be mapped. This - * solution can be use later for pass through. - */ -if ( !dt_device_type_is_equal(node, memory) - dt_device_is_available(node) ) -{ -res = map_device(d, node); - -if ( res ) -return res; -} +res = map_device(d, node); +if ( res) +return res; /* * The property name is used to have a different name on older FDT diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c index 9d6e504..e7bf30d 100644 --- a/xen/arch/arm/platforms/omap5.c +++ b/xen/arch/arm/platforms/omap5.c @@ -155,17 +155,6 @@ static const char * const dra7_dt_compat[] __initconst = NULL }; -static const struct dt_device_match dra7_blacklist_dev[] __initconst = -{ -/* OMAP Linux kernel handles devices with status disabled in a - * weird manner - tries to reset them. While their memory ranges - * are not mapped, this leads to data aborts, so skip these devices - * from DT for dom0. - */ -DT_MATCH_NOT_AVAILABLE(), -{ /* sentinel */ }, -}; - PLATFORM_START(omap5, TI OMAP5) .compatible = omap5_dt_compat, .init_time = omap5_init_time, @@ -185,7 +174,6 @@ PLATFORM_START(dra7, TI DRA7) .dom0_gnttab_start = 0x4b00, .dom0_gnttab_size = 0x2, -.blacklist_dev = dra7_blacklist_dev, PLATFORM_END /* -- 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v3 06/24] xen/arm: Map disabled device in DOM0
Hi Stefano, On 28/01/15 16:18, Stefano Stabellini wrote: On Tue, 13 Jan 2015, Julien Grall wrote: The check to avoid mapping disabled device in DOM0 was added in the anticipation of the device passthrough. But, a brand new property will be added later to mark device which will passthrough. At the same time, remove the memory type check because those nodes has been blacklisted. Sorry, I don't understand the explanation on why you removed the check on dt_device_type_is_equal(node, memory) too. The memory nodes has been skipped earlier via the skip_matches variable. How about Also, remove the memory type check as we already skipped them earlier in the function? Regards, -- Julien Grall ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] [PATCH v3 06/24] xen/arm: Map disabled device in DOM0
The check to avoid mapping disabled device in DOM0 was added in the anticipation of the device passthrough. But, a brand new property will be added later to mark device which will passthrough. At the same time, remove the memory type check because those nodes has been blacklisted. Futhermore, some platform (such as the OMAP) may try to poke device even if the property status is set to disabled. Signed-off-by: Julien Grall julien.gr...@linaro.org Cc: Andrii Tseglytskyi andrii.tseglyts...@globallogic.com --- Changes in v3: - Patch added - xen/arm: follow-up to allow DOM0 manage IRQ and MMIO has been split in 2 patch [1] - Drop the check for memory type. Thoses nodes have been blacklisted. [1] https://patches.linaro.org/34669/ --- xen/arch/arm/domain_build.c| 19 +++ xen/arch/arm/platforms/omap5.c | 12 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 8f1b48e..f68755f 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1104,22 +1104,9 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, return 0; } -/* - * Some device doesn't need to be mapped in Xen: - * - Memory: the guest will see a different view of memory. It will - * be allocated later. - * - Disabled device: Linux is able to cope with status=disabled - * property. Therefore these device doesn't need to be mapped. This - * solution can be use later for pass through. - */ -if ( !dt_device_type_is_equal(node, memory) - dt_device_is_available(node) ) -{ -res = map_device(d, node); - -if ( res ) -return res; -} +res = map_device(d, node); +if ( res) +return res; /* * The property name is used to have a different name on older FDT diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c index 9d6e504..e7bf30d 100644 --- a/xen/arch/arm/platforms/omap5.c +++ b/xen/arch/arm/platforms/omap5.c @@ -155,17 +155,6 @@ static const char * const dra7_dt_compat[] __initconst = NULL }; -static const struct dt_device_match dra7_blacklist_dev[] __initconst = -{ -/* OMAP Linux kernel handles devices with status disabled in a - * weird manner - tries to reset them. While their memory ranges - * are not mapped, this leads to data aborts, so skip these devices - * from DT for dom0. - */ -DT_MATCH_NOT_AVAILABLE(), -{ /* sentinel */ }, -}; - PLATFORM_START(omap5, TI OMAP5) .compatible = omap5_dt_compat, .init_time = omap5_init_time, @@ -185,7 +174,6 @@ PLATFORM_START(dra7, TI DRA7) .dom0_gnttab_start = 0x4b00, .dom0_gnttab_size = 0x2, -.blacklist_dev = dra7_blacklist_dev, PLATFORM_END /* -- 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel