Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 200
» Latest member: Jonny123
» Forum threads: 69
» Forum posts: 326

Full Statistics

Online Users
There are currently 27 online users.
» 0 Member(s) | 27 Guest(s)

Latest Threads
Zynq mpsoc dev kit not ab...
Forum: Public Support
Last Post: Nathan.Studer
11-08-2017, 01:24 PM
» Replies: 4
» Views: 2,267
Rebuilding Xen Tools
Forum: Getting Started
Last Post: brettstahlman
11-03-2017, 02:58 PM
» Replies: 2
» Views: 148
SIGBUS: "ttbr address siz...
Forum: Getting Started
Last Post: brettstahlman
11-01-2017, 09:53 PM
» Replies: 8
» Views: 603
FIT Image file handling
Forum: Public Support
Last Post: jarvis_roach
10-16-2017, 12:23 PM
» Replies: 7
» Views: 4,082
Using Petalinux to build ...
Forum: Getting Started
Last Post: brettstahlman
10-13-2017, 04:26 PM
» Replies: 11
» Views: 742
Building a custom Xen hyp...
Forum: Getting Started
Last Post: jarvis_roach
10-10-2017, 12:37 PM
» Replies: 3
» Views: 319
XZD Yocto Layer
Forum: Knowledge Base
Last Post: sraxlz
10-02-2017, 07:32 PM
» Replies: 9
» Views: 1,915
Possible to run older ver...
Forum: Getting Started
Last Post: Robert.VanVossen
08-28-2017, 08:02 PM
» Replies: 3
» Views: 665
Which qemu-system-aarch64...
Forum: Getting Started
Last Post: brettstahlman
08-15-2017, 01:55 PM
» Replies: 2
» Views: 471
DomU I/O and Communicatio...
Forum: Public Support
Last Post: Nathan.Studer
08-14-2017, 01:21 PM
» Replies: 3
» Views: 1,878

 
  Rebuilding Xen Tools
Posted by: brettstahlman - 10-26-2017, 04:25 PM - Forum: Getting Started - Replies (2)

Incidentally, what's the recommended way to get rebuilt xen tools libraries into the dom0 rootfs? I added some debug code to the libxenforeignmemory source, but it had no effect, apparently because the dom0 rootfs is populated with pre-built binaries. I'm sure I could use losetup/kpartx etc. to copy them in manually, but this would be tedious, especially if I have to do it often. I'm hoping there's a more automated way...

One other build issue I've run into now that I'm building Xen proper with Petalinux and Xen tools manually (make dist-tools) is that the CONFIG_EARLY_PRINTK=ronaldo recommended in the XZD UM seems to cause multiple definition errors (e.g., on early_puts) when I attempt to rebuild Xen proper after having built the tools manually. I tried setting CONFIG_EARLY_PRINTK=ronaldo when building Xen proper also, but that didn't fix it. Ended up having to do a full clean to get Xen building again...

Thanks,
Brett S.

Print this item

  SIGBUS: "ttbr address size fault", possibly caused by .dtb issue
Posted by: brettstahlman - 10-19-2017, 05:04 PM - Forum: Getting Started - Replies (8)

I've written a small app, designed to run in dom0, which uses the Xen "foreignmemory" interface to read arbitrary pages within a user domain. The call to perform the memory mapping succeeds, and a pointer to the mapped buffer is returned by xenforeignmemory_map(). But I get a SIGBUS as soon as I attempt to access the data in the buffer:


Code:
(XEN) traps.c:2508:d0v1 <register values...>
[    62.1234413] Unhandled fault: ttbr address size fault (0x92000000) at 0x0000007fxxxxxxxx
Bus error

Note that the timestamped "Unhandled fault" message is actually from the linux kernel (mm/fault.c). I suspect the "address size fault" occurs because something is telling Xen that 0x7fxxxxxxxx is an invalid (too large) address. Looking in $(RELEASE_DIR)/dts/xen-zcu102.dts, I see the following:
Code:
    memory {
        device_type = "memory";
        reg = <0x0 0x0 0x0 0x80000000 0x8 0x0 0x0 0x80000000>;
    };

