All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] xen: arm: move rambase definitions to Rules.mk
@ 2014-08-22 10:05 Andrii Tseglytskyi
  2014-08-22 10:14 ` Tamas K Lengyel
  0 siblings, 1 reply; 5+ messages in thread
From: Andrii Tseglytskyi @ 2014-08-22 10:05 UTC (permalink / raw)
  To: xen-devel, Ian Campbell, Stefano Stabellini, Tim Deegan

The reason of this pathch is the following - guest domain OS may
use iomem mappings. It is a typical way to handle devices in domU.
On some SoCs iomem starts from 0x40000000 base. Therefore it is
almost impossible to use iomem mappings, because it conflicts with
GUEST_RAM0_BASE pointer, which has similar value. Patch allows
to configure this from compile command line. Verified on OMAP5.

Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@globallogic.com>
---
 tools/Rules.mk                | 9 +++++++++
 xen/arch/arm/Rules.mk         | 5 +++++
 xen/include/public/arch-arm.h | 3 ---
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 5bac700..ebc1324 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -35,6 +35,15 @@ INSTALL_SHLIB = : install-shlib-unsupported-fail
 SYMLINK_SHLIB = : symlink-shlib-unsupported-fail
 endif
 
+TOOLS_TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
+                 sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
+ifeq ($(TOOLS_TARGET_ARCH),arm)
+GUEST_RAM0_BASE ?= 0x40000000ULL
+GUEST_RAM0_SIZE ?= 0xc0000000ULL
+CFLAGS += -DGUEST_RAM0_BASE=$(GUEST_RAM0_BASE)
+CFLAGS += -DGUEST_RAM0_SIZE=$(GUEST_RAM0_SIZE)
+endif
+
 CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
 LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 8658176..ba7dbb8 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -104,6 +104,11 @@ ifneq ($(EARLY_PRINTK_INC),)
 EARLY_PRINTK := y
 endif
 
+GUEST_RAM0_BASE ?= 0x40000000ULL
+GUEST_RAM0_SIZE ?= 0xc0000000ULL
+CFLAGS += -DGUEST_RAM0_BASE=$(GUEST_RAM0_BASE)
+CFLAGS += -DGUEST_RAM0_SIZE=$(GUEST_RAM0_SIZE)
+
 CFLAGS-$(EARLY_PRINTK) += -DCONFIG_EARLY_PRINTK
 CFLAGS-$(EARLY_PRINTK_INIT_UART) += -DEARLY_PRINTK_INIT_UART
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index ac54cd6..a31ed72 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -380,9 +380,6 @@ typedef uint64_t xen_callback_t;
 
 #define GUEST_RAM_BANKS   2
 
-#define GUEST_RAM0_BASE   0x40000000ULL /* 3GB of low RAM @ 1GB */
-#define GUEST_RAM0_SIZE   0xc0000000ULL
-
 #define GUEST_RAM1_BASE   0x0200000000ULL /* 1016GB of RAM @ 8GB */
 #define GUEST_RAM1_SIZE   0xfe00000000ULL
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH] xen: arm: move rambase definitions to Rules.mk
  2014-08-22 10:05 [RFC PATCH] xen: arm: move rambase definitions to Rules.mk Andrii Tseglytskyi
@ 2014-08-22 10:14 ` Tamas K Lengyel
  2014-08-22 10:22   ` Andrii Tseglytskyi
  0 siblings, 1 reply; 5+ messages in thread
From: Tamas K Lengyel @ 2014-08-22 10:14 UTC (permalink / raw)
  To: Andrii Tseglytskyi
  Cc: Tim Deegan, Stefano Stabellini, Ian Campbell, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2984 bytes --]

Would be good to still have a copy of the definition in the public header
so that user-space tools can determine where the memory of the guest begins.

Tamas


On Fri, Aug 22, 2014 at 12:05 PM, Andrii Tseglytskyi <
andrii.tseglytskyi@globallogic.com> wrote:

> The reason of this pathch is the following - guest domain OS may
> use iomem mappings. It is a typical way to handle devices in domU.
> On some SoCs iomem starts from 0x40000000 base. Therefore it is
> almost impossible to use iomem mappings, because it conflicts with
> GUEST_RAM0_BASE pointer, which has similar value. Patch allows
> to configure this from compile command line. Verified on OMAP5.
>
> Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@globallogic.com>
> ---
>  tools/Rules.mk                | 9 +++++++++
>  xen/arch/arm/Rules.mk         | 5 +++++
>  xen/include/public/arch-arm.h | 3 ---
>  3 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/tools/Rules.mk b/tools/Rules.mk
> index 5bac700..ebc1324 100644
> --- a/tools/Rules.mk
> +++ b/tools/Rules.mk
> @@ -35,6 +35,15 @@ INSTALL_SHLIB = : install-shlib-unsupported-fail
>  SYMLINK_SHLIB = : symlink-shlib-unsupported-fail
>  endif
>
> +TOOLS_TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
> +                 sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
> +ifeq ($(TOOLS_TARGET_ARCH),arm)
> +GUEST_RAM0_BASE ?= 0x40000000ULL
> +GUEST_RAM0_SIZE ?= 0xc0000000ULL
> +CFLAGS += -DGUEST_RAM0_BASE=$(GUEST_RAM0_BASE)
> +CFLAGS += -DGUEST_RAM0_SIZE=$(GUEST_RAM0_SIZE)
> +endif
> +
>  CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
>  LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
>  SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
> diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
> index 8658176..ba7dbb8 100644
> --- a/xen/arch/arm/Rules.mk
> +++ b/xen/arch/arm/Rules.mk
> @@ -104,6 +104,11 @@ ifneq ($(EARLY_PRINTK_INC),)
>  EARLY_PRINTK := y
>  endif
>
> +GUEST_RAM0_BASE ?= 0x40000000ULL
> +GUEST_RAM0_SIZE ?= 0xc0000000ULL
> +CFLAGS += -DGUEST_RAM0_BASE=$(GUEST_RAM0_BASE)
> +CFLAGS += -DGUEST_RAM0_SIZE=$(GUEST_RAM0_SIZE)
> +
>  CFLAGS-$(EARLY_PRINTK) += -DCONFIG_EARLY_PRINTK
>  CFLAGS-$(EARLY_PRINTK_INIT_UART) += -DEARLY_PRINTK_INIT_UART
>  CFLAGS-$(EARLY_PRINTK) +=
> -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
> diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
> index ac54cd6..a31ed72 100644
> --- a/xen/include/public/arch-arm.h
> +++ b/xen/include/public/arch-arm.h
> @@ -380,9 +380,6 @@ typedef uint64_t xen_callback_t;
>
>  #define GUEST_RAM_BANKS   2
>
> -#define GUEST_RAM0_BASE   0x40000000ULL /* 3GB of low RAM @ 1GB */
> -#define GUEST_RAM0_SIZE   0xc0000000ULL
> -
>  #define GUEST_RAM1_BASE   0x0200000000ULL /* 1016GB of RAM @ 8GB */
>  #define GUEST_RAM1_SIZE   0xfe00000000ULL
>
> --
> 1.9.1
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

[-- Attachment #1.2: Type: text/html, Size: 3792 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH] xen: arm: move rambase definitions to Rules.mk
  2014-08-22 10:14 ` Tamas K Lengyel
