Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-22 Thread Ian Campbell
On Wed, 2015-10-21 at 17:20 +, Ferger, Max wrote:
> Hi!
> 
> I'm sorry, but that didn't do the trick.


Please can you stop top posting, use the customary ">" style of quoting
when replying and trim your quotes to only what is required for context.
Please see 
http://wiki.xen.org/wiki/Asking_Xen_Devel_Questions#Observe_list_etiquette 
for more information.

This will help people follow the flow of the conversation.

Ian.

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


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-22 Thread Ferger, Max
Hello,

No further questions in this message, just a quick wrap-up:
1) Console is now configured.
2) Dom0 kernel is coming up and showing messages.

Very many thanks for all your help!


= Details =

This message should conclude the issue.
Therefore, it summarizes my findings and mistakes, and gets
the actual device tree, and a log entering Dom0 attached.


1) Console is now configured:

It helps to take the exact same console, as the one U-Boot uses,
and to enable it. In case of the LAGER board, it is  "/serial@e6e6",
configured via the following DT snippet:
- 8< -
scif0: serial@e6e6 {
status = "ok";
 };
 chosen {
stdout-path = 
xen,xen-bootargs = "console=dtuart dom0_mem=1G";
};
- 8< -


2) Dom0 kernel is coming up and showing messages:

> From: Julien Grall [mailto:julien.gr...@citrix.com]
> Sent: Wednesday, October 21, 2015 8:02 PM
> 
> To be sure, even the patch I attached on the previous mail doesn't help
> you to get the console?

The patch works. But now it is obsolete, and reverted.

My mistake was how I tried to configure the kernel:
Following the OMAP wiki [1], which I think is a little misleading,
I appended the CONFIG_XEN* and friends to .config, and called 'make',
leading to the CONFIG_XEN*-flags to be overwritten by defaults.
Once configured via menuconfig, Dom0 showed messages all right.

