R-Car/Boards/S4SK/Xen-Hypervisor/SDK-v3.16.0

From eLinux.org
Jump to: navigation, search


Host PC

Ubuntu 20.04 LTS (64bit) is recommended as OS. 32bit version is not supported.

Software revisions

Software Revision
R-Car SDK v3.16.0
R-Car S4 Linux Yocto package Version 5.24.0
Yocto Project 3.1.11
aarch64-poky-linux-gcc (GCC) 9.3
Xen Hypervisor 4.17-unstable
Dom0 (Linux kernel) 5.10.41/rcar-5.1.7.rc11
DomD (Linux kernel) v5.10.41/rcar-5.1.7.rc11-xt
DomU (Linux kernel) v5.10.41/rcar-5.1.7.rc11-xt
Userland 64/32bit 64
U-Boot 2020.10

How to build

See also : https://github.com/renesas-rcar/meta-xt-prod-devel-rcar-gen4/blob/s4sk-mp-1.0/doc/building.md

Installation of required tools and libraries

Ubuntu is used as Linux Host PC since Yocto Project Quick Start specifies Ubuntu as one of the distributions. You need to install the required packages as follows.

sudo apt-get install -y gawk wget diffstat texinfo chrpath socat \
libsdl1.2-dev python-crypto checkpolicy python3-git python3-github \
bzr pigz m4 lftp openjdk-8-jdk git-core gnupg flex \
bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib \
libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev \
ccache libgl1-mesa-dev libcap-ng-dev libxml2-utils xsltproc unzip \
python-clang-6.0 gcc-7 g++-7 bc python3-pyelftools python3-pip \
python3-crypto libpixman-1-dev libcap-dev device-tree-compiler libffi-dev \
python-dev libgit2-dev ninja-build curl

Using build script

  1. Build script(build.sh)
    #!/bin/bash
    
    # Install moulin
    pip3 install --upgrade pip
    export PATH="$PATH:${HOME}/.local/bin"
    pip3 install --user git+https://github.com/xen-troops/moulin
    
    # build
    mkdir build-xen
    cd build-xen
    export WORK_XEN=`pwd`
    curl -O https://raw.githubusercontent.com/renesas-rcar/meta-xt-prod-devel-rcar-gen4/s4sk-mp-1.0/prod-devel-rcar-s4sk.yaml
    moulin prod-devel-rcar-s4sk.yaml --ENABLE_DOMU=yes
    ninja
    
  2. build
    ./build.sh
    

Manual steps

  1. Install moulin
    pip3 install --upgrade pip
    export PATH="$PATH:${HOME}/.local/bin"
    pip3 install --user git+https://github.com/xen-troops/moulin
    
  2. Build
    mkdir build-xen
    cd build-xen
    export WORK_XEN=`pwd`
    curl -O https://raw.githubusercontent.com/renesas-rcar/meta-xt-prod-devel-rcar-gen4/s4sk-mp-1.0/prod-devel-rcar-s4sk.yaml
    moulin prod-devel-rcar-s4sk.yaml --ENABLE_DOMU=yes
    ninja
    
  3. Building image can take up to a few hours depending on your host system performance.
    After the build has been completed successfully, you should see the output similar to:
    NOTE: Tasks Summary: Attempted 2734 tasks of which 1752 didn't need to be rerun and all succeeded.
    

Generated images

Dom0: ${WORK_XEN}/yocto/build-dom0/tmp/deploy/images/generic-armv8-xt/
DomD: ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/
DomU: ${WORK_XEN}/yocto/build-domu/tmp/deploy/images/s4sk/
Domain Expected output Description
Dom0 Image Dom0 Linux kernel image
uInitramfs Dom0 ramfs((Included DomD/U Images and device trees))
DomD rcar-image-minimal-s4sk.tar.bz2 DomD rootfs
r8a779f0-s4sk -xen.dtb Xen device trees
xenpolicy-s4sk
xen-uImage
Xen image
u-boot-elf-s4sk.srec U-Boot
bl31-s4sk.srec Trusted Firmware-A (BL31)
tee-s4sk.srec OP-TEE OS
DomU rcar-image-minimal-s4sk.tar.bz2 DomU rootfs
Sample built Image is below.
https://hydrochoerus.com/rcar/s4sk-xen/build-xen/

