xen: arm: Enable 1:1 workaround by default
PATCH 1/1 xen: arm: Enable 1:1 workaround by default
I was just about to send out patches adding the 1:1 workaround to vexpress (the foundation model is a vexpress platfrom with DMA) and sunxi.
That would have meant that all platforms now implement the quirk. Instead lets just make it the default and remove the quirk.
In the future this will likely be set based on the presence absence of an IOMMU, perhaps with additional overrides by the platform.
A command line option no-dom0_11_mapping is provided.
--- xen/arch/arm/domain_build.c | 5 ++++- xen/arch/arm/platforms/exynos5.c | 6 ------ xen/arch/arm/platforms/midway.c | 6 ------ xen/arch/arm/platforms/omap5.c | 6 ------ xen/include/asm-arm/platform.h | 6 ------ 5 files changed, 4 insertions(+), 25 deletions(-)
xen/arch/arm/domain_build.c +4 -1
@@ -22,6 +22,9 @@static unsigned int __initdata opt_dom0_max_vcpus;integer_param ("dom0_max_vcpus" , opt_dom0_max_vcpus); +static int opt_dom0_11_mapping =1 ; +boolean_param ("dom0_11_mapping" , opt_dom0_11_mapping); +#define DOM0_MEM_DEFAULT 0x8000000/* 128 MiB */ static u64 __initdata dom0_mem =DOM0_MEM_DEFAULT ;
@@ -110,7 +113,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)u32 reg_len, reg_size;unsigned int bank =0 ; -if (platform_has_quirk (PLATFORM_QUIRK_DOM0_MAPPING_11 ) ) +if ( opt_dom0_11_mapping )return allocate_memory_11 (d, kinfo);while ( (memory =dt_find_node_by_type (memory,"memory" )) )
xen/arch/arm/platforms/exynos5.c +0 -6
@@ -111,11 +111,6 @@ static void exynos5_reset(void)iounmap (pmu); } -static uint32_t exynos5_quirks (void ) -{ -return PLATFORM_QUIRK_DOM0_MAPPING_11 ; -} -static const char *const exynos5_dt_compat[]__initconst = {"samsung,exynos5250" ,
@@ -139,7 +134,6 @@ PLATFORM_START(exynos5, "SAMSUNG EXYNOS5") .smp_init = exynos5_smp_init, .cpu_up = exynos5_cpu_up, .reset = exynos5_reset, - .quirks = exynos5_quirks, .blacklist_dev = exynos5_blacklist_dev,PLATFORM_END
xen/arch/arm/platforms/midway.c +0 -6
@@ -42,11 +42,6 @@ static void midway_reset(void)iounmap (pmu); } -static uint32_t midway_quirks (void ) -{ -return PLATFORM_QUIRK_DOM0_MAPPING_11 ; -} -static const char *const midway_dt_compat[]__initconst = {"calxeda,ecx-2000" ,
@@ -56,7 +51,6 @@ static const char * const midway_dt_compat[] __initconst =PLATFORM_START (midway,"CALXEDA MIDWAY" ) .compatible = midway_dt_compat, .reset = midway_reset, - .quirks = midway_quirks,PLATFORM_END /*
xen/arch/arm/platforms/omap5.c +0 -6
@@ -153,11 +153,6 @@ static int __init omap5_cpu_up(int cpu)return 0 ; } -static uint32_t omap5_quirks (void ) -{ -return PLATFORM_QUIRK_DOM0_MAPPING_11 ; -} -static const char const *omap5_dt_compat[]__initconst = {"ti,omap5" ,
@@ -170,7 +165,6 @@ PLATFORM_START(omap5, "TI OMAP5") .specific_mapping = omap5_specific_mapping, .smp_init = omap5_smp_init, .cpu_up = omap5_cpu_up, - .quirks = omap5_quirks,PLATFORM_END /*
xen/include/asm-arm/platform.h +0 -6
@@ -39,12 +39,6 @@ struct platform_desc {const struct dt_device_match *blacklist_dev; }; -/* -* Quirk to map dom0 memory in 1:1 -* Useful on platform where System MMU is not yet implemented -*/ -#define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0) -void __init platform_init (void );int __init platform_init_time (void );int __init platform_specific_mapping (struct domain *d);
Signature · 1 line
1.8.4.rc3
Quoted 6 lines · Ian Campbell
I was just about to send out patches adding the 1:1 workaround to vexpress (the foundation model is a vexpress platfrom with DMA) and sunxi.
That would have meant that all platforms now implement the quirk. Instead lets just make it the default and remove the quirk.
Quoted 6 lines
In the future this will likely be set based on the presence absence of an IOMMU, perhaps with additional overrides by the platform.
A command line option no-dom0_11_mapping is provided.
Signed-off-by Ian Campbell <[email protected]>
Can you patch docs/misc/xen-command-line.markdown as well please
~Andrew
Quoted 120 lines
--- xen/arch/arm/domain_build.c | 5 ++++- xen/arch/arm/platforms/exynos5.c | 6 ------ xen/arch/arm/platforms/midway.c | 6 ------ xen/arch/arm/platforms/omap5.c | 6 ------ xen/include/asm-arm/platform.h | 6 ------ 5 files changed, 4 insertions(+), 25 deletions(-)xen/arch/arm/domain_build.c +4
-1@@ -22,6 +22,9 @@static unsigned int __initdata opt_dom0_max_vcpus;integer_param ("dom0_max_vcpus" , opt_dom0_max_vcpus); +static int opt_dom0_11_mapping =1 ; +boolean_param ("dom0_11_mapping" , opt_dom0_11_mapping); +#define DOM0_MEM_DEFAULT 0x8000000/* 128 MiB */ static u64 __initdata dom0_mem =DOM0_MEM_DEFAULT ;@@ -110,7 +113,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)u32 reg_len, reg_size;unsigned int bank =0 ; -if (platform_has_quirk (PLATFORM_QUIRK_DOM0_MAPPING_11 ) ) +if ( opt_dom0_11_mapping )return allocate_memory_11 (d, kinfo);while ( (memory =dt_find_node_by_type (memory,"memory" )) )xen/arch/arm/platforms/exynos5.c +0
-6@@ -111,11 +111,6 @@ static void exynos5_reset(void)iounmap (pmu); } -static uint32_t exynos5_quirks (void ) -{ -return PLATFORM_QUIRK_DOM0_MAPPING_11 ; -} -static const char *const exynos5_dt_compat[]__initconst = {"samsung,exynos5250" ,@@ -139,7 +134,6 @@ PLATFORM_START(exynos5, "SAMSUNG EXYNOS5") .smp_init = exynos5_smp_init, .cpu_up = exynos5_cpu_up, .reset = exynos5_reset, - .quirks = exynos5_quirks, .blacklist_dev = exynos5_blacklist_dev,PLATFORM_END xen/arch/arm/platforms/midway.c +0
-6@@ -42,11 +42,6 @@ static void midway_reset(void)iounmap (pmu); } -static uint32_t midway_quirks (void ) -{ -return PLATFORM_QUIRK_DOM0_MAPPING_11 ; -} -static const char *const midway_dt_compat[]__initconst = {"calxeda,ecx-2000" ,@@ -56,7 +51,6 @@ static const char * const midway_dt_compat[] __initconst =PLATFORM_START (midway,"CALXEDA MIDWAY" ) .compatible = midway_dt_compat, .reset = midway_reset, - .quirks = midway_quirks,PLATFORM_END /* xen/arch/arm/platforms/omap5.c +0
-6@@ -153,11 +153,6 @@ static int __init omap5_cpu_up(int cpu)return 0 ; } -static uint32_t omap5_quirks (void ) -{ -return PLATFORM_QUIRK_DOM0_MAPPING_11 ; -} -static const char const *omap5_dt_compat[]__initconst = {"ti,omap5" ,@@ -170,7 +165,6 @@ PLATFORM_START(omap5, "TI OMAP5") .specific_mapping = omap5_specific_mapping, .smp_init = omap5_smp_init, .cpu_up = omap5_cpu_up, - .quirks = omap5_quirks,PLATFORM_END /* xen/include/asm-arm/platform.h +0
-6@@ -39,12 +39,6 @@ struct platform_desc {const struct dt_device_match *blacklist_dev; }; -/* -* Quirk to map dom0 memory in 1:1 -* Useful on platform where System MMU is not yet implemented -*/ -#define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0) -void __init platform_init (void );int __init platform_init_time (void );int __init platform_specific_mapping (struct domain *d);
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Ian Campbell
I was just about to send out patches adding the 1:1 workaround to vexpress (the foundation model is a vexpress platfrom with DMA) and sunxi.
That would have meant that all platforms now implement the quirk. Instead lets just make it the default and remove the quirk.
Quoted 8 lines
Quoted 6 lines
In the future this will likely be set based on the presence absence of an IOMMU, perhaps with additional overrides by the platform.
A command line option no-dom0_11_mapping is provided.
Signed-off-by Ian Campbell <[email protected]>Can you patch docs/misc/xen-command-line.markdown as well please
I left it out on purpose, given the implications of using it I actually want people to have to talk to us before using it.
I'd be more inclined to remove the option that to document it.
Ian.
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Andrew Cooper
Quoted 11 lines · Ian Campbell
I was just about to send out patches adding the 1:1 workaround to vexpress (the foundation model is a vexpress platfrom with DMA) and sunxi.
That would have meant that all platforms now implement the quirk. Instead lets just make it the default and remove the quirk.
In the future this will likely be set based on the presence absence of an IOMMU, perhaps with additional overrides by the platform.
A command line option no-dom0_11_mapping is provided.
Quoted 9 lines
Quoted 2 lines
Quoted 1 line
Signed-off-by Ian Campbell <[email protected]>Can you patch docs/misc/xen-command-line.markdown as well please
I left it out on purpose, given the implications of using it I actually want people to have to talk to us before using it.
I'd be more inclined to remove the option that to document it.
Ian.
Hmm ok - perhaps a comment beside boolean_param() indicating that this is a temporary hack and is expected to disappear completely in due course?
~Andrew
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Andrew Cooper
Quoted 11 lines · Ian Campbell
I was just about to send out patches adding the 1:1 workaround to vexpress (the foundation model is a vexpress platfrom with DMA) and sunxi.
That would have meant that all platforms now implement the quirk. Instead lets just make it the default and remove the quirk.
In the future this will likely be set based on the presence absence of an IOMMU, perhaps with additional overrides by the platform.
A command line option no-dom0_11_mapping is provided.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Ian Campbell <[email protected]>Can you patch docs/misc/xen-command-line.markdown as well please
I left it out on purpose, given the implications of using it I actually want people to have to talk to us before using it.
I'd be more inclined to remove the option that to document it.
Given that there is no way of using Xen on any ARM hardware without that option right now (unless the hardware doesn't do DMA at all, but we can ignore that case), I think that making it a global variable, not exposed to the user, would be fine. xen/x86 can set the option to false.
Quoted 11 lines · Ian Campbell
I was just about to send out patches adding the 1:1 workaround to vexpress (the foundation model is a vexpress platfrom with DMA) and sunxi.
That would have meant that all platforms now implement the quirk. Instead lets just make it the default and remove the quirk.
In the future this will likely be set based on the presence absence of an IOMMU, perhaps with additional overrides by the platform.
A command line option no-dom0_11_mapping is provided.
I plan to use the variable in other place, for instance in common/memory.c to solve issue between ballooning and 1:1 workaround.
It would be great if we have a function (platform_has_iommu) that we can use everywhere. What do you think?
Quoted 122 lines
Signed-off-by Ian Campbell <[email protected]>--- xen/arch/arm/domain_build.c | 5 ++++- xen/arch/arm/platforms/exynos5.c | 6 ------ xen/arch/arm/platforms/midway.c | 6 ------ xen/arch/arm/platforms/omap5.c | 6 ------ xen/include/asm-arm/platform.h | 6 ------ 5 files changed, 4 insertions(+), 25 deletions(-)xen/arch/arm/domain_build.c +4
-1@@ -22,6 +22,9 @@static unsigned int __initdata opt_dom0_max_vcpus;integer_param ("dom0_max_vcpus" , opt_dom0_max_vcpus); +static int opt_dom0_11_mapping =1 ; +boolean_param ("dom0_11_mapping" , opt_dom0_11_mapping); +#define DOM0_MEM_DEFAULT 0x8000000/* 128 MiB */ static u64 __initdata dom0_mem =DOM0_MEM_DEFAULT ;@@ -110,7 +113,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)u32 reg_len, reg_size;unsigned int bank =0 ; -if (platform_has_quirk (PLATFORM_QUIRK_DOM0_MAPPING_11 ) ) +if ( opt_dom0_11_mapping )return allocate_memory_11 (d, kinfo);while ( (memory =dt_find_node_by_type (memory,"memory" )) )xen/arch/arm/platforms/exynos5.c +0
-6@@ -111,11 +111,6 @@ static void exynos5_reset(void)iounmap (pmu); } -static uint32_t exynos5_quirks (void ) -{ -return PLATFORM_QUIRK_DOM0_MAPPING_11 ; -} -static const char *const exynos5_dt_compat[]__initconst = {"samsung,exynos5250" ,@@ -139,7 +134,6 @@ PLATFORM_START(exynos5, "SAMSUNG EXYNOS5") .smp_init = exynos5_smp_init, .cpu_up = exynos5_cpu_up, .reset = exynos5_reset, - .quirks = exynos5_quirks, .blacklist_dev = exynos5_blacklist_dev,PLATFORM_END xen/arch/arm/platforms/midway.c +0
-6@@ -42,11 +42,6 @@ static void midway_reset(void)iounmap (pmu); } -static uint32_t midway_quirks (void ) -{ -return PLATFORM_QUIRK_DOM0_MAPPING_11 ; -} -static const char *const midway_dt_compat[]__initconst = {"calxeda,ecx-2000" ,@@ -56,7 +51,6 @@ static const char * const midway_dt_compat[] __initconst =PLATFORM_START (midway,"CALXEDA MIDWAY" ) .compatible = midway_dt_compat, .reset = midway_reset, - .quirks = midway_quirks,PLATFORM_END /* xen/arch/arm/platforms/omap5.c +0
-6@@ -153,11 +153,6 @@ static int __init omap5_cpu_up(int cpu)return 0 ; } -static uint32_t omap5_quirks (void ) -{ -return PLATFORM_QUIRK_DOM0_MAPPING_11 ; -} -static const char const *omap5_dt_compat[]__initconst = {"ti,omap5" ,@@ -170,7 +165,6 @@ PLATFORM_START(omap5, "TI OMAP5") .specific_mapping = omap5_specific_mapping, .smp_init = omap5_smp_init, .cpu_up = omap5_cpu_up, - .quirks = omap5_quirks,PLATFORM_END /* xen/include/asm-arm/platform.h +0
-6@@ -39,12 +39,6 @@ struct platform_desc {const struct dt_device_match *blacklist_dev; }; -/* -* Quirk to map dom0 memory in 1:1 -* Useful on platform where System MMU is not yet implemented -*/ -#define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0) -void __init platform_init (void );int __init platform_init_time (void );int __init platform_specific_mapping (struct domain *d);
Signature · 1 line
Julien Grall
Quoted 11 lines · Julien Grall
Quoted 9 lines · Ian Campbell
I was just about to send out patches adding the 1:1 workaround to vexpress (the foundation model is a vexpress platfrom with DMA) and sunxi.
That would have meant that all platforms now implement the quirk. Instead lets just make it the default and remove the quirk.
In the future this will likely be set based on the presence absence of an IOMMU, perhaps with additional overrides by the platform.
Quoted 8 lines
Quoted 2 lines
A command line option no-dom0_11_mapping is provided.
I plan to use the variable in other place, for instance in
common/memory.cto solve issue between ballooning and 1:1 workaround.It would be great if we have a function (
platform_has_iommu) that we can use everywhere. What do you think?
I think in reality once iommu's arrive it will be a bit more subtle than their presence or absence, e.g. something (perhaps the platform code) will need to decide if all the write devices are behind an iommu such that the 11 can be disabled.
I can unstatic opt_dom0_11_mapping and stick it in a header though. Or provide an accessor method.
Ian.
Quoted 21 lines · Ian Campbell
Quoted 11 lines · Julien Grall
Quoted 9 lines · Ian Campbell
I was just about to send out patches adding the 1:1 workaround to vexpress (the foundation model is a vexpress platfrom with DMA) and sunxi.
That would have meant that all platforms now implement the quirk. Instead lets just make it the default and remove the quirk.
In the future this will likely be set based on the presence absence of an IOMMU, perhaps with additional overrides by the platform.
Quoted 8 lines
Quoted 2 lines
A command line option no-dom0_11_mapping is provided.
I plan to use the variable in other place, for instance in
common/memory.cto solve issue between ballooning and 1:1 workaround.It would be great if we have a function (
platform_has_iommu) that we can use everywhere. What do you think?
Quoted 7 lines
I think in reality once iommu's arrive it will be a bit more subtle than their presence or absence, e.g. something (perhaps the platform code) will need to decide if all the write devices are behind an iommu such that the 11 can be disabled.
I can unstatic
opt_dom0_11_mappingand stick it in a header though. Or provide an accessor method.
An accessor method sounds better.
Signature · 1 line
Julien Grall