@ 2014-08-22 10:22   ` Andrii Tseglytskyi
  2014-08-22 10:27     ` Tamas K Lengyel
  0 siblings, 1 reply; 5+ messages in thread
From: Andrii Tseglytskyi @ 2014-08-22 10:22 UTC (permalink / raw)
  To: Tamas K Lengyel; +Cc: Tim Deegan, Stefano Stabellini, Ian Campbell, xen-devel

Hi,

The idea is that user-space tools will determine rambase from
tools/Rules.mk. Or maybe I did not get your point correctly?

Regards,
Andrii

On Fri, Aug 22, 2014 at 1:14 PM, Tamas K Lengyel
<tamas.lengyel@zentific.com> wrote:
> Would be good to still have a copy of the definition in the public header so
> that user-space tools can determine where the memory of the guest begins.
>
> Tamas
>
>
> On Fri, Aug 22, 2014 at 12:05 PM, Andrii Tseglytskyi
> <andrii.tseglytskyi@globallogic.com> wrote:
>>
>> The reason of this pathch is the following - guest domain OS may
>> use iomem mappings. It is a typical way to handle devices in domU.
>> On some SoCs iomem starts from 0x40000000 base. Therefore it is
>> almost impossible to use iomem mappings, because it conflicts with
>> GUEST_RAM0_BASE pointer, which has similar value. Patch allows
>> to configure this from compile command line. Verified on OMAP5.
>>
>> Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@globallogic.com>
>> ---
>>  tools/Rules.mk                | 9 +++++++++
>>  xen/arch/arm/Rules.mk         | 5 +++++
>>  xen/include/public/arch-arm.h | 3 ---
>>  3 files changed, 14 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/Rules.mk b/tools/Rules.mk
>> index 5bac700..ebc1324 100644
>> --- a/tools/Rules.mk
>> +++ b/tools/Rules.mk
>> @@ -35,6 +35,15 @@ INSTALL_SHLIB = : install-shlib-unsupported-fail
>>  SYMLINK_SHLIB = : symlink-shlib-unsupported-fail
>>  endif
>>
>> +TOOLS_TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
>> +                 sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
>> +ifeq ($(TOOLS_TARGET_ARCH),arm)
>> +GUEST_RAM0_BASE ?= 0x40000000ULL
>> +GUEST_RAM0_SIZE ?= 0xc0000000ULL
>> +CFLAGS += -DGUEST_RAM0_BASE=$(GUEST_RAM0_BASE)
>> +CFLAGS += -DGUEST_RAM0_SIZE=$(GUEST_RAM0_SIZE)
>> +endif
>> +
>>  CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
>>  LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
>>  SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
>> diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
>> index 8658176..ba7dbb8 100644
>> --- a/xen/arch/arm/Rules.mk
>> +++ b/xen/arch/arm/Rules.mk
>> @@ -104,6 +104,11 @@ ifneq ($(EARLY_PRINTK_INC),)
>>  EARLY_PRINTK := y
>>  endif
>>
>> +GUEST_RAM0_BASE ?= 0x40000000ULL
>> +GUEST_RAM0_SIZE ?= 0xc0000000ULL
>> +CFLAGS += -DGUEST_RAM0_BASE=$(GUEST_RAM0_BASE)
>> +CFLAGS += -DGUEST_RAM0_SIZE=$(GUEST_RAM0_SIZE)
>> +
>>  CFLAGS-$(EARLY_PRINTK) += -DCONFIG_EARLY_PRINTK
>>  CFLAGS-$(EARLY_PRINTK_INIT_UART) += -DEARLY_PRINTK_INIT_UART
>>  CFLAGS-$(EARLY_PRINTK) +=
>> -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
>> diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
>> index ac54cd6..a31ed72 100644
>> --- a/xen/include/public/arch-arm.h
>> +++ b/xen/include/public/arch-arm.h
>> @@ -380,9 +380,6 @@ typedef uint64_t xen_callback_t;
>>
>>  #define GUEST_RAM_BANKS   2
>>
>> -#define GUEST_RAM0_BASE   0x40000000ULL /* 3GB of low RAM @ 1GB */
>> -#define GUEST_RAM0_SIZE   0xc0000000ULL
>> -
>>  #define GUEST_RAM1_BASE   0x0200000000ULL /* 1016GB of RAM @ 8GB */
>>  #define GUEST_RAM1_SIZE   0xfe00000000ULL
>>
>> --
>> 1.9.1
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>