> If so, the simplest way to investigate requires the serial driver in Xen
> to be functional (IIRC it's not the case right now). If you got it, you
> can type CTRL-a tree times and access to the Xen console.

This great tool works now.
 
> If you have Xen built with debug=y, from the log you sent it seems to be
> the case, you can use the asm instruction "hvc" to get Xen printing
> useful information:
> - hvc 0x will dump the state of the vCPU
> - hvc 0xfffd will print the program counter

Nice to know.  Couldn't find it on the wiki, though.

I'll update the LAGER board wiki [2] with my findings.

Some questions remain, but I'll come back on these later,
when I'm more clear about them, and probably via [xen-users].
I'll try my best to abide by the etiquette next time.

Max Ferger

[1] 
http://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/OMAP5432_uEVM#2.2_Build_Linux_Dom0_kernel
[2] http://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/Lager




Leopold KOSTAL GmbH & Co. KG - Sitz Lüdenscheid, Registergericht Iserlohn HRA 
2854, phG Kostal Verwaltungsgesellschaft mbH, Registergericht Iserlohn HRB 4061 
- USt-Id-Nr./Vat No.: DE 125800885
Post- und Werksanschrift: An der Bellmerei 10, D-58513 Lüdenscheid * Telefon: 
+49 2351 16-0 * Telefax: +49 2351 16-2400 Bellmerei
Geschäftsführung: Dipl.-Oec. Andreas Kostal (Vorsitzender), Dipl.-Kfm. Helmut 
Kostal, Dipl.-Ing. Marwin Kinzl, Dr.-Ing. Ludger Laufenberg, Dipl.-Kfm. Ulrich 
Zimmermann


LAGER SPI_LOADER V0.28 2014.09.29
DEVICE S25FL512


U-Boot 2014.10-00441-gf7ca1f7-dirty (Oct 19 2015 - 12:32:17)

CPU: Renesas Electronics R8A7790 rev 2.0
Board: Lager
I2C:   ready
DRAM:  2 GiB
SF: Detected S25FL512S_256K with page size 512 Bytes, erase size 256 KiB, total 
64 MiB
In:serial
Out:   serial
Err:   serial
Net:   sh_eth
Hit any key to stop autoboot:  0
sh_eth Waiting for PHY auto negotiation to complete... done
sh_eth: 100Base/Half
Using sh_eth device
TFTP from server 192.168.0.15; our IP address is 192.168.0.5
Filename 'r8a7790-lager-xen.dtb'.
Load address: 0x70f0
Loading: #
 395.5 KiB/s
done
Bytes transferred = 44621 (ae4d hex)
sh_eth:1 is connected to sh_eth.  Reconnecting to sh_eth
sh_eth Waiting for PHY auto negotiation to complete... done
sh_eth: 100Base/Half
Using sh_eth device
TFTP from server 192.168.0.15; our IP address is 192.168.0.5
Filename 'dom0-zImage'.
Load address: 0x7200
Loading: #
 #
 #
 #
 
 603.5 KiB/s
done
Bytes transferred = 1553064 (17b2a8 hex)
sh_eth:1 is connected to sh_eth.  Reconnecting to sh_eth
sh_eth Waiting for PHY auto negotiation to complete... done
sh_eth: 100Base/Half
Using sh_eth device
TFTP from server 192.168.0.15; our IP address is 192.168.0.5
Filename 'xenpolicy'.
Load address: 0x7400
Loading: ##
 41 KiB/s
done
Bytes transferred = 9561 (2559 hex)
chosen {
bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
stdout-path = "/serial@e6e6";
xen,xen-bootargs = "console=dtuart dom0_mem=1G";
xen,dom0-bootargs = "console=hvc0 earlyprintk=xen debug ignore_loglevel 
vmalloc=384M video=HDMI-A-1:1920x1080-32@60 
ip=192.168.0.5:192.168.0.15:192.168.0.15:255.255.255.0:lager:eth0::: 
root=/dev/nfs rw nfsroot=192.168.0.15:/nfsroot 

Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-22 Thread Julien Grall
On 22/10/15 16:07, Ferger, Max wrote:
> Hello,

Hi,

> 2) Dom0 kernel is coming up and showing messages:
> 
>> From: Julien Grall [mailto:julien.gr...@citrix.com]
>> Sent: Wednesday, October 21, 2015 8:02 PM
>>
>> To be sure, even the patch I attached on the previous mail doesn't help
>> you to get the console?
> 
> The patch works. But now it is obsolete, and reverted.
> 
> My mistake was how I tried to configure the kernel:
> Following the OMAP wiki [1], which I think is a little misleading,
> I appended the CONFIG_XEN* and friends to .config, and called 'make',
> leading to the CONFIG_XEN*-flags to be overwritten by defaults.
> Once configured via menuconfig, Dom0 showed messages all right.

Linux tends to remove the CONFIG_* if it's not able to turn on it's
dependencies.

I usually double check after a 'make oldconfig'.

>> If so, the simplest way to investigate requires the serial driver in Xen
>> to be functional (IIRC it's not the case right now). If you got it, you
>> can type CTRL-a tree times and access to the Xen console.
> 
> This great tool works now.

>> If you have Xen built with debug=y, from the log you sent it seems to be
>> the case, you can use the asm instruction "hvc" to get Xen printing
>> useful information:
>> - hvc 0x will dump the state of the vCPU
>> - hvc 0xfffd will print the program counter
> 
> Nice to know.  Couldn't find it on the wiki, though.

I documented them in a talk I gave [1] but never took the opportunity to
wikify it.

I will try to do it on the next Document Day.

> I'll update the LAGER board wiki [2] with my findings.

That would be useful, thank you!

Regards,

[1] http://www.slideshare.net/xen_com_mgr/bsdcan-2015-how-to-port-your-bsd

-- 
Julien Grall

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


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-21 Thread Ferger, Max
Hi!

Thanks for both DT fixes, the "add ranges;", and the "complete memory map".

Here are some findings:

* Linus' most recent version of the kernel [1] (configured with a mix of 
Xen/OMAP description [2] and lager_defconfig [3]) needs the 'add 
"ranges;"'-fixes, but does not access the otherwise unmapped address regions.
* Renesas' Yocto/Poky 

Unfortunately, neither gives any message on the console, so I don't know their 
status.

[1] git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[2] 
http://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/OMAP5432_uEVM
[3] git clone https://github.com/renesas-devel/lager-config

As I see it, Xen issues no further warnings, but still Dom0 remains silent.

I'm somewhat at a loss.  :-(

Greetings from Germany!

Max Ferger

Latest log with both above fixes, applied by the appended DTS:
- 8< -

LAGER SPI_LOADER V0.28 2014.09.29
DEVICE S25FL512


U-Boot 2014.10-00441-gf7ca1f7-dirty (Oct 19 2015 - 12:32:17)

CPU: Renesas Electronics R8A7790 rev 2.0
Board: Lager
I2C:   ready
DRAM:  2 GiB
SF: Detected S25FL512S_256K with page size 512 Bytes, erase size 256 KiB, total 
64 MiB
In:serial
Out:   serial
Err:   serial
Net:   sh_eth
Hit any key to stop autoboot:  0
sh_eth Waiting for PHY auto negotiation to complete... done
sh_eth: 100Base/Half
Using sh_eth device
TFTP from server 192.168.0.15; our IP address is 192.168.0.5
Filename 'r8a7790-lager-xen.dtb'.
Load address: 0x70f0
Loading: #
 439.5 KiB/s
done
Bytes transferred = 44589 (ae2d hex)
sh_eth:1 is connected to sh_eth.  Reconnecting to sh_eth
sh_eth Waiting for PHY auto negotiation to complete... done
sh_eth: 100Base/Half
Using sh_eth device
TFTP from server 192.168.0.15; our IP address is 192.168.0.5
Filename 'dom0-zImage'.
Load address: 0x7200
Loading: #
 #
 #
 ##
 710 KiB/s
done
Bytes transferred = 1273096 (136d08 hex)
sh_eth:1 is connected to sh_eth.  Reconnecting to sh_eth
sh_eth Waiting for PHY auto negotiation to complete done
sh_eth: 100Base/Half
Using sh_eth device
TFTP from server 192.168.0.15; our IP address is 192.168.0.5
Filename 'xenpolicy'.
Load address: 0x7400
Loading: ##
 321.3 KiB/s
done
Bytes transferred = 9561 (2559 hex)
sh_eth:1 is connected to sh_eth.  Reconnecting to sh_eth
sh_eth Waiting for PHY auto negotiation to complete... done
sh_eth: 100Base/Half
Using sh_eth device
TFTP from server 192.168.0.15; our IP address is 192.168.0.5
Filename 'xen-uImage'.
Load address: 0x70007fc0
Loading: #
 #
 #
 697.3 KiB/s
done
Bytes transferred = 852948 (d03d4 hex)
## Booting kernel from Legacy Image at 70007fc0 ...
   Image Name:   XEN4.6-LAGER
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:852884 Bytes = 832.9 KiB
   Load Address: 9000
   Entry Point:  9000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 70f0
   Booting using the fdt blob at 0x70f0
   Loading Kernel Image ... OK
   reserving fdt memory region: addr=70f0 size=b000
   Loading Device Tree to 407f2000, end 407f ... OK

Starting kernel ...

- UART enabled -
- CPU  booting -
- Xen starting in Hyp mode -
- Zero BSS -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 4000 - 7fff
(XEN) RAM: 00014000 - 0001
(XEN)
(XEN) MODULE[0]: 407f2000 - 407fd000 Device Tree
(XEN) MODULE[1]: 7200 - 72136d08 Kernel
(XEN) MODULE[2]: 7400 - 74002559 XSM
(XEN)  RESVD[0]: 70f0 - 70f0b000
(XEN)  RESVD[1]: 7ff9a000 - 7ff9a120
(XEN)  RESVD[2]: 407f2000 - 407fd000
(XEN)
(XEN) Command line: console=dtuart dom0_mem=1G
(XEN) Placing Xen at 0x7fc0-0x7fe0
(XEN) Update BOOTMOD_XEN from 9000-9011b701 => 
7fc0-7fd1b701
(XEN) Xen heap: 0001f800-0002 (32768 pages)
(XEN) Dom heap: 1015808 pages
(XEN) Domain heap initialised
(XEN) Platform: Renesas R-Car Gen2
(XEN) Taking dtuart configuration from /chosen/stdout-path
(XEN) Looking for dtuart at "/serial@e6c4", options ""
(XEN) Unable to initialize dtuart: -9
(XEN) Bad console= option 'dtuart'
 __  ___  ______
 \ \/ /___ _ __   | || |  / /_  / _ \
  \  // _ \ '_ \  | || |_| '_ \| | | |
  /  \  __/ | | | |__   _| (_) | |_| |
 /_/\_\___|_| |_||_|(_)___(_)___/

(XEN) Xen version 4.6.0 (aen@) 

Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-21 Thread Julien Grall
On 21/10/15 17:05, Ferger, Max wrote:
> Hi!

Hello,

> Thanks for both DT fixes, the "add ranges;", and the "complete memory map".
> 
> Here are some findings:
> 
> * Linus' most recent version of the kernel [1] (configured with a mix of 
> Xen/OMAP description [2] and lager_defconfig [3]) needs the 'add 
> "ranges;"'-fixes, but does not access the otherwise unmapped address regions.
> * Renesas' Yocto/Poky 
> 
> Unfortunately, neither gives any message on the console, so I don't know 
> their status.
> 
> [1] git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> [2] 
> http://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/OMAP5432_uEVM
> [3] git clone https://github.com/renesas-devel/lager-config
> 
> As I see it, Xen issues no further warnings, but still Dom0 remains silent.