...which, IIUC, defines 2, 2G memory regions: one at address 0, the other at address 0x800000000. Adding 2G to the start of the upper range gives an end address of 0x880000000, which is significantly below the address of the buffer I'm attempting to access. Accordingly, I tried modifying the memory device entry to increase the sizes from 0x80000000 to 0x8000000000, which should have placed the offending address within both upper and lower ranges, but the error persisted. Is there another DTB file I would need to modify? The one I modified is the one that gets copied to the sd card's boot partition, which I'm assuming is used by the Xen kernel, not Dom0 itself. I just looked at zynqmp-zcu102.dts (under $RELEASE_DIR/components/linux-kernel/xlnx-4.6/arch/arm64/boot/dts) and saw that its memory node looks identical to the one above, so perhaps that's the problem. But if so, it seems odd that mmap() (used by xenforeignmemory_map() to allocate the buffer) would return an address outside the default ranges defined in the kernel's device tree. Isn't the kernel supposed to use the information in the device tree to configure its memory management? As a test, I allocated a buffer with malloc(), and it was placed at 0x3xxxxxxx, well within the configured limits. (Unfortunately, xenforeignmemory_map() doesn't allow you to pass a pointer to the desired buffer the way mmap() does...)
Is the device tree the likely cause of the SIGBUS error? If so, is changing the memory node's "reg" property the right fix, or does the fact that mmap() returns an address above 4G point to a problem elsewhere?
Thanks,
Brett S.

Print this item

  Using Petalinux to build custom apps that use Xen libraries
Posted by: brettstahlman - 10-09-2017, 08:49 PM - Forum: Getting Started - Replies (11)

I'm trying to build a custom app that uses Xen libraries and runs in Dom0. The docs I've seen suggest creating a custom app like this:

Code:
petalinux-create -t apps -n myapp --enable

But I haven't seen any documentation on the Makefile incantations required to make Xen header files and libraries accessible. Xen itself defines a bunch of helpful macros in $(XEN_ROOT)/tools/Rules.mk, but when I attempted to include Rules.mk in the custom app Makefile created by Petalinux, the build failed with an error indicating I needed to run ./configure before building or installing the tools. Further complicating matters is the path munging Petalinux performs on the gcc command line used to build the custom app's C file. I suspect the path munging is needed because source files are copied to a location under "build/linux/rootfs", but it makes determination of -I directives messy; moreover, even after adjusting the -I directives to fix the "file not found" errors, I'm still getting a slough of weird compile errors from standard header files. Note that the actual custom code is still stubbed out at this point; the errors stem from my attempt to include a single Xen header file. The --sysroot option is pointing to build/linux/rootfs/stage. I've also used -I to add the following directories to CFLAGS...

build/linux/rootfs/apps/xen/xen-src/xen/include/public
build/linux/rootfs/apps/xen/xen-src/tools/libs/foreignmemory/include
build/linux/rootfs/apps/xen/xen-src/tools/include
build/linux/kernel/xlnx-4.6/source/include

It occurred to me that it might be easier to create my app under the Xen source tree: i.e.,

components/apps/xen/xen-src/tools/myapp

But I'm not sure whether/how this approach would be supported by Petalinux. I tried creating a tool app manually, by adding a C file and updating the common tools Makefile accordingly, but I couldn't get Petalinux to build it. Apparently, Xen itself doesn't depend on these tools, and it wasn't clear from the help how to force petalinux-build to build a specific tool under components/apps/xen/xen-src/tools.

I can't imagine that what I'm trying to do is all that unusual, which makes me think there must be a standard mechanism for it. Any information/documentation you can provide would be greatly appreciated...

Thanks,
Brett Stahlman

Print this item

  Building a custom Xen hypervisor
Posted by: brettstahlman - 10-05-2017, 03:55 PM - Forum: Getting Started - Replies (3)

The User's Manual recommends using Petalinux to build the Xen kernel. I don't recall ever running Petalinux, so I'm assuming the xen.ub I've been using is a pre-compiled binary that ships with XZD. I need to customize Xen, but would prefer doing so without Petalinux: i.e., I'd prefer simply incorporating the Xen source into my project and configuring/building the standard Xen way. Is this possible, or does Petalinux contain some "secret sauce" that would be difficult to replace? If I can simply download and build the Xen source, what are the version constraints? I'm currently using the 2016.3 release of the Xilinx toolchain. If I do need to use Petalinux, is there an easy way to use it to build Xen only (and not Dom0 kernel, U-Boot, FSBL, etc...)?

Thanks,
Brett S.

Print this item

  Possible to run older versions of xilinx linux kernel on zynqmp ultrascale+?
Posted by: brettstahlman - 08-18-2017, 06:51 PM - Forum: Getting Started - Replies (3)

I would like to run a 3.x linux kernel on my zynqmp ultrascale+ (ZCU102), rather than the 4.x kernel that corresponds to the latest xlnx-linux release. Accordingly, I checked out the version of xlnx-linux tagged as 2013.4 (which used v3.12 kernel), and I was able to build it after making some minor tweaks (e.g., adding zcu102-specific DTS files). But it hangs near the beginning of boot. I'll probably try to enable some additional debug information, but I'd like to know before I get too far down the debugging path whether what I'm trying to do is even feasible. What is the earliest kernel version on which the xilinx linux kernel has been tested on the ZCU102?

Thanks,
Brett S.

Print this item

  Which qemu-system-aarch64 should be in path?
Posted by: brettstahlman - 08-14-2017, 09:56 PM - Forum: Getting Started - Replies (2)

Hello,
I've installed both XZD (2016.12.31) and the Xilinx SDK (2016.3), and am uncertain as to which of the following qemu-system-aarch64 binaries I should be using:

  • Debian system (v2.5.0)
  • Xilinx SDK (v2.2.50)
  • XZD tools/hsm/bin (v2.2.50)
  • XZD tools/linux-i386/petalinux/bin (v2.2.50)
Sourcing settings64.sh in the Xilinx SDK puts the Xilinx SDK version in my PATH, but text in the XZD user manual makes it sound as though I should be using the one that ships with XZD. The version numbers of the XZD/Xilinx binaries are actually indentical, but perhaps they're different builds? Any information would be greatly appreciated...
Thanks,
Brett S.

Print this item

  SD card booting hangs stage 4, ES1
Posted by: jrheisey - 07-20-2017, 08:22 PM - Forum: Public Support - Replies (1)

 
Using the prebuilt binary files from XZD_20161231.gz.
There are no errors. It just stops during Stage 4 as demonstrated in thread
http://xzdforums.dornerworks.com/showthr...In+Stage+4
Here is the console output.
 
 
Xilinx Zynq MP First Stage Boot Loader
Release 2016.3   Jan  5 2017  -  11:58:09
Platform: Silicon (1.0), Cluster ID 0x80000000
Running on A53-0 (64-bit) Processor, Device Name: XCZU9EG
Board Configuration successful
Processor Initialization Done
================= In Stage 2 ============
SD1 Boot Mode
SD: rc= 0
File name is BOOT.BIN
Multiboot Reg : 0x0
Image Header Table Offset 0x8C0
*****Image Header Table Details********
Boot Gen Ver: 0x1020000
No of Partitions: 0x4
Partition Header Address: 0x440
Partition Present Device: 0x0
Initialization Success
======= In Stage 3, Partition No:1 =======
UnEncrypted data Length: 0x1800
Data word offset: 0x1800
Total Data word length: 0x1800
Destination Load Address: 0xFFFEA000
Execution Address: 0xFFFEA000
Data word offset: 0x8A20
Partition Attributes: 0x116
Partition 1 Load Success
======= In Stage 3, Partition No:2 =======
UnEncrypted data Length: 0x8
Data word offset: 0x8
Total Data word length: 0x8
Destination Load Address: 0xFFFF0000
Execution Address: 0x0
Data word offset: 0xA220
Partition Attributes: 0x116
Partition 2 Load Success
======= In Stage 3, Partition No:3 =======
UnEncrypted data Length: 0x22B80
Data word offset: 0x22B80
Total Data word length: 0x22B80
Destination Load Address: 0x8000000
Execution Address: 0x8000000
Data word offset: 0xA230
Partition Attributes: 0x116
Partition 3 Load Success
All Partitions Loaded
================= In Stage 4 ============
Protection configuration applied
  ATF running on XCZU9EG/silicon v1/RTL5.1 at 0xfffea000
NOTICE:  BL31: Secure code at 0x0
NOTICE:  BL31: Non secure code at 0x0
NOTICE:  BL31: v1.2(release):2c2b23f
NOTICE:  BL31: Built : 11:58:24, Jan  5 2017
 
Note that my boot output says
 
ATF running on XCZU9EG/silicon v1/RTL5.1 at 0xfffea000
 
Where the boot in the below referenced forum thread is
 
ATF running on XCZU9EG/silicon v3/RTL5.1 at 0xfffea000
 
Is this relevant?

I am going down the path of rebuilding u-boot.

_____________________________________________________
The Xen-Zynq-Distribution-XZD-Users-Manual.pdf says …
 
If the U-Boot boot command was not modified, you will need to interrupt the startup sequence and enter the boot commands manually:
U-Boot-PetaLinux> fatload mmc 0:1 $fdt_addr xen.dtb
U-Boot-PetaLinux> fdt addr $fdt_addr
U-Boot-PetaLinux> fdt resize
U-Boot-PetaLinux> fatload mmc 0:1 0x80000 Image
U-Boot-PetaLinux> fdt set /chosen/dom0 reg <0 0x80000 0x$filesize>
U-Boot-PetaLinux> fatload mmc 0:1 6000000 xen.ub
U-Boot-PetaLinux> bootm 6000000 - $fdt_addr
 
The document does not say how to interrupt the startup sequence.
Pressing CTL->C after the last output has no effect.



Regards,
J.R. Heisey
 

Print this item

  SD card does not boot past stage 2
Posted by: jrheisey - 07-13-2017, 12:01 AM - Forum: Public Support - Replies (5)

Greetings,


Code:
Xilinx Zynq MP First Stage Boot Loader
Release 2016.3   Jan  5 2017  -  11:58:09
Platform: Silicon (3.0), Cluster ID 0x80000000
Running on A53-0 (64-bit) Processor, Device Name: XCZU9EG
Board Configuration successful
Processor Initialization Done
================= In Stage 2 ============
SD1 with level shifter Boot Mode
SD: rc= 0
File name is BOOT.BIN
SD: Unable to open file BOOT.BIN: 3
                                   XFSBL_ERROR_SD_F_OPEN
Boot Device Initialization failed 0x29
================= In Stage Err ============
Fsbl Error Status: 0x0
  • I am using the binaries from XZD_20161231.gz
  • I followed most of instructions in Xen-Zynq-Distribution-XZD-Users-Manual.pdf
  • I deviated only by putting the files directly on the SD card rather than an image file due to technical issues
  • I am using CentOS as a guest in VirtualBox on Windows 7 host
  • I created the xen-zcu102_sd.dtb using the patch in the user's manual (above) and PetaLinux v2015.4 and vivado 2017.2
  • I have HW-Z1-ZCU102 revision 1.0
Questions:
  • Could this be an issue with using fdisk, mounting the SD card and coping files?
  • Could this be a compatibility issue between the hardware and the pre-built binary files?
  • I do not have a reason to build my own binaries at this time
  • My goal is to run some user mode software under the hypervisor for testing purposes
  • If the SD card configuration is most likely to be the problem then I am considering getting a physical computer with Ubuntu 14.04 as what is recommended in the DornerWorks' user's manual.
J.R. Heisey

Print this item

  kpartx won't mount root partition
Posted by: jrheisey - 07-11-2017, 09:10 PM - Forum: Public Support - Replies (1)

Here are the steps from the document from DornerWorks Xen-Zynq-Distribution-XZD-Users-Manual.pdf

Quote:1. Create a new clean two partition image.
   $ dd if=/dev/zero of=$RELEASE_DIR/dist/images/sdcard.img bs=1G count=7
   $ echo -e "n\np\n1\n\n+256M\nt\nc\nn\np\n2\n\n\nt\n2\n83\nw\n" | fdisk
   $RELEASE_DIR/dist/images/sdcard.img
2. Install kpartx if it is not already.
   $ sudo apt-get install kpartx
3. Mount both partitions of the image using kpartx.
   sudo kpartx -av $RELEASE_DIR/dist/images/sdcard.img
   sudo mkfs.vfat /dev/mapper/loop1p1
   sudo mkfs.ext4 /dev/mapper/loop1p2

I am using CentOS as a guest of VirtualBox with Windows 7 as the host OS.
I have a couple of issues with the document.
  • For dd I changed the count=7 to count=15 for my larger SD card.
  • The string piped to fdisk did not work out-of-the-box. I needed to manually run fdisk to create the two partitions.
  • The string shows the first partition set to the system ID of 'c' which is 'W95 FAT32 (LBA)'.
          I tried leaving it at the default of '83' for 'Linux' but it did not change the behavior of kpartx.
  • Result of kpartx
         $ sudo kpartx -av $RELEASE_DIR/dist/images/sdcard.img
         [sudo] password for username:
         add map loop0p2 (253:2): 0 14680001 linear /dev/loop0 63
  • mkfs.*: loop1 part of loop1p1 reference is not appropriate for my system because it is mounting as loop0. Easy to compensate.
  • In the two mkfs.vfat command loop0p1 is not mounted at all just loop0p2.
My specific question is why kpartx won't mount the root partition of sdcard.img?


Results from fdisk -l
Code:
Disk /media/sf_projects/RDP3/XZD_20161231/dist/images/sdcard.img: 16.1 GB, 16106127360 bytes, 31457280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x322d1bed
                                                      Device Boot      Start         End      Blocks   Id  System
/media/sf_projects/RDP3/XZD_20161231/dist/images/sdcard.img1            2048     2099199     1048576   83  Linux
/media/sf_projects/RDP3/XZD_20161231/dist/images/sdcard.img2         2099200    31457279    14679040   83  Linux

Print this item

  booting from SD card
Posted by: albanbourge - 06-30-2017, 09:55 AM - Forum: Public Support - Replies (5)

Hello everyone,

My question is probably related with http://xzdforums.dornerworks.com/showthread.php?tid=651, but unfortunately, I was not able to make it work with the solution presented there.
When following the tutorial for booting from SD card, I'm stuck a the booting process.
Here is the log.

Code:
Xilinx Zynq MP First Stage Boot Loader
Release 2016.3   Jan  5 2017  -  11:58:09
Platform: Silicon (3.0), Cluster ID 0x80000000
Running on A53-0 (64-bit) Processor, Device Name: XCZU9EG
Board Configuration successful
Processor Initialization Done
================= In Stage 2 ============
SD1 with level shifter Boot Mode
SD: rc= 0
File name is BOOT.BIN
SD: Unable to open file BOOT.BIN: 3
                                  XFSBL_ERROR_SD_F_OPEN
Boot Device Initialization failed 0x29
================= In Stage Err ============
Fsbl Error Status: 0x0
I thought about a tool version problem and incompatibility between the boot.bin given and the board I have (ZCU102 rev 1.0 ES2) which is not the same from the tutorial I think because the SW6 configuration shown is not the same (must be 0xE, see UG1182). Hence I tried regenerating the boot.bin with newer SDK version. So I did as the tutorial said for generating a new boot.bin with SDK 2017.2 and get exactly the same error.
Next, I tried to use an FSBL generated with SDK 2017.2. So I started a blank project targeting the board and generated an newer fsbl. I next generated the boot.bin with the same procedure and got :
Code:
Xilinx Zynq MP First Stage Boot Loader
Release 2017.2   Jun 30 2017  -  10:53:29
Reset Mode      :       System Reset
Platform: Silicon (3.0), Cluster ID 0x80000000
Running on A53-0 (64-bit) Processor, Device Name: XCZU9EG
Board Configuration successful
Processor Initialization Done
================= In Stage 2 ============
SD1 with level shifter Boot Mode
SD: rc= 0
File name is BOOT.BIN
Multiboot Reg : 0x0
Image Header Table Offset 0x8C0
*****Image Header Table Details********
Boot Gen Ver: 0x1020000
No of Partitions: 0x4
Partition Header Address: 0x440
Partition Present Device: 0x0
Initialization Success
======= In Stage 3, Partition No:1 =======
UnEncrypted data Length: 0x1800
Data word offset: 0x1800
Total Data word length: 0x1800
Destination Load Address: 0xFFFEA000
Execution Address: 0xFFFEA000
Data word offset: 0x76E0
Partition Attributes: 0x116
Partition 1 Load Success
======= In Stage 3, Partition No:2 =======
UnEncrypted data Length: 0x8
Data word offset: 0x8
Total Data word length: 0x8
Destination Load Address: 0xFFFF0000
Execution Address: 0x0
Data word offset: 0x8EE0
Partition Attributes: 0x116
Partition 2 Load Success
======= In Stage 3, Partition No:3 =======
UnEncrypted data Length: 0x22B80
Data word offset: 0x22B80
Total Data word length: 0x22B80
Destination Load Address: 0x8000000
Execution Address: 0x8000000
Data word offset: 0x8EF0
Partition Attributes: 0x116
Partition 3 Load Success
All Partitions Loaded
================= In Stage 4 ============
Protection configuration applied
 ATF running on XCZU9EG/silicon v3/RTL5.1 at 0xfffea000
NOTICE:  BL31: Secure code at 0x0
NOTICE:  BL31: Non secure code at 0x0
NOTICE:  BL31: v1.2(release):2c2b23f
NOTICE:  BL31: Built : 11:58:24, Jan  5 2017


And the console is stuck there. U-boot doesn't show up.

Any idea what I should do ?
Thanks in advance !

Print this item