-- 

Andrii Tseglytskyi | Embedded Dev
GlobalLogic
www.globallogic.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH] xen: arm: move rambase definitions to Rules.mk
  2014-08-22 10:22   ` Andrii Tseglytskyi
@ 2014-08-22 10:27     ` Tamas K Lengyel
  2014-08-22 10:30       ` Andrii Tseglytskyi
  0 siblings, 1 reply; 5+ messages in thread
From: Tamas K Lengyel @ 2014-08-22 10:27 UTC (permalink / raw)
  To: Andrii Tseglytskyi
  Cc: Tim Deegan, Stefano Stabellini, Ian Campbell, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 437 bytes --]

On Fri, Aug 22, 2014 at 12:22 PM, Andrii Tseglytskyi <
andrii.tseglytskyi@globallogic.com> wrote:

> Hi,
>
> The idea is that user-space tools will determine rambase from
> tools/Rules.mk. Or maybe I did not get your point correctly?
>
> Regards,
> Andrii
>

Headers in public/ will be installed and used by third-party tools (tools
not shipped with Xen), and those tools won't be able to rely on Rules.mk to
get this definition.

Tamas

[-- Attachment #1.2: Type: text/html, Size: 805 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH] xen: arm: move rambase definitions to Rules.mk
  2014-08-22 10:27     ` Tamas K Lengyel
@ 2014-08-22 10:30       ` Andrii Tseglytskyi
  0 siblings, 0 replies; 5+ messages in thread
From: Andrii Tseglytskyi @ 2014-08-22 10:30 UTC (permalink / raw)
  To: Tamas K Lengyel; +Cc: Tim Deegan, Stefano Stabellini, Ian Campbell, xen-devel

On Fri, Aug 22, 2014 at 1:27 PM, Tamas K Lengyel
<tamas.lengyel@zentific.com> wrote:
>
> On Fri, Aug 22, 2014 at 12:22 PM, Andrii Tseglytskyi
> <andrii.tseglytskyi@globallogic.com> wrote:
>>
>> Hi,
>>
>> The idea is that user-space tools will determine rambase from
>> tools/Rules.mk. Or maybe I did not get your point correctly?
>>
>> Regards,
>> Andrii
>
>
> Headers in public/ will be installed and used by third-party tools (tools
> not shipped with Xen), and those tools won't be able to rely on Rules.mk to
> get this definition.
>

OK. This is a point.

Regards,
Andrii

> Tamas



-- 

Andrii Tseglytskyi | Embedded Dev
GlobalLogic
www.globallogic.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-22 10:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22 10:05 [RFC PATCH] xen: arm: move rambase definitions to Rules.mk Andrii Tseglytskyi
2014-08-22 10:14 ` Tamas K Lengyel
2014-08-22 10:22   ` Andrii Tseglytskyi
2014-08-22 10:27     ` Tamas K Lengyel
2014-08-22 10:30       ` Andrii Tseglytskyi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.