How to flash/update the loader

$ ls -1  ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/*.srec
yocto/build-domd/tmp/deploy/images/s4sk/bl31-s4sk.srec
yocto/build-domd/tmp/deploy/images/s4sk/tee-s4sk.srec
yocto/build-domd/tmp/deploy/images/s4sk/u-boot-elf-s4sk-v2020.10+gitAUTOINC+616f05eb5a-r0.srec
yocto/build-domd/tmp/deploy/images/s4sk/u-boot-elf-s4sk.srec
yocto/build-domd/tmp/deploy/images/s4sk/u-boot-elf.srec
Write the generated bl31-s4sk.srec, tee-s4sk.srec and u-boot-elf-s4sk.srec binaries to flash
See : R-Car/Boards/S4SK#How_to_flash.2Fupdate_the_loader


How to boot

Micro SD card(32GB or more) boot

WARNING! These steps will erase the SD card completely. In short, all files will be lost.

Follow these steps on the host machine:
NOTE: probably you need to be a root user, hence use "sudo". And "mmcblk0" should be adapted to your environment (eg., sdb or sdc).

  1. Delete all the partitions in the SD card. Below is an example for one partition, repeat the process for all the remaining partitions in the SD card if exists.
    Ex)
    $ fdisk /dev/mmcblk0
    Command (m for help): d
    Partition number (2-4, default 1): 1 (number of the first partion)
    Partition 1 has been deleted.
    
  2. Divide the SD card into three partions and set ID=83(Linux) for each.
    Ex)
    $ fdisk /dev/mmcblk0
    Command (m for help): n
    Partition type
    p primary (0 primary, 0 extended, 4 free)
    e extended (container for logical partitions)
    Select (default p): p
    Partition number (1-4, default 1): 1 (number of the first partion)
    First sector (2048-62333951, default 2048): <Hit Enter key>
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-62333951, default 62333951): +9G (Size of the
    first partion)
    Created a new partition 1 of type 'Linux' and of size 9 GiB.
    Partition #1 contains a ext4 signature.
    Do you want to remove the signature? [Y]es/[N]o: n
    Command (m for help): t
    Selected partition 1
    Hex code (type L to list all codes): 83
    Changed type of partition 'Linux' to 'Linux'.
    
    Repeat the above commands for the second and third partitions by changing the partition number to 2 and 3.
  3. Format each partition to ext4
    $ mkfs.ext4 /dev/mmcblk0p1
    $ mkfs.ext4 /dev/mmcblk0p2
    $ mkfs.ext4 /dev/mmcblk0p3
    
  4. Write images to partitions of SD card
    $ mount /dev/mmcblk0p1 /mnt
    $ cp ${WORK_XEN}/yocto/build-dom0/tmp/deploy/images/generic-armv8-xt/Image /mnt
    $ cp ${WORK_XEN}/yocto/build-dom0/tmp/deploy/images/generic-armv8-xt/uInitramfs /mnt
    $ cp ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/r8a779f0-s4sk-xen.dtb /mnt
    $ cp ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/xen-uImage /mnt/
    $ cp ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/xenpolicy-s4sk /mnt
    $ cp ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/boot-emmc.uImage /mnt
    $ sync
    $ umount /mnt
    $ mount /dev/mmcblk0p2 /mnt
    $ tar jxf ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/rcar-image-minimal-s4sk.tar.bz -C /mnt
    $ sync
    $ umount /mnt
    $ mount /dev/mmcblk0p3 /mnt
    $ tar jxf ${WORK_XEN}/yocto/build-domu/tmp/deploy/images/s4sk/rcar-image-minimal-s4sk.tar.bz2 -C /mnt
    $ sync
    $ umount /mnt
    
  5. Set U-Boot environment variables
    setenv initrd_high 0xffffffffffffffff
    setenv bootargs
    setenv bootcmd 'run bootcmd_sdcard'
    setenv bootcmd_sdcard 'run sdcard_xen_load; run sdcard_dtb_load; run sdcard_kernel_load; run sdcard_xenpolicy_load; run sdcard_initramfs_load; bootm 0x48080000 0x84000000 0x48000000'
    setenv sdcard_dtb_load 'ext4load mmc 0:1 0x48000000 r8a779f0-s4sk-xen.dtb; fdt addr 0x48000000; fdt resize; fdt mknode / boot_dev; fdt set /boot_dev device mmcblk0'
    setenv sdcard_initramfs_load 'ext4load mmc 0:1 0x84000000 uInitramfs'
    setenv sdcard_kernel_load 'ext4load mmc 0:1 0x7a000000 Image'
    setenv sdcard_xen_load 'ext4load mmc 0:1 0x48080000 xen-uImage'
    setenv sdcard_xenpolicy_load 'ext4load mmc 0:1 0x7c000000 xenpolicy-s4sk'
    run bootcmd
    

Tips

Writing an image to Micro SD using the dd command
This frees you from confusing Micro SD partitioning, formatting, and other procedures.

  1. build (See R-Car/Boards/S4SK/Xen-Hypervisor#How_to_build)
    ./build.sh
    
    or
    ninja
    
  2. Generated the "full.img" file
    ninja image-full
    
    ls
    build.ninja  full.img prod-devel-rcar-s4sk.yaml  yocto
    
  3. Writing the "full.imge" to Micro SD
    dd if=full.img of=/dev/mmcblk0
    
  4. Boot
    setenv initrd_high 0xffffffffffffffff
    setenv bootargs
    setenv bootcmd 'run bootcmd_sdcard'
    setenv bootcmd_sdcard 'run sdcard_xen_load; run sdcard_dtb_load; run sdcard_kernel_load; run sdcard_xenpolicy_load; run sdcard_initramfs_load; bootm 0x48080000 0x84000000 0x48000000'
    setenv sdcard_dtb_load 'ext4load mmc 0:1 0x48000000 xen.dtb; fdt addr 0x48000000; fdt resize; fdt mknode / boot_dev; fdt set /boot_dev device mmcblk0'
    setenv sdcard_initramfs_load 'ext4load mmc 0:1 0x84000000 uInitramfs'
    setenv sdcard_kernel_load 'ext4load mmc 0:1 0x7a000000 Image'
    setenv sdcard_xen_load 'ext4load mmc 0:1 0x48080000 xen'
    setenv sdcard_xenpolicy_load 'ext4load mmc 0:1 0x7c000000 xenpolicy'
    run bootcmd
    

NFS boot

  1. Install some packages for NFS boot on Host PC (See R-Car/Boards/Yocto-Gen3/v5.9.0#Loading_kernel_via_TFTP_and_rootfs_via_NFS)
  2. Copy and decompress the some files and rootfs on Host PC
    Ex)
    $ mkdir -p /srv/tftp/s4/rootfs_xen/dom0 /srv/tftp/s4/rootfs_xen/domd /srv/tftp/s4/rootfs_xen/domu
    $ export NFS_ROOT=/srv/tftp/s4/rootfs_xen
    $ cp ${WORK_XEN}/yocto/build-dom0/tmp/deploy/images/generic-armv8-xt/Image ${NFS_ROOT}/dom0
    $ cp ${WORK_XEN}/yocto/build-dom0/tmp/deploy/images/generic-armv8-xt/uInitramfs ${NFS_ROOT}/dom0
    $ cp ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/r8a779f0-s4sk-xen.dtb ${NFS_ROOT}/dom0
    $ cp ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/xen-uImage ${NFS_ROOT}/dom0
    $ cp ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/xenpolicy-s4sk ${NFS_ROOT}/dom0
    $ tar jxf ${WORK_XEN}/yocto/build-domd/tmp/deploy/images/s4sk/rcar-image-minimal-s4sk.tar.bz -C  ${NFS_ROOT}/domd
    $ tar jxf ${WORK_XEN}/yocto/build-domu/tmp/deploy/images/s4sk/rcar-image-minimal-s4sk.tar.bz2 -C ${NFS_ROOT}/domu
    
  3. Set U-Boot environment variables and boot
    setenv bootargs
    setenv bootdelay 2
    setenv baudrate 921600
    setenv initrd_high 0xffffffffffffffff
    setenv serverip 192.168.10.111
    setenv ipaddr 192.168.10.100
    setenv tftp '/s4/rootfs_xen/dom0'
    setenv rfs '/srv/tftp/s4/rootfs_xen'
    setenv boot_dev nfs
    setenv bootcmd_tftp 'run tftp_xen_ld; run tftp_dtb_ld; run tftp_kernel_ld; run tftp_policy_ld; run tftp_ramfs_ld; bootm 0x48080000 0x84000000 0x48000000'
    setenv tftp_configure_nfs 'fdt set /boot_dev device ${boot_dev}; fdt set /boot_dev my_ip ${ipaddr}; fdt set /boot_dev nfs_server_ip ${serverip}; fdt set /boot_dev nfs_dir ${rfs}/domd; fdt set /boot_dev domu_nfs_dir ${rfs}/domu;'
    setenv tftp_dtb_ld 'tftp 0x48000000 ${tftp}/r8a779f0-s4sk-xen.dtb; fdt addr 0x48000000; fdt resize; fdt mknode / boot_dev; run tftp_configure_nfs;'
    setenv tftp_ramfs_ld 'tftp 0x84000000 ${tftp}/uInitramfs'
    setenv tftp_kernel_ld 'tftp 0x7a000000 ${tftp}/Image'
    setenv tftp_xen_ld 'tftp 0x48080000 ${tftp}/xen-uImage'
    setenv tftp_policy_ld 'tftp 0x7c000000 ${tftp}/xenpolicy-s4sk'
    setenv bootcmd 'run bootcmd_tftp'
    run bootcmd
    

Confirmed Xen Commands

Dom0

  • Get information about Xen host (xl info)
    root@generic-armv8-xt-dom0:~# xl info
    host                   : generic-armv8-xt-dom0
    release                : 5.10.41-yocto-tiny
    version                : #1 SMP PREEMPT Thu Jun 29 13:34:37 UTC 2023
    machine                : aarch64
    nr_cpus                : 8
    max_cpu_id             : 7
    nr_nodes               : 1
    cores_per_socket       : 1
    threads_per_core       : 1
    cpu_mhz                : 16.666
    hw_caps                : 00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000
    virt_caps              : hvm hvm_directio hap iommu_hap_pt_share vpmu gnttab-v1
    total_memory           : 3456
    free_memory            : 2010
    sharing_freed_memory   : 0
    sharing_used_memory    : 0
    outstanding_claims     : 0
    free_cpus              : 0
    xen_major              : 4
    xen_minor              : 17
    xen_extra              : -unstable
    xen_version            : 4.17-unstable
    xen_caps               : xen-3.0-aarch64 xen-3.0-armv7l
    xen_scheduler          : credit2
    xen_pagesize           : 4096
    platform_params        : virt_start=0x200000
    xen_changeset          : Thu Dec 8 19:01:46 2022 +0000 git:df73c24859-dirty
    xen_commandline        : dom0_mem=256M console=dtuart dtuart=/soc/serial@e6540000 dom0_max_vcpus=2 loglvl=all xsm=flask flask=permissive bootscrub=0 pci-passthrough=on
    cc_compiler            : aarch64-poky-linux-gcc (GCC) 9.3.0
    cc_compile_by          : xen-4.17.0+gitA
    cc_compile_domain      : poky
    cc_compile_date        : 2022-12-20
    build_id               : 4d39eca382b92ce5a804cd4ce4349471d05850d5
    xend_config_format     : 4
    root@generic-armv8-xt-dom0:~#
    
  • List information about all/some domains (xl list)
    root@generic-armv8-xt-dom0:~# xl list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0   256     2     r-----       9.4
    DomD                                         1  1023     4     -b----      16.0
    root@generic-armv8-xt-dom0:~#
    
  • Create a domain from config file <filename> (xl create <config file>)
    root@generic-armv8-xt-dom0:~# xl create /etc/xen/domu.cfg
    Parsing config from /etc/xen/domu.cfg
    libxl: info: libxl_create.c:121:libxl__domain_build_info_setdefault: qemu-xen is unavailable, using qemu-xen-traditional instead: No such file or directory
    (XEN) GICv3: Mapping ITS translation register to d3:addr=0x00000000f1050000 size=0x0000000000010000
    libxl: error: libxl_arm.c:1137:copy_partial_fdt: Can't copy the node "/passthrough" from the partial FDT
    (XEN) memory_map:add: dom3 gfn=e6260 mfn=e6260 nr=10
    (XEN) memory_map:add: dom3 gfn=37fc9 mfn=47fc9 nr=2
    (XEN) ipmmu: /soc/rswitch_osid1: Added master device (IPMMU /soc/iommu@eed40000 micro-TLBs 2)
    (XEN) ipmmu: /soc/iommu@eefc0000: d3: Set IPMMU context 3 (pgd 0x481956000)
    (XEN) ipmmu: /soc/rswitch_osid1: Using IPMMU context 3
    root@generic-armv8-xt-dom0:~# (XEN) d3v0: vGICD: RAZ on reserved register offset 0x00000c
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER4
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER8
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER12
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER16
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER20
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER24
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER28
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER32
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER36
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER40
    (XEN) d3v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER44
    (XEN) d3v0: vGICR: SGI: unhandled word write 0x000000ffffffff to ICACTIVER0
    (XEN) d3v1: vGICR: SGI: unhandled word write 0x000000ffffffff to ICACTIVER0
    (XEN) grant_table.c:1879:d3v0 Expanding d3 grant table from 1 to 2 frames
    (XEN) grant_table.c:1879:d3v0 Expanding d3 grant table from 2 to 3 frames
    (XEN) gnttab_mark_dirty not implemented yet
    
    root@generic-armv8-xt-dom0:~# xl list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0   256     2     r-----      11.8
    DomD                                         1  1021     4     -b----      19.2
    DomU                                         3   511     2     -b----       0.5
    root@generic-armv8-xt-dom0:~#
    
  • Terminate a domain immediately (xl destroy DomU)
    root@generic-armv8-xt-dom0:~# xl list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0   256     2     r-----      14.1
    DomD                                         1  1021     4     -b----      22.0
    DomU                                         3   511     2     -b----       0.6
    root@generic-armv8-xt-dom0:~# xl destroy DomU
    root@generic-armv8-xt-dom0:~# xl list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0   256     2     r-----      14.7
    DomD                                         1  1023     4     -b----      22.8
    root@generic-armv8-xt-dom0:~#
    
  • Attach to domain's console (xl console DomD)
    root@generic-armv8-xt-dom0:~# xl list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0   256     2     r-----      16.4
    DomD                                         1  1021     4     -b----      25.0
    DomU                                         4   511     2     -b----       0.6
    root@generic-armv8-xt-dom0:~# xl console DomD
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x412fd050]
    [    0.000000] Linux version 5.10.41-yocto-standard (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP PREEMPT Thu Jul 15 12:11:21 UTC 2021
    [    0.000000] Machine model: XENVM-4.17
    [    0.000000] Xen 4.17 support found
    (snip)
    s4sk-domd login: root
    root@s4sk-domd:~#
    
    • Back to Dom0 : ctrl + ]
      root@s4sk-domd:~# root@generic-armv8-xt-dom0:~#
      root@generic-armv8-xt-dom0:~#
      
  • List the VCPUs for all/some domains (xl vcpu-list)
    root@generic-armv8-xt-dom0:~# xl vcpu-list
    Name                                ID  VCPU   CPU State   Time(s) Affinity (Hard / Soft)
    Domain-0                             0     0    0   -b-       5.2  all / all
    Domain-0                             0     1    1   r--       4.0  all / all
    DomD                                 1     0    2   -b-       3.1  all / all
    DomD                                 1     1    3   -b-       3.2  all / all
    DomD                                 1     2    4   -b-       6.1  all / all
    DomD                                 1     3    5   -b-       2.7  all / all
    root@generic-armv8-xt-dom0:~# xl create /etc/xen/domu.cfg
    (snip)
    root@generic-armv8-xt-dom0:~# xl vcpu-list
    Name                                ID  VCPU   CPU State   Time(s) Affinity (Hard / Soft)
    Domain-0                             0     0    0   r--       5.6  all / all
    Domain-0                             0     1    1   -b-       4.5  all / all
    DomD                                 1     0    2   -b-       3.5  all / all
    DomD                                 1     1    3   -b-       3.5  all / all
    DomD                                 1     2    4   -b-       6.7  all / all
    DomD                                 1     3    5   -b-       3.0  all / all
    DomU                                 2     0    6   -b-       0.3  all / all
    DomU                                 2     1    7   -b-       0.2  all / all
    root@generic-armv8-xt-dom0:~#
    
  • Set which CPUs a VCPU can use (xl vcpu-pin <domain ID> <vCPU> <physical CPUs>)
    root@generic-armv8-xt-dom0:~# xl vcpu-list
    Name                                ID  VCPU   CPU State   Time(s) Affinity (Hard / Soft)
    Domain-0                             0     0    0   r--       5.6  all / all
    Domain-0                             0     1    1   -b-       4.5  all / all
    DomD                                 1     0    2   -b-       3.5  all / all
    DomD                                 1     1    3   -b-       3.5  all / all
    DomD                                 1     2    4   -b-       6.7  all / all
    DomD                                 1     3    5   -b-       3.0  all / all
    DomU                                 2     0    6   -b-       0.3  all / all
    DomU                                 2     1    7   -b-       0.2  all / all
    root@generic-armv8-xt-dom0:~# xl vcpu-pin 1 1 7
    root@generic-armv8-xt-dom0:~# xl vcpu-list
    Name                                ID  VCPU   CPU State   Time(s) Affinity (Hard / Soft)
    Domain-0                             0     0    0   r--       6.3  all / all
    Domain-0                             0     1    1   -b-       5.1  all / all
    DomD                                 1     0    2   -b-       3.6  all / all
    DomD                                 1     1    7   -b-       3.9  7 / all
    DomD                                 1     2    4   -b-       6.9  all / all
    DomD                                 1     3    5   -b-       3.8  all / all
    DomU                                 2     0    6   -b-       0.3  all / all
    DomU                                 2     1    7   -b-       0.3  all / all
    root@generic-armv8-xt-dom0:~#
    
  • Create multiple domains (xl create)
    root@generic-armv8-xt-dom0:~# xl vcpu-list
    Name                                ID  VCPU   CPU State   Time(s) Affinity (Hard / Soft)
    Domain-0                             0     0    0   r--       5.1  all / all
    Domain-0                             0     1    1   -b-       3.6  all / all
    DomD                                 1     0    2   -b-       3.7  all / all
    DomD                                 1     1    3   -b-       5.4  all / all
    DomD                                 1     2    4   -b-       2.7  all / all
    DomD                                 1     3    5   -b-       2.8  all / all
    root@generic-armv8-xt-dom0:~# cp /etc/xen/domu.cfg /etc/xen/domu1.cfg
    root@generic-armv8-xt-dom0:~# cp /etc/xen/domu.cfg /etc/xen/domu2.cfg
    root@generic-armv8-xt-dom0:~# cp /etc/xen/domu.cfg /etc/xen/domu3.cfg
    root@generic-armv8-xt-dom0:~# vi /etc/xen/domu1.cfg
    	Before: vif = [ 'backend=DomD, bridge=xenbr0, mac=08:00:27:ff:cb:cf' ]
    	After : vif = [ 'backend=DomD, bridge=xenbr0, mac=08:00:27:ff:cb:d1' ]
    root@generic-armv8-xt-dom0:~# vi /etc/xen/domu2.cfg
    	Before: vif = [ 'backend=DomD, bridge=xenbr0, mac=08:00:27:ff:cb:cf' ]
    	After : vif = [ 'backend=DomD, bridge=xenbr0, mac=08:00:27:ff:cb:d2' ]
    root@generic-armv8-xt-dom0:~# vi /etc/xen/domu3.cfg
    	Before: vif = [ 'backend=DomD, bridge=xenbr0, mac=08:00:27:ff:cb:cf' ]
    	After : vif = [ 'backend=DomD, bridge=xenbr0, mac=08:00:27:ff:cb:d3' ]
    root@generic-armv8-xt-dom0:~#
    root@generic-armv8-xt-dom0:~# xl create /etc/xen/domu1.cfg 'name="DomU-1" ; vcpus="1" ; cpus="all" ; memory="128" ; tee = [] ; dt_passthrough_nodes = [] ; dtdev = [] ; irqs = [] ; iomem = [] ; renesas_vmq = []'
    Parsing config from /etc/xen/domu1.cfg
    libxl: info: libxl_create.c:121:libxl__domain_build_info_setdefault: qemu-xen is unavailable, using qemu-xen-traditional instead: No such file or directory
    (XEN) GICv3: Mapping ITS translation register to d2:addr=0x00000000f1050000 size=0x0000000000010000
    root@generic-armv8-xt-dom0:~# (XEN) d2v0: vGICD: RAZ on reserved register offset 0x00000c
    (XEN) d2v0: vGICR: SGI: unhandled word write 0x000000ffffffff to ICACTIVER0
    (XEN) grant_table.c:1879:d2v0 Expanding d2 grant table from 1 to 2 frames
    (XEN) gnttab_mark_dirty not implemented yet
    
    root@generic-armv8-xt-dom0:~# xl create /etc/xen/domu2.cfg 'name="DomU-2" ; vcpus="1" ; cpus="all" ; memory="128" ; tee = [] ; dt_passthrough_nodes = [] ; dtdev = [] ; irqs = [] ; iomem = [] ; renesas_vmq = []'
    Parsing config from /etc/xen/domu2.cfg
    libxl: info: libxl_create.c:121:libxl__domain_build_info_setdefault: qemu-xen is unavailable, using qemu-xen-traditional instead: No such file or directory
    (XEN) GICv3: Mapping ITS translation register to d3:addr=0x00000000f1050000 size=0x0000000000010000
    root@generic-armv8-xt-dom0:~# (XEN) d3v0: vGICD: RAZ on reserved register offset 0x00000c
    (XEN) d3v0: vGICR: SGI: unhandled word write 0x000000ffffffff to ICACTIVER0
    (XEN) grant_table.c:1879:d3v0 Expanding d3 grant table from 1 to 2 frames
    
    root@generic-armv8-xt-dom0:~#
    root@generic-armv8-xt-dom0:~# xl create /etc/xen/domu3.cfg 'name="DomU-3" ; vcpus="1" ; cpus="all" ; memory="128" ; tee = [] ; dt_passthrough_nodes = [] ; dtdev = [] ; irqs = [] ; iomem = [] ; renesas_vmq = []'
    Parsing config from /etc/xen/domu3.cfg
    libxl: info: libxl_create.c:121:libxl__domain_build_info_setdefault: qemu-xen is unavailable, using qemu-xen-traditional instead: No such file or directory
    (XEN) GICv3: Mapping ITS translation register to d4:addr=0x00000000f1050000 size=0x0000000000010000
    root@generic-armv8-xt-dom0:~# (XEN) d4v0: vGICD: RAZ on reserved register offset 0x00000c
    (XEN) d4v0: vGICR: SGI: unhandled word write 0x000000ffffffff to ICACTIVER0
    (XEN) grant_table.c:1879:d4v0 Expanding d4 grant table from 1 to 2 frames
    
    root@generic-armv8-xt-dom0:~#
    root@generic-armv8-xt-dom0:~# xl vcpu-list
    Name                                ID  VCPU   CPU State   Time(s) Affinity (Hard / Soft)
    Domain-0                             0     0    0   -b-       7.1  all / all
    Domain-0                             0     1    1   r--       5.4  all / all
    DomD                                 1     0    2   -b-       4.8  all / all
    DomD                                 1     1    6   -b-       6.3  all / all
    DomD                                 1     2    4   -b-       4.7  all / all
    DomD                                 1     3    5   -b-       4.1  all / all
    DomU-1                               2     0    7   -b-       0.5  all / all
    DomU-2                               3     0    7   -b-       0.5  all / all
    DomU-3                               4     0    3   -b-       0.5  all / all
    root@generic-armv8-xt-dom0:~#
    

DomD / DomU

  • Attach to domain's console (xl console DomD)
    root@generic-armv8-xt-dom0:~# xl console DomD
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x412fd050]
    [    0.000000] Linux version 5.10.41-yocto-standard (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP PREEMPT Thu Jul 15 12:11:21 UTC 2021
    (snip)
    s4sk-domd login: root
    root@s4sk-domd:~#
    
    • Back to Dom0 : ctrl + ]
    • root@s4sk-domd:~# root@generic-armv8-xt-dom0:~#
      root@generic-armv8-xt-dom0:~#
      
  • Ethernet TSN (DomD)
    oot@generic-armv8-xt-dom0:~# xl console DomD
    root@s4sk-domd:~#
    root@s4sk-domd:~# ifconfig tsn0 192.168.10.10
    [ 1687.829480] rswitch_get_phy_node PHY interface = sgmii
    [ 1687.831104] libphy: rswitch_mii: probed
    [ 1687.879559] mv88x2110 etha0:01: Firmware version 8.5.0.0
    [ 1687.915572] mv88x2110 etha0:01: attached PHY driver [mv88x2110] (mii_bus:phy_addr=etha0:01, irq=POLL)
    root@s4sk-domd:~# [ 1691.032980] renesas_eth_sw e68c0000.ethernet tsn0: Link is Up - 1Gbps/Full - flow control off
    [ 1691.033147] IPv6: ADDRCONF(NETDEV_CHANGE): tsn0: link becomes ready
    
    root@s4sk-domd:~#
    root@s4sk-domd:~# ifconfig tsn0
    tsn0      Link encap:Ethernet  HWaddr 74:90:50:D0:7B:58
              inet addr:192.168.10.10  Bcast:192.168.10.255  Mask:255.255.255.0
              inet6 addr: fe80::7690:50ff:fed0:7b58/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:60 errors:0 dropped:3 overruns:0 frame:0
              TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:6835 (6.6 KiB)  TX bytes:1380 (1.3 KiB)
    
    root@s4sk-domd:~# ping 192.168.10.116
    PING 192.168.10.116 (192.168.10.116): 56 data bytes
    64 bytes from 192.168.10.116: seq=0 ttl=127 time=1.123 ms
    64 bytes from 192.168.10.116: seq=1 ttl=127 time=1.631 ms
    64 bytes from 192.168.10.116: seq=2 ttl=127 time=1.009 ms
    root@s4sk-domd:~#
    root@s4sk-domd:~# ifconfig tsn1 192.168.11.11
    root@s4sk-domd:~# ifconfig tsn1
    tsn1      Link encap:Ethernet  HWaddr E6:22:98:08:D9:C9
              inet addr:192.168.11.11  Bcast:192.168.11.255  Mask:255.255.255.0
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    root@s4sk-domd:~#
    


Known issues & Restrictions

  1. HW offload feature may cause TSN1 hang
  2. "xl console DomU" is not available


Q&A site

If you have any questions, feel free to post them here.
https://community.renesas.com/automotive/gateway/

FAQ site