The console parameter in "xen,dom0-bootargs" seems to be wrong.
It should be console=hvc0

If it still doesn't work, you can apply the patch [1] to Linux
(it's based on the latest version). It will print everything on Xen
console even if the HVC console is not ready.

> I'm somewhat at a loss.  :-(
> 
> Greetings from Germany!

Regards,


[1]
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index fa816b7..b57ace0 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -638,7 +638,7 @@ void xen_raw_console_write(const char *str)
ssize_t len = strlen(str);
int rc = 0;
 
-   if (xen_domain()) {
+   if (1 || xen_domain()) {
rc = dom0_write_console(0, str, len);
 #ifdef CONFIG_X86
if (rc == -ENOSYS && xen_hvm_domain())
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 8f0324e..29a19af 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1652,6 +1652,8 @@ static size_t cont_print_text(char *text, size_t size)
return textlen;
 }
 
+#include 
+
 asmlinkage int vprintk_emit(int facility, int level,
const char *dict, size_t dictlen,
const char *fmt, va_list args)
@@ -1719,6 +1721,7 @@ asmlinkage int vprintk_emit(int facility, int level,
 * prefix which might be passed-in as a parameter.
 */
text_len = vscnprintf(text, sizeof(textbuf), fmt, args);
+   xen_raw_console_write(text);
 
/* mark and strip a trailing newline */
if (text_len && text[text_len-1] == '\n') {




-- 
Julien Grall

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


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-21 Thread Julien Grall
On 21/10/15 18:20, Ferger, Max wrote:
> Hi!

Hello,

> I'm sorry, but that didn't do the trick.
> Neither did trying, whether a compressed or non-compressed dom0 image would 
> do.
> 
> Also, I tried:
> - 8< -
> /chosen/xen,dom0-bootargs = "console=hvc0 earlyprintk=xen debug 
> ignore_loglevel vmalloc=384M video=HDMI-A-1:1920x1080-32@60 
> ip=192.168.0.5:192.168.0.15:192.168.0.15:255.255.255.0:lager:eth0::: 
> root=/dev/nfs rw nfsroot=192.168.0.15:/nfsroot rootdelay clk_ignore_unused";
> - 8< -
> + earlyprintk=xen
> - rootwait
> + rootdelay
> 
> The log remains the same: empty from the switch to Dom0 onwards.
> 
> Many thanks so far!  Maybe there are some more investigative options to check 
> or try out?

To be sure, even the patch I attached on the previous mail doesn't help
you to get the console?

If so, the simplest way to investigate requires the serial driver in Xen
to be functional (IIRC it's not the case right now). If you got it, you
can type CTRL-a tree times and access to the Xen console.

There is a number of key useful to dump the states of Xen and the
guests. The key '0' will dump the state of every vCPUs of DOM0. To list
the other keys available, type 'h'.

If getting the serial driver requires to much work, you will have to
modify DOM0 and add some xen_raw_printk (#include ).
To figure out what's going on.

If you have Xen built with debug=y, from the log you sent it seems to be
the case, you can use the asm instruction "hvc" to get Xen printing
useful information:
- hvc 0x will dump the state of the vCPU
- hvc 0xfffd will print the program counter
For more of them see do_debug_trap in xen/arch/arm/traps.c

I hope this will help you to get further in DOM0 boot.

Regards,

-- 
Julien Grall

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


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-21 Thread Ferger, Max
Hi!

I'm sorry, but that didn't do the trick.
Neither did trying, whether a compressed or non-compressed dom0 image would do.

Also, I tried:
- 8< -
/chosen/xen,dom0-bootargs = "console=hvc0 earlyprintk=xen debug ignore_loglevel 
vmalloc=384M video=HDMI-A-1:1920x1080-32@60 
ip=192.168.0.5:192.168.0.15:192.168.0.15:255.255.255.0:lager:eth0::: 
root=/dev/nfs rw nfsroot=192.168.0.15:/nfsroot rootdelay clk_ignore_unused";
- 8< -
+ earlyprintk=xen
- rootwait
+ rootdelay

The log remains the same: empty from the switch to Dom0 onwards.

Many thanks so far!  Maybe there are some more investigative options to check 
or try out?

Max Ferger

-Ursprüngliche Nachricht-
Von: Julien Grall [mailto:julien.gr...@citrix.com] 
Gesendet: Mittwoch, 21. Oktober 2015 18:23
An: Ferger, Max <m.fer...@kostal.com>; Ian Campbell <ian.campb...@citrix.com>; 
xen-devel@lists.xen.org
Cc: Oleksandr Tyshchenko <oleksandr.tyshche...@globallogic.com>; Iurii 
Konovalenko <iurii.konovale...@globallogic.com>
Betreff: Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

On 21/10/15 17:05, Ferger, Max wrote:
> Hi!

Hello,

> Thanks for both DT fixes, the "add ranges;", and the "complete memory map".
> 
> Here are some findings:
> 
> * Linus' most recent version of the kernel [1] (configured with a mix of 
> Xen/OMAP description [2] and lager_defconfig [3]) needs the 'add 
> "ranges;"'-fixes, but does not access the otherwise unmapped address regions.
> * Renesas' Yocto/Poky
> 
> Unfortunately, neither gives any message on the console, so I don't know 
> their status.
> 
> [1] git clone 
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> [2] 
> http://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions
> /OMAP5432_uEVM [3] git clone 
> https://github.com/renesas-devel/lager-config
> 
> As I see it, Xen issues no further warnings, but still Dom0 remains silent.

The console parameter in "xen,dom0-bootargs" seems to be wrong.
It should be console=hvc0

If it still doesn't work, you can apply the patch [1] to Linux (it's based on 
the latest version). It will print everything on Xen console even if the HVC 
console is not ready.

> I'm somewhat at a loss.  :-(
> 
> Greetings from Germany!

Regards,


[1]
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index 
fa816b7..b57ace0 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -638,7 +638,7 @@ void xen_raw_console_write(const char *str)
ssize_t len = strlen(str);
int rc = 0;
 
-   if (xen_domain()) {
+   if (1 || xen_domain()) {
rc = dom0_write_console(0, str, len);  #ifdef CONFIG_X86
if (rc == -ENOSYS && xen_hvm_domain()) diff --git 
a/kernel/printk/printk.c b/kernel/printk/printk.c index 8f0324e..29a19af 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1652,6 +1652,8 @@ static size_t cont_print_text(char *text, size_t size)
return textlen;
 }
 
+#include 
+
 asmlinkage int vprintk_emit(int facility, int level,
const char *dict, size_t dictlen,
const char *fmt, va_list args) @@ -1719,6 +1721,7 
@@ asmlinkage int vprintk_emit(int facility, int level,
 * prefix which might be passed-in as a parameter.
 */
text_len = vscnprintf(text, sizeof(textbuf), fmt, args);
+   xen_raw_console_write(text);
 
/* mark and strip a trailing newline */
if (text_len && text[text_len-1] == '\n') {




--
Julien Grall



Leopold KOSTAL GmbH & Co. KG - Sitz Lüdenscheid, Registergericht Iserlohn HRA 
2854, phG Kostal Verwaltungsgesellschaft mbH, Registergericht Iserlohn HRB 4061 
- USt-Id-Nr./Vat No.: DE 125800885
Post- und Werksanschrift: An der Bellmerei 10, D-58513 Lüdenscheid * Telefon: 
+49 2351 16-0 * Telefax: +49 2351 16-2400 Bellmerei
Geschäftsführung: Dipl.-Oec. Andreas Kostal (Vorsitzender), Dipl.-Kfm. Helmut 
Kostal, Dipl.-Ing. Marwin Kinzl, Dr.-Ing. Ludger Laufenberg, Dipl.-Kfm. Ulrich 
Zimmermann


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


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-20 Thread Ferger, Max
uest
(XEN) DT: no ranges; cannot enumerate
(XEN) Device tree generation failed (-22).
(XEN)
(XEN) 
(XEN) Panic on CPU 0:
(XEN) Could not set up DOM0 guest OS
(XEN) 
(XEN)
(XEN) Reboot in five seconds...
- 8< -

Mit freundlichen Grüßen / Kind regards

Leopold Kostal GmbH & Co. KG
Automobil Elektrik / Automotive Electrical Systems 

Max Ferger 
AEN5 Vorentwicklung Produktinnovationen
Advance Development Innovative Products

Hauert 16, 44227 Dortmund
Deutschland / Germany
Telefon: +49 231 7588 965
E-Mail: m.fer...@kostal.com

Internet: http://www.kostal.com

-Ursprüngliche Nachricht-
Von: Julien Grall [mailto:julien.gr...@citrix.com] 
Gesendet: Montag, 19. Oktober 2015 14:44
An: Ferger, Max <m.fer...@kostal.com>; Ian Campbell <ian.campb...@citrix.com>; 
xen-devel@lists.xen.org
Cc: Oleksandr Tyshchenko <oleksandr.tyshche...@globallogic.com>; Iurii 
Konovalenko <iurii.konovale...@globallogic.com>
Betreff: Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

Hello Max,

On 19/10/15 13:09, Ferger, Max wrote:
> - UART enabled -
> - CPU  booting -
> - Xen starting in Hyp mode -
> - Zero BSS -
> - Setting up control registers -
> - Turning on paging -
> - Ready -
> (XEN) Checking for initrd in /chosen
> (XEN) RAM: 4000 - 7fff
> (XEN) RAM: 00014000 - 0001
> (XEN)
> (XEN) MODULE[0]: 407f2000 - 407fd000 Device Tree
> (XEN) MODULE[1]: 7200 - 722fd158 Kernel
> (XEN) MODULE[2]: 7400 - 74002559 XSM
> (XEN)  RESVD[0]: 70f0 - 70f0b000
> (XEN)  RESVD[1]: 7ff9a000 - 7ff9a120
> (XEN)  RESVD[2]: 407f2000 - 407fd000
> (XEN)
> (XEN) Command line: console=dtuart dtuart=/soc/serial@e6c5 
> dom0_mem=1G
> (XEN) Placing Xen at 0x7fc0-0x7fe0
> (XEN) Update BOOTMOD_XEN from 9000-9011b701 => 
> 7fc0-7fd1b701
> (XEN) Xen heap: 0001f800-0002 (32768 pages)
> (XEN) Dom heap: 1015808 pages
> (XEN) Domain heap initialised
> (XEN) Platform: Renesas R-Car Gen2
> (XEN) Looking for dtuart at "/soc/serial@e6c5", options ""
> (XEN) Unable to find device "/soc/serial@e6c5"

You provided the wrong path to the UART. Xen will use earlyprintk rather than 
the console.

If you use the upstream DT (arch/arm/boot/dts/r8a7790-lager.dts), it contains a 
property stdout-path in the chosen node. As Xen is able to understand it, you 
can drop "dtuart=/soc/" and only keep console=dtuart on the command line.

[...]

> (XEN) *** LOADING DOMAIN 0 ***
> (XEN) Loading kernel from boot module @ 7200
> (XEN) Allocating 1:1 mappings totalling 1024MB for dom0:
> (XEN) BANK[0] 0x004800-0x007000 (640MB)
> (XEN) BANK[1] 0x01d800-0x01f000 (384MB)
> (XEN) Grant table range: 0x007fc0-0x007fc72000
> (XEN) DT: no ranges; cannot enumerate
> (XEN) Device tree generation failed (-22).

Can you turn on DEBUG_DT in xen/arch/arm/domain_build.c (see patch [1]) and 
paste the log here?

Also, can you send the device tree you are using?

Regards,

[1]
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 
0c3441a..bdb8b1f 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -40,7 +40,7 @@ static void __init parse_dom0_mem(const char *s)  }  
custom_param("dom0_mem", parse_dom0_mem);
 
-//#define DEBUG_DT
+#define DEBUG_DT
 
 #ifdef DEBUG_DT
 # define DPRINT(fmt, args...) printk(XENLOG_DEBUG fmt, ##args)

--
Julien Grall



Leopold KOSTAL GmbH & Co. KG - Sitz Lüdenscheid, Registergericht Iserlohn HRA 
2854, phG Kostal Verwaltungsgesellschaft mbH, Registergericht Iserlohn HRB 4061 
- USt-Id-Nr./Vat No.: DE 125800885
Post- und Werksanschrift: An der Bellmerei 10, D-58513 Lüdenscheid * Telefon: 
+49 2351 16-0 * Telefax: +49 2351 16-2400 Bellmerei
Geschäftsführung: Dipl.-Oec. Andreas Kostal (Vorsitzender), Dipl.-Kfm. Helmut 
Kostal, Dipl.-Ing. Marwin Kinzl, Dr.-Ing. Ludger Laufenberg, Dipl.-Kfm. Ulrich 
Zimmermann



r8a7790-lager-xen.dts
Description: r8a7790-lager-xen.dts


r8a7790-lager.dts
Description: r8a7790-lager.dts
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-20 Thread Julien Grall

Hi,

On 20/10/2015 09:48, Ferger, Max wrote:

Many thanks for the attention, and the help so far!

* There are still warnings about the console not being properly configured. 
This issue seems not urgent to me, also I would appreciate a fix.

* Something goes wrong while booting Dom0.  Please help me in understanding why?

* I still don't know too much about how to modify Dom0.  I just try to run a 
Poky I created with Renesas' help, which has been successfully running on the 
board without Xen.



(XEN) Checking for initrd in /chosen
(XEN) RAM: 4000 - 7fff
(XEN) RAM: 00014000 - 0001
(XEN)
(XEN) MODULE[0]: 407f2000 - 407fd000 Device Tree
(XEN) MODULE[1]: 7200 - 722fd158 Kernel
(XEN) MODULE[2]: 7400 - 74002559 XSM
(XEN)  RESVD[0]: 70f0 - 70f0b000
(XEN)  RESVD[1]: 7ff9a000 - 7ff9a120
(XEN)  RESVD[2]: 407f2000 - 407fd000
(XEN)
(XEN) Command line: console=dtuart dom0_mem=1G
(XEN) Placing Xen at 0x7fc0-0x7fe0
(XEN) Update BOOTMOD_XEN from 9000-9011b701 => 
7fc0-7fd1b701
(XEN) Xen heap: 0001f800-0002 (32768 pages)
(XEN) Dom heap: 1015808 pages
(XEN) Domain heap initialised
(XEN) Platform: Renesas R-Car Gen2
(XEN) Taking dtuart configuration from /chosen/stdout-path
(XEN) Looking for dtuart at "/serial@e6c4", options ""
(XEN) Unable to initialize dtuart: -9


It looks like your platform is using an UART compatible with 
"renesas,scifa".


Although, for the moment, the driver in Xen is only supporting 
"renesas,scif".


Looking to the Linux drivers (drivers/tty/serial/sh-sci.c), there is few 
differences between the two UART, mostly about the register offsets.


Meanwhile, you can stay on the earlyprintk until you get DOM0 to boot. 
It only means that Xen won't be able to receive character and interact 
with you.



(XEN) Bad console= option 'dtuart'
  __  ___  ______
  \ \/ /___ _ __   | || |  / /_  / _ \
   \  // _ \ '_ \  | || |_| '_ \| | | |
   /  \  __/ | | | |__   _| (_) | |_| |
  /_/\_\___|_| |_||_|(_)___(_)___/


[..]


(XEN) handle /pci@ee09/usb@0,1
(XEN) /pci@ee09/usb@0,1 passthrough = 1 nirq = 0 naddr = 0
(XEN) Mapping children of /pci@ee09/usb@0,1 to guest
(XEN) DT: no ranges; cannot enumerate


Thank you for the log. The offending node is /pci@ee09/usb@0,1 which 
is (r8a7790.dtsi):


1407 usb@0,1 {
1408 reg = <0x800 0 0 0 0>;
1409 device_type = "pci";
1410 phys = < 0>;
1411 phy-names = "usb";
1412 };
1413

We assume that every node containing device_type = "pci" is a PCI bus. 
So Xen is looking for a property "ranges" which is not present.


Although, here it's describing a PCI device. I wasn't able to find a 
spec telling that device_type = "pci"; should only be used by the PCI 
bus. Ian, do you remember why you implement with this assumption?


For now, I would advice you to drop this node, the next one (usb@0,2) 
and doing the same in "pci@ee0d". We can figure out later how to fix 
it when you get a DOM0 booting.



(XEN) Device tree generation failed (-22).
(XEN)
(XEN) 
(XEN) Panic on CPU 0:
(XEN) Could not set up DOM0 guest OS
(XEN) 
(XEN)
(XEN) Reboot in five seconds...


Regards,

--
Julien Grall

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


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-20 Thread Ferger, Max
N) /clocks/mstp10_clks@e6150998 passthrough = 1 nirq = 0 naddr = 2
(XEN)   - MMIO: 00e6150998 - 00e615099c
(XEN)   - MMIO: 00e61509a8 - 00e61509ac
(XEN) handle /spi@e6b1
(XEN) /spi@e6b1 passthrough = 1 nirq = 1 naddr = 1
(XEN)   - IRQ: 216
(XEN)   - MMIO: 00e6b1 - 00e6b1002c
(XEN) handle /spi@e6b1/flash@0
(XEN) /spi@e6b1/flash@0 passthrough = 1 nirq = 0 naddr = 0
(XEN) handle /spi@e6b1/flash@0/partition@0
(XEN) /spi@e6b1/flash@0/partition@0 passthrough = 1 nirq = 0 naddr = 0
(XEN) handle /spi@e6b1/flash@0/partition@4
(XEN) /spi@e6b1/flash@0/partition@4 passthrough = 1 nirq = 0 naddr = 0
(XEN) handle /spi@e6b1/flash@0/partition@44
(XEN) /spi@e6b1/flash@0/partition@44 passthrough = 1 nirq = 0 naddr = 0
(XEN) handle /spi@e6e2
(XEN) /spi@e6e2 passthrough = 1 nirq = 1 naddr = 1
(XEN)   - IRQ: 188
(XEN)   - MMIO: 00e6e2 - 00e6e20064
(XEN) handle /spi@e6e1
(XEN) /spi@e6e1 passthrough = 1 nirq = 1 naddr = 1
(XEN)   - IRQ: 189
(XEN)   - MMIO: 00e6e1 - 00e6e10064
(XEN) handle /spi@e6e1/pmic@0
(XEN) /spi@e6e1/pmic@0 passthrough = 1 nirq = 0 naddr = 0
(XEN) handle /spi@e6e0
(XEN) /spi@e6e0 passthrough = 1 nirq = 1 naddr = 1
(XEN)   - IRQ: 190
(XEN)   - MMIO: 00e6e0 - 00e6e00064
(XEN) handle /spi@e6c9
(XEN) /spi@e6c9 passthrough = 1 nirq = 1 naddr = 1
(XEN)   - IRQ: 191
(XEN)   - MMIO: 00e6c9 - 00e6c90064
(XEN) handle /usb@ee00
(XEN) /usb@ee00 passthrough = 1 nirq = 1 naddr = 1
(XEN)   - IRQ: 133
(XEN)   - MMIO: 00ee00 - 00ee000c00
(XEN) handle /pci@ee09
(XEN) /pci@ee09 passthrough = 1 nirq = 1 naddr = 2
(XEN)   - IRQ: 140
(XEN)   - MMIO: 00ee09 - 00ee090c00
(XEN)   - MMIO: 00ee08 - 00ee081100
(XEN) Mapping children of /pci@ee09 to guest
(XEN)   - IRQ: 140
(XEN)   - IRQ: 140
(XEN)   - IRQ: 140
(XEN)   - MMIO: 00ee08 - 00ee09
(XEN) handle /pci@ee09/usb@0,1
(XEN) /pci@ee09/usb@0,1 passthrough = 1 nirq = 0 naddr = 0
(XEN) Mapping children of /pci@ee09/usb@0,1 to guest
(XEN) DT: no ranges; cannot enumerate
(XEN) Device tree generation failed (-22).
(XEN)
(XEN) 
(XEN) Panic on CPU 0:
(XEN) Could not set up DOM0 guest OS
(XEN) 
(XEN)
(XEN) Reboot in five seconds...
- 8< -

Mit freundlichen Grüßen / Kind regards

Leopold Kostal GmbH & Co. KG
Automobil Elektrik / Automotive Electrical Systems 

Max Ferger
AEN5 Vorentwicklung Produktinnovationen
Advance Development Innovative Products

Hauert 16, 44227 Dortmund
Deutschland / Germany
Telefon: +49 231 7588 965
E-Mail: m.fer...@kostal.com

Internet: http://www.kostal.com

-Ursprüngliche Nachricht-
Von: Julien Grall [mailto:julien.gr...@citrix.com]
Gesendet: Montag, 19. Oktober 2015 14:44
An: Ferger, Max <m.fer...@kostal.com>; Ian Campbell <ian.campb...@citrix.com>; 
xen-devel@lists.xen.org
Cc: Oleksandr Tyshchenko <oleksandr.tyshche...@globallogic.com>; Iurii 
Konovalenko <iurii.konovale...@globallogic.com>
Betreff: Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

Hello Max,

On 19/10/15 13:09, Ferger, Max wrote:
> - UART enabled -
> - CPU  booting -
> - Xen starting in Hyp mode -
> - Zero BSS -
> - Setting up control registers -
> - Turning on paging -
> - Ready -
> (XEN) Checking for initrd in /chosen
> (XEN) RAM: 4000 - 7fff
> (XEN) RAM: 00014000 - 0001
> (XEN)
> (XEN) MODULE[0]: 407f2000 - 407fd000 Device Tree
> (XEN) MODULE[1]: 7200 - 722fd158 Kernel
> (XEN) MODULE[2]: 7400 - 74002559 XSM
> (XEN)  RESVD[0]: 70f0 - 70f0b000
> (XEN)  RESVD[1]: 7ff9a000 - 7ff9a120
> (XEN)  RESVD[2]: 407f2000 - 407fd000
> (XEN)
> (XEN) Command line: console=dtuart dtuart=/soc/serial@e6c5 
> dom0_mem=1G
> (XEN) Placing Xen at 0x7fc0-0x7fe0
> (XEN) Update BOOTMOD_XEN from 9000-9011b701 =>
> 7fc0-7fd1b701
> (XEN) Xen heap: 0001f800-0002 (32768 pages)
> (XEN) Dom heap: 1015808 pages
> (XEN) Domain heap initialised
> (XEN) Platform: Renesas R-Car Gen2
> (XEN) Looking for dtuart at "/soc/serial@e6c5", options ""
> (XEN) Unable to find device "/soc/serial@e6c5"

You provided the wrong path to the UART. Xen will use earlyprintk rather than 
the console.

If you use the upstream DT (arch/arm/boot/dts/r8a7790-lager.dts), it contains a 
property stdout-path in the chosen node. As Xen is able to understand it, you 
can drop "dtuart=/soc/" and only keep console=dtuart on the command line.

[...]

> (XEN) *** LOADING DOMAIN 0 ***
> (XEN) Loading kernel from boot module @ 7200
> (XEN) Allocating 1:1 mappings total

Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-20 Thread Julien Grall

On 20/10/2015 11:05, Julien Grall wrote:

Thank you for the log. The offending node is /pci@ee09/usb@0,1 which
is (r8a7790.dtsi):

1407 usb@0,1 {
1408 reg = <0x800 0 0 0 0>;
1409 device_type = "pci";
1410 phys = < 0>;
1411 phy-names = "usb";
1412 };
1413

We assume that every node containing device_type = "pci" is a PCI bus.
So Xen is looking for a property "ranges" which is not present.

Although, here it's describing a PCI device. I wasn't able to find a
spec telling that device_type = "pci"; should only be used by the PCI
bus. Ian, do you remember why you implement with this assumption?

For now, I would advice you to drop this node, the next one (usb@0,2)
and doing the same in "pci@ee0d". We can figure out later how to fix
it when you get a DOM0 booting.


Better solution, rather than dropping the nodes can you add "ranges;" in 
each of them. Smth like


usb@0,1 {
  reg = <0x800 0 0 0 0>;
  device_type = "pci";
  phys = < 0>;
  phy-names = "usb";
  ranges;
}

"ranges;" is used to tell the PCI device is using the same address space 
of the PCI bus. There is DT bindings describing how look like the 
subnode and they mandate the property "ranges" (see [1], [2]). Although 
renesas doesn't seem to require it. Might be worth to investigate it.


Regards,

[1] 
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/pci/mvebu-pci.txt
[2] 
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt


--
Julien Grall

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


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-20 Thread Ferger, Max
Adding "ranges;" is a good idea and helps, but gives the same error from  
traps.c +2447.
On a side-note, adding "ranges;" implicates propagating "#address-cells", and 
"#size-cells" values down the DT into the leafs.


-Ursprüngliche Nachricht-
Von: xen-devel-boun...@lists.xen.org [mailto:xen-devel-boun...@lists.xen.org] 
Im Auftrag von Julien Grall
Gesendet: Dienstag, 20. Oktober 2015 12:47
An: Ferger, Max <m.fer...@kostal.com>; Ian Campbell <ian.campb...@citrix.com>; 
xen-devel@lists.xen.org
Cc: Oleksandr Tyshchenko <oleksandr.tyshche...@globallogic.com>; Iurii 
Konovalenko <iurii.konovale...@globallogic.com>
Betreff: Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

On 20/10/2015 11:05, Julien Grall wrote:
> Thank you for the log. The offending node is /pci@ee09/usb@0,1 
> which is (r8a7790.dtsi):
>
> 1407 usb@0,1 {
> 1408 reg = <0x800 0 0 0 0>;
> 1409 device_type = "pci";
> 1410 phys = < 0>;
> 1411 phy-names = "usb";
> 1412 };
> 1413
>
> We assume that every node containing device_type = "pci" is a PCI bus.
> So Xen is looking for a property "ranges" which is not present.
>
> Although, here it's describing a PCI device. I wasn't able to find a 
> spec telling that device_type = "pci"; should only be used by the PCI 
> bus. Ian, do you remember why you implement with this assumption?
>
> For now, I would advice you to drop this node, the next one (usb@0,2) 
> and doing the same in "pci@ee0d". We can figure out later how to 
> fix it when you get a DOM0 booting.

Better solution, rather than dropping the nodes can you add "ranges;" in each 
of them. Smth like

usb@0,1 {
   reg = <0x800 0 0 0 0>;
   device_type = "pci";
   phys = < 0>;
   phy-names = "usb";
   ranges;
}

"ranges;" is used to tell the PCI device is using the same address space of the 
PCI bus. There is DT bindings describing how look like the subnode and they 
mandate the property "ranges" (see [1], [2]). Although renesas doesn't seem to 
require it. Might be worth to investigate it.

Regards,

[1]
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/pci/mvebu-pci.txt
[2]
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt

--
Julien Grall

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



Leopold KOSTAL GmbH & Co. KG - Sitz Lüdenscheid, Registergericht Iserlohn HRA 
2854, phG Kostal Verwaltungsgesellschaft mbH, Registergericht Iserlohn HRB 4061 
- USt-Id-Nr./Vat No.: DE 125800885
Post- und Werksanschrift: An der Bellmerei 10, D-58513 Lüdenscheid * Telefon: 
+49 2351 16-0 * Telefax: +49 2351 16-2400 Bellmerei
Geschäftsführung: Dipl.-Oec. Andreas Kostal (Vorsitzender), Dipl.-Kfm. Helmut 
Kostal, Dipl.-Ing. Marwin Kinzl, Dr.-Ing. Ludger Laufenberg, Dipl.-Kfm. Ulrich 
Zimmermann


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


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-20 Thread Julien Grall

Hi,

On 20/10/2015 12:23, Ferger, Max wrote:

One step closer, thanks again!

Removing the incompatible PCI/USB devices lets Xen boot somewhat further.

Here is the (significant) difference in log output, the full new one is 
appended.

I've back traced the trap message from traps.c +2447:
None of the explicit 'goto bad_data_abort;' calls is responsible, but a fall 
through via traps.c +2444.



+(XEN) traps.c:2447:d0v0 HSR=0x93830007 pc=0xc001e398 gva=0xe7804060 
gpa=0x00e6160060


This traps likely means that DOM0 is trying to access a region which is 
not mapped in stage-2.


In the log GPA is the physical address expected. You can give a look to
the datasheet of your platform to find the corresponding region.

Looking to this GPA, it's used in 
arch/arm/mach-shmobile/setup-rcar-gen2.c to read the mode pins and the 
region is not described in the DT. You will have to map it manually in 
Xen. Give a look to how it's done for omap5 (see omap5_specific_mapping).


BTW, I got confirmation by a person working on this board that there may 
be more regions not described in DT. Although, I don't know all of them :(.


Regards,

--
Julien Grall

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


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-19 Thread Ferger, Max
)  ISA Features: 02101110 13112111 21232041 2131 10011142 
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 1 KHz
(XEN) GICv2 initialization:
(XEN) gic_dist_addr=f1001000
(XEN) gic_cpu_addr=f1002000
(XEN) gic_hyp_addr=f1004000
(XEN) gic_vcpu_addr=f1006000
(XEN) gic_maintenance_irq=25
(XEN) GICv2: 416 lines, 8 cpus, secure (IID 0200043b).
(XEN) XSM Framework v1.0.0 initialized
(XEN) xsm: Policy len = 0x2559 start at 0x7400
(XEN) Flask: 64 avtab hash slots, 236 rules.
(XEN) Flask: 64 avtab hash slots, 236 rules.
(XEN) Flask:  3 users, 3 roles, 36 types, 2 bools
(XEN) Flask:  12 classes, 236 rules
(XEN) Flask:  Starting in permissive mode.
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Allocated console ring of 64 KiB.
(XEN) VFP implementer 0x41 architecture 4 part 0x30 variant 0xf rev 0x0
(XEN) Bringing up CPU1
(XEN) CPU1 never came online
(XEN) Failed to bring up CPU 1 (error -5)
(XEN) Bringing up CPU2
(XEN) CPU2 never came online
(XEN) Failed to bring up CPU 2 (error -5)
(XEN) Bringing up CPU3
(XEN) CPU3 never came online
(XEN) Failed to bring up CPU 3 (error -5)
(XEN) Bringing up CPU4
(XEN) CPU4 never came online
(XEN) Failed to bring up CPU 4 (error -5)
(XEN) Bringing up CPU5
(XEN) CPU5 never came online
(XEN) Failed to bring up CPU 5 (error -5)
(XEN) Bringing up CPU6
(XEN) CPU6 never came online
(XEN) Failed to bring up CPU 6 (error -5)
(XEN) Bringing up CPU7
(XEN) CPU7 never came online
(XEN) Failed to bring up CPU 7 (error -5)
(XEN) Brought up 1 CPUs
(XEN) P2M: 40-bit IPA
(XEN) P2M: 3 levels with order-1 root, VTCR 0x80003558
(XEN) I/O virtualisation disabled
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading kernel from boot module @ 7200
(XEN) Allocating 1:1 mappings totalling 1024MB for dom0:
(XEN) BANK[0] 0x004800-0x007000 (640MB)
(XEN) BANK[1] 0x01d800-0x01f000 (384MB)
(XEN) Grant table range: 0x007fc0-0x007fc72000
(XEN) DT: no ranges; cannot enumerate
(XEN) Device tree generation failed (-22).
(XEN)
(XEN) 
(XEN) Panic on CPU 0:
(XEN) Could not set up DOM0 guest OS
(XEN) 
(XEN)
(XEN) Reboot in five seconds...
- 8< -


Mit freundlichen Grüßen / Kind regards

Leopold Kostal GmbH & Co. KG
Automobil Elektrik / Automotive Electrical Systems 

Max Ferger 
AEN5 Vorentwicklung Produktinnovationen
Advance Development Innovative Products

Hauert 16, 44227 Dortmund
Deutschland / Germany
Telefon: +49 231 7588 965
E-Mail: m.fer...@kostal.com

Internet: http://www.kostal.com

-Original Message-
From: Ian Campbell [mailto:ian.campb...@citrix.com]
Sent: Donnerstag, 15. Oktober 2015 16:28
To: Ferger, Max <m.fer...@kostal.com>; xen-devel@lists.xen.org
Cc: Iurii Konovalenko <iurii.konovale...@globallogic.com>; Oleksandr Tyshchenko 
<oleksandr.tyshche...@globallogic.com>
Subject: Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

On Thu, 2015-10-15 at 14:17 +, Ferger, Max wrote:
> 
> I just managed to get Xen 4.6.0 on my R-Car H2 LAGER board to show up 
> boot messages, as appended.
> But it refuses my intended Dom0 kernel – some Yocto/Poky built with 
> meta -renesas configuration.
>  
> Is there a known-good Dom0 kernel for this board?
> Hopefully one that I may re-create with something like bitbake?
> What about an automotive solution?
>  
> Thank you very much in advance!
>  
> Max Ferger
[...]
> (XEN) RAM: 4000 - 7fff
> (XEN) RAM: 00014000 - 0001
> (XEN)
> (XEN) MODULE[0]: 407f3000 - 407fd000 Device Tree
> (XEN)  RESVD[0]: 70f0 - 70f0a000
> (XEN)  RESVD[1]: 7ff9a000 - 7ff9a120
> (XEN)  RESVD[2]: 407f3000 - 407fd000 [...]
> (XEN) *** LOADING DOMAIN 0 ***
> (XEN) Missing kernel boot module?

You don't appear to have passed a dom0 kernel to Xen. e.g. it is not listed as 
a MODULE[N].

See
http://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions#Booting_Xen
 which describes how to setup the DTB to reference the kernel boot module etc.

It would also be useful if you would post your complete boot script.

Also, I'm CCing the original contributors of the Lager support, since we don't 
have much knowledge of this specific platform or where to get kernels from etc.

Ian.

> (XEN)
> (XEN) 
> (XEN) Panic on CPU 0:
> (XEN) Could not set up DOM0 guest OS
> (XEN) 
> (XEN)
> (XEN) Reboot in five seconds...
> [Nothing happens any more]
> - 8< -
>  [...]



Leopold KOSTAL GmbH & Co. KG - Sitz Lüdenscheid, Registergericht Iserlohn HRA 
2854, phG Kostal Verwaltungsgesellschaft mbH, Registergericht Iserlohn HRB 4061 
- USt-Id-Nr./Vat No.: DE

Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-19 Thread Julien Grall
Hello Max,

On 19/10/15 13:09, Ferger, Max wrote:
> - UART enabled -
> - CPU  booting -
> - Xen starting in Hyp mode -
> - Zero BSS -
> - Setting up control registers -
> - Turning on paging -
> - Ready -
> (XEN) Checking for initrd in /chosen
> (XEN) RAM: 4000 - 7fff
> (XEN) RAM: 00014000 - 0001
> (XEN)
> (XEN) MODULE[0]: 407f2000 - 407fd000 Device Tree
> (XEN) MODULE[1]: 7200 - 722fd158 Kernel
> (XEN) MODULE[2]: 7400 - 74002559 XSM
> (XEN)  RESVD[0]: 70f0 - 70f0b000
> (XEN)  RESVD[1]: 7ff9a000 - 7ff9a120
> (XEN)  RESVD[2]: 407f2000 - 407fd000
> (XEN)
> (XEN) Command line: console=dtuart dtuart=/soc/serial@e6c5 dom0_mem=1G
> (XEN) Placing Xen at 0x7fc0-0x7fe0
> (XEN) Update BOOTMOD_XEN from 9000-9011b701 => 
> 7fc0-7fd1b701
> (XEN) Xen heap: 0001f800-0002 (32768 pages)
> (XEN) Dom heap: 1015808 pages
> (XEN) Domain heap initialised
> (XEN) Platform: Renesas R-Car Gen2
> (XEN) Looking for dtuart at "/soc/serial@e6c5", options ""
> (XEN) Unable to find device "/soc/serial@e6c5"

You provided the wrong path to the UART. Xen will use earlyprintk rather
than the console.

If you use the upstream DT (arch/arm/boot/dts/r8a7790-lager.dts), it
contains a property stdout-path in the chosen node. As Xen is able to
understand it, you can drop "dtuart=/soc/" and only keep console=dtuart
on the command line.

[...]

> (XEN) *** LOADING DOMAIN 0 ***
> (XEN) Loading kernel from boot module @ 7200
> (XEN) Allocating 1:1 mappings totalling 1024MB for dom0:
> (XEN) BANK[0] 0x004800-0x007000 (640MB)
> (XEN) BANK[1] 0x01d800-0x01f000 (384MB)
> (XEN) Grant table range: 0x007fc0-0x007fc72000
> (XEN) DT: no ranges; cannot enumerate
> (XEN) Device tree generation failed (-22).

Can you turn on DEBUG_DT in xen/arch/arm/domain_build.c (see patch [1])
and paste the log here?

Also, can you send the device tree you are using?

Regards,

[1]
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 0c3441a..bdb8b1f 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -40,7 +40,7 @@ static void __init parse_dom0_mem(const char *s)
 }
 custom_param("dom0_mem", parse_dom0_mem);
 
-//#define DEBUG_DT
+#define DEBUG_DT
 
 #ifdef DEBUG_DT
 # define DPRINT(fmt, args...) printk(XENLOG_DEBUG fmt, ##args)

-- 
Julien Grall

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


Re: [Xen-devel] Dom0 kernel for Xen4.6 on R-Car H2 (LAGER)

2015-10-15 Thread Ian Campbell
On Thu, 2015-10-15 at 14:17 +, Ferger, Max wrote:
> 
> I just managed to get Xen 4.6.0 on my R-Car H2 LAGER board to show up
> boot messages, as appended.
> But it refuses my intended Dom0 kernel – some Yocto/Poky built with meta
> -renesas configuration.
>  
> Is there a known-good Dom0 kernel for this board?
> Hopefully one that I may re-create with something like bitbake?
> What about an automotive solution?
>  
> Thank you very much in advance!
>  
> Max Ferger
[...]
> (XEN) RAM: 4000 - 7fff
> (XEN) RAM: 00014000 - 0001
> (XEN)
> (XEN) MODULE[0]: 407f3000 - 407fd000 Device Tree
> (XEN)  RESVD[0]: 70f0 - 70f0a000
> (XEN)  RESVD[1]: 7ff9a000 - 7ff9a120
> (XEN)  RESVD[2]: 407f3000 - 407fd000
> [...]
> (XEN) *** LOADING DOMAIN 0 ***
> (XEN) Missing kernel boot module?

You don't appear to have passed a dom0 kernel to Xen. e.g. it is not listed
as a MODULE[N].

See 
http://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions#Booting_Xen
 which describes how to setup the DTB to reference the kernel boot module
etc.

It would also be useful if you would post your complete boot script.

Also, I'm CCing the original contributors of the Lager support, since we
don't have much knowledge of this specific platform or where to get kernels
from etc.

Ian.

> (XEN)
> (XEN) 
> (XEN) Panic on CPU 0:
> (XEN) Could not set up DOM0 guest OS
> (XEN) 
> (XEN)
> (XEN) Reboot in five seconds...
> [Nothing happens any more]
> - 8< -
>  
>  
>  
> Leopold KOSTAL GmbH & Co. KG - Sitz Lüdenscheid, Registergericht Iserlohn
> HRA 2854, phG Kostal Verwaltungsgesellschaft mbH, Registergericht
> Iserlohn HRB 4061 - USt-Id-Nr./Vat No.: DE 125800885
> Post- und Werksanschrift: An der Bellmerei 10, D-58513 Lüdenscheid *
> Telefon: +49 2351 16-0 * Telefax: +49 2351 16-2400 Bellmerei
> Geschäftsführung: Dipl.-Oec. Andreas Kostal (Vorsitzender), Dipl.-Kfm.
> Helmut Kostal, Dipl.-Ing. Marwin Kinzl, Dr.-Ing. Ludger Laufenberg, Dipl.
> -Kfm. Ulrich Zimmermann
>  
> ___
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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