mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-07-18 04:27:08 +00:00
Compare commits
67 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dc9e257f2b | |||
| 5c84950712 | |||
| 18453b87f7 | |||
| cd1672a846 | |||
| a0382c6a57 | |||
| 2a2123dac0 | |||
| 8e1b0e4a57 | |||
| 9dcbf55176 | |||
| b4f3880979 | |||
| d841a47d6e | |||
| b9d54fefa0 | |||
| a0b2c6fc71 | |||
| 34f64a0523 | |||
| 3b8ad597c9 | |||
| 6a6510b508 | |||
| 6ebec2da19 | |||
| aa5fb3d6f9 | |||
| 23d9da9cee | |||
| 8f13054eea | |||
| b3427f9001 | |||
| 5fc1de74b8 | |||
| 39bc4076b2 | |||
| b4abab2203 | |||
| a6243e60bd | |||
| 54b55deeb8 | |||
| a11e752a28 | |||
| f4129ee8a8 | |||
| c200941b15 | |||
| 2c5dea8979 | |||
| 498f88004c | |||
| 0f33099a82 | |||
| aff8d93108 | |||
| 87ceedf4d2 | |||
| e219ef606e | |||
| fc4b2f8907 | |||
| d8074cb6a0 | |||
| 48720822d6 | |||
| 7336830dab | |||
| 332410055a | |||
| 7c3a55f8ff | |||
| ac9f59ca62 | |||
| fb196bacd6 | |||
| 6e3e29857c | |||
| d235d4b53e | |||
| 5207074884 | |||
| 7185d29de9 | |||
| 932d35bab0 | |||
| d12eadacd0 | |||
| e45752aa6f | |||
| a365b3bd7e | |||
| 7b82307c0a | |||
| a72b89ccd1 | |||
| 1cd14b33c1 | |||
| 27ed22b040 | |||
| b97016fcfa | |||
| eff9e62526 | |||
| 892c9686bf | |||
| e8cc03775e | |||
| 4cae9fe87b | |||
| 784ef62cc4 | |||
| 1a0a9700f2 | |||
| ba30bf591e | |||
| 0c59d1cf42 | |||
| 289982e1cb | |||
| 44e51aa5be | |||
| b8bb75b4d3 | |||
| 0057143f4b |
+81
-27
@@ -1,37 +1,54 @@
|
||||
# Use our custom Crops-derived image
|
||||
image: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/yocto-builder:master
|
||||
# We need 2.6.3 as this is the latest container with an old enough distro
|
||||
image: ghcr.io/siemens/kas/kas:2.6.3
|
||||
|
||||
# First do a common bootstrap, and then build all the targets
|
||||
stages:
|
||||
- prep
|
||||
- bootstrap
|
||||
- build
|
||||
|
||||
# Common job fragment to get a worker ready
|
||||
.setup:
|
||||
stage: build
|
||||
interruptible: true
|
||||
variables:
|
||||
KAS_WORK_DIR: $CI_PROJECT_DIR/work
|
||||
KAS_REPO_REF_DIR: $CI_BUILDS_DIR/persist/repos
|
||||
SSTATE_DIR: $CI_BUILDS_DIR/persist/sstate
|
||||
DL_DIR: $CI_BUILDS_DIR/persist/downloads
|
||||
BB_LOGCONFIG: $CI_PROJECT_DIR/kas/logging.yml
|
||||
BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
|
||||
TOOLCHAIN_DIR: $CI_BUILDS_DIR/persist/toolchains
|
||||
IMAGE_DIR: $CI_PROJECT_DIR/work/build/tmp/deploy/images
|
||||
TOOLCHAIN_LINK_DIR: $CI_PROJECT_DIR/work/build/toolchains
|
||||
before_script:
|
||||
- echo KAS_WORK_DIR = $KAS_WORK_DIR
|
||||
- echo SSTATE_DIR = $SSTATE_DIR
|
||||
- echo DL_DIR = $DL_DIR
|
||||
- mkdir --verbose --parents $KAS_WORK_DIR $SSTATE_DIR $DL_DIR
|
||||
- rm -rf $KAS_WORK_DIR
|
||||
- mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
|
||||
# Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
|
||||
- ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
|
||||
|
||||
# Generalised fragment to do a Kas build
|
||||
.build:
|
||||
extends: .setup
|
||||
script:
|
||||
- KASFILES=$(kas/jobs-to-kas $CI_JOB_NAME)
|
||||
- kas shell --update --force-checkout $KASFILES -c 'cat conf/*.conf'
|
||||
- kas build $KASFILES
|
||||
- ./kas/check-warnings $KAS_WORK_DIR/build/warnings.log
|
||||
|
||||
- KASFILES=$(./ci/jobs-to-kas $CI_JOB_NAME)
|
||||
- kas shell --update --force-checkout $KASFILES -c 'cat conf/*.conf'
|
||||
- kas build $KASFILES
|
||||
- ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
|
||||
|
||||
#
|
||||
# First phase, bootstrap and machine coverage
|
||||
# Prep stage, update repositories once
|
||||
#
|
||||
update-repos:
|
||||
extends: .setup
|
||||
stage: prep
|
||||
script:
|
||||
- flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
|
||||
|
||||
#
|
||||
# Bootstrap stage, bootstrap and machine coverage
|
||||
#
|
||||
|
||||
# Build a number of native tools first to ensure the other builders don't race
|
||||
@@ -43,16 +60,17 @@ n1sdp/bootstrap:
|
||||
# What percentage of machines in the layer do we build
|
||||
machine-coverage:
|
||||
stage: bootstrap
|
||||
interruptible: true
|
||||
script:
|
||||
- ./kas/check-machine-coverage
|
||||
- ./ci/check-machine-coverage
|
||||
coverage: '/Coverage: \d+/'
|
||||
|
||||
|
||||
#
|
||||
# Second phase, the actual build jobs
|
||||
# Build stage, the actual build jobs
|
||||
#
|
||||
|
||||
corstone500:
|
||||
a5ds:
|
||||
extends: .build
|
||||
|
||||
corstone700-fvp:
|
||||
@@ -61,13 +79,16 @@ corstone700-fvp:
|
||||
corstone700-mps3:
|
||||
extends: .build
|
||||
|
||||
foundation-armv8:
|
||||
extends: .build
|
||||
|
||||
fvp-base:
|
||||
extends: .build
|
||||
|
||||
fvp-base-arm32:
|
||||
extends: .build
|
||||
|
||||
fvp-base-arm32/external-gcc-arm32:
|
||||
fvp-base-arm32/external-gccarm:
|
||||
extends: .build
|
||||
|
||||
gem5-arm64:
|
||||
@@ -88,19 +109,29 @@ musca-s1:
|
||||
n1sdp:
|
||||
extends: .build
|
||||
|
||||
# This job currently fails when building gcc-runtime:
|
||||
# cc1: error: switch '-mcpu=armv8.2-a' conflicts with '-march=armv8-a' switch [-Werror]
|
||||
# Mark as manual so it doesn't get executed automatically
|
||||
n1sdp/armgcc:
|
||||
extends: .build
|
||||
when: manual
|
||||
|
||||
qemuarm64-secureboot:
|
||||
qemuarm/testimage:
|
||||
extends: .build
|
||||
|
||||
qemuarm64-secureboot/clang:
|
||||
qemuarm64-secureboot/testimage:
|
||||
extends: .build
|
||||
|
||||
qemuarm64-secureboot/clang/musl:
|
||||
qemuarm64-secureboot/clang/testimage:
|
||||
extends: .build
|
||||
|
||||
qemuarm64-secureboot/musl:
|
||||
qemuarm64-secureboot/clang/musl/testimage:
|
||||
extends: .build
|
||||
|
||||
qemuarm64-secureboot/musl/testimage:
|
||||
extends: .build
|
||||
|
||||
qemuarmv5/testimage:
|
||||
extends: .build
|
||||
|
||||
sgi575:
|
||||
@@ -114,26 +145,49 @@ tc0:
|
||||
# Utility tasks, not executed automatically
|
||||
#
|
||||
|
||||
# Report on disk usage
|
||||
usage:
|
||||
delete-dl-dir:
|
||||
extends: .setup
|
||||
stage: bootstrap
|
||||
stage: prep
|
||||
when: manual
|
||||
script:
|
||||
- du -h -s $DL_DIR $SSTATE_DIR
|
||||
- rm -rf $DL_DIR/*
|
||||
|
||||
# Wipe out old sstate
|
||||
prune-sstate:
|
||||
delete-repo-dir:
|
||||
extends: .setup
|
||||
stage: bootstrap
|
||||
stage: prep
|
||||
when: manual
|
||||
script:
|
||||
- find $SSTATE_DIR -type f -atime +30 -delete
|
||||
- rm -rf $KAS_REPO_REF_DIR/*
|
||||
|
||||
# Delete all sstate
|
||||
delete-sstate:
|
||||
extends: .setup
|
||||
stage: bootstrap
|
||||
stage: prep
|
||||
when: manual
|
||||
script:
|
||||
- rm -rf $SSTATE_DIR/*
|
||||
|
||||
delete-toolchains:
|
||||
extends: .setup
|
||||
stage: prep
|
||||
when: manual
|
||||
script:
|
||||
- rm -rf $TOOLCHAIN_DIR/*
|
||||
|
||||
# Wipe out old sstate
|
||||
prune-sstate:
|
||||
extends: .setup
|
||||
stage: prep
|
||||
when: manual
|
||||
script:
|
||||
- du -h -s $SSTATE_DIR
|
||||
- find $SSTATE_DIR -type f -atime +30 -delete
|
||||
- du -h -s $SSTATE_DIR
|
||||
|
||||
# Report on disk usage
|
||||
usage:
|
||||
extends: .setup
|
||||
stage: prep
|
||||
when: manual
|
||||
script:
|
||||
- du -h -s $DL_DIR $SSTATE_DIR $KAS_REPO_REF_DIR $TOOLCHAIN_DIR
|
||||
|
||||
@@ -3,4 +3,4 @@ header:
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: corstone500
|
||||
machine: a5ds
|
||||
@@ -2,5 +2,5 @@ header:
|
||||
version: 9
|
||||
|
||||
local_conf_header:
|
||||
cc: |
|
||||
GCCVERSION = "arm-10.2"
|
||||
libc: |
|
||||
GCCVERSION = "arm-9.2"
|
||||
@@ -5,7 +5,7 @@ distro: poky
|
||||
|
||||
defaults:
|
||||
repos:
|
||||
refspec: master
|
||||
refspec: gatesgarth
|
||||
|
||||
repos:
|
||||
meta-arm:
|
||||
@@ -22,6 +22,7 @@ repos:
|
||||
|
||||
env:
|
||||
BB_LOGCONFIG: ""
|
||||
TOOLCHAIN_DIR: ""
|
||||
|
||||
local_conf_header:
|
||||
base: |
|
||||
@@ -29,11 +30,11 @@ local_conf_header:
|
||||
PACKAGE_CLASSES = "package_ipk"
|
||||
LICENSE_FLAGS_WHITELIST += "armcompiler"
|
||||
PACKAGECONFIG_remove_pn-qemu-system-native = "gtk+ sdl"
|
||||
EXTRA_IMAGE_FEATURES_append = " debug-tweaks"
|
||||
BB_NUMBER_THREADS = "16"
|
||||
PARALLEL_MAKE = "-j16"
|
||||
INHERIT += "rm_work"
|
||||
PACKAGECONFIG_append_pn-perf = " coresight"
|
||||
ERROR_QA = "${WARN_QA}"
|
||||
ptest: |
|
||||
DISTRO_FEATURES_remove = "ptest"
|
||||
|
||||
@@ -13,11 +13,11 @@ if metaarm.name != "meta-arm":
|
||||
machines = metaarm.glob("meta-*/conf/machine/*.conf")
|
||||
machines = set(p.stem for p in machines)
|
||||
|
||||
# All kas files
|
||||
kas = metaarm.glob("kas/*.yml")
|
||||
kas = set(p.stem for p in kas)
|
||||
# All ci files
|
||||
ci = metaarm.glob("ci/*.yml")
|
||||
ci = set(p.stem for p in ci)
|
||||
|
||||
missing = machines - kas
|
||||
missing = machines - ci
|
||||
print(f"The following machines are missing: {', '.join(sorted(missing))}.")
|
||||
|
||||
covered = len(machines) - len(missing)
|
||||
@@ -7,7 +7,8 @@ set -e -u
|
||||
|
||||
LOGFILE=$1
|
||||
|
||||
if test -s $LOGFILE; then
|
||||
LINES=$(grep --invert-match "attempting MIRRORS if available" $LOGFILE | wc -l)
|
||||
if test "$LINES" -ne 0; then
|
||||
echo ==============================
|
||||
echo The build had warnings/errors:
|
||||
echo ==============================
|
||||
@@ -4,6 +4,7 @@ header:
|
||||
repos:
|
||||
meta-clang:
|
||||
url: https://github.com/kraj/meta-clang
|
||||
refspec: gatesgarth
|
||||
|
||||
local_conf_header:
|
||||
clang: |
|
||||
@@ -5,4 +5,4 @@ local_conf_header:
|
||||
cc: |
|
||||
PNBLACKLIST[gcc-cross-arm] = "Using external toolchain"
|
||||
TCMODE = "external-arm"
|
||||
EXTERNAL_TOOLCHAIN = "/usr/local/gcc-arm-10.2-2020.11-aarch64-arm-none-linux-gnueabihf"
|
||||
EXTERNAL_TOOLCHAIN = "${TOPDIR}/toolchains/${TARGET_ARCH}"
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: foundation-armv8
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
set -u
|
||||
|
||||
HOST_ARCH=$(uname -m)
|
||||
VER="10.2-2020.11"
|
||||
|
||||
DOWNLOAD_DIR=$1
|
||||
TOOLCHAIN_DIR=$2
|
||||
TOOLCHAIN_LINK_DIR=$3
|
||||
|
||||
# These should be already created by .gitlab-ci.yml, but do here if run outside of that env
|
||||
mkdir -p $DOWNLOAD_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
|
||||
|
||||
if [ $HOST_ARCH = "aarch64" ]; then
|
||||
#AArch64 Linux hosted cross compilers
|
||||
|
||||
#AArch32 target with hard float (arm-none-linux-gnueabihf)
|
||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-arm-none-linux-gnueabihf.tar.xz
|
||||
elif [ $HOST_ARCH = "x86_64" ]; then
|
||||
#x86_64 Linux hosted cross compilers
|
||||
|
||||
#AArch32 target with hard float (arm-linux-none-gnueabihf)
|
||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-arm-none-linux-gnueabihf.tar.xz
|
||||
|
||||
#AArch64 GNU/Linux target (aarch64-none-linux-gnu)
|
||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-aarch64-none-linux-gnu.tar.xz
|
||||
|
||||
#AArch64 GNU/Linux target (aarch64_be-none-linux-gnu)
|
||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-aarch64_be-none-linux-gnu.tar.xz
|
||||
else
|
||||
echo "ERROR - Unknown build arch of $HOST_ARCH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for i in arm aarch64 aarch64_be; do
|
||||
if [ ! -d $TOOLCHAIN_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*/ ]; then
|
||||
if [ ! -f $DOWNLOAD_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
tar -C $TOOLCHAIN_DIR -axvf $DOWNLOAD_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz
|
||||
fi
|
||||
|
||||
# Setup a link for the toolchain to use local to the building machine (e.g., not in a shared location)
|
||||
ln -s $TOOLCHAIN_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu* $TOOLCHAIN_LINK_DIR/$i
|
||||
done
|
||||
@@ -8,8 +8,8 @@ set -e -u
|
||||
# Read Job namne from $1 and split on /
|
||||
IFS=/ read -r -a PARTS<<<$1
|
||||
|
||||
# Prefix each part with kas/
|
||||
PARTS=("${PARTS[@]/#/kas/}")
|
||||
# Prefix each part with ci/
|
||||
PARTS=("${PARTS[@]/#/ci/}")
|
||||
|
||||
# Suffix each part with .yml
|
||||
PARTS=("${PARTS[@]/%/.yml}")
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: qemuarm
|
||||
@@ -5,6 +5,11 @@ header:
|
||||
|
||||
machine: qemuarm64-secureboot
|
||||
|
||||
local_conf_header:
|
||||
bugs: |
|
||||
# Only ping until errors can be resolved
|
||||
TEST_SUITES = "ping"
|
||||
|
||||
target:
|
||||
- core-image-base
|
||||
- perf
|
||||
@@ -0,0 +1,11 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: qemuarmv5
|
||||
|
||||
local_conf_header:
|
||||
bugs: |
|
||||
# Remove parselogs until errors can be resolved
|
||||
TEST_SUITES_remove = "parselogs"
|
||||
@@ -0,0 +1,17 @@
|
||||
header:
|
||||
version: 9
|
||||
|
||||
local_conf_header:
|
||||
testimage: |
|
||||
IMAGE_CLASSES += "testimage"
|
||||
TESTIMAGE_AUTO = "1"
|
||||
slirp: |
|
||||
TEST_RUNQEMUPARAMS = "slirp"
|
||||
TEST_SERVER_IP = "127.0.0.1"
|
||||
QEMU_USE_SLIRP = "1"
|
||||
packages: |
|
||||
IMAGE_FEATURES_append = " ssh-server-dropbear"
|
||||
|
||||
# Multiple targets are available, put it down to just one
|
||||
target:
|
||||
- core-image-base
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
# Update clones of the repositories we need in KAS_REPO_REF_DIR to speed up fetches
|
||||
|
||||
import sys
|
||||
import os
|
||||
import subprocess
|
||||
import pathlib
|
||||
|
||||
def repo_shortname(url):
|
||||
# Taken from Kas (Repo.__getattr__) to ensure the logic is right
|
||||
from urllib.parse import urlparse
|
||||
url = urlparse(url)
|
||||
return ('{url.netloc}{url.path}'
|
||||
.format(url=url)
|
||||
.replace('@', '.')
|
||||
.replace(':', '.')
|
||||
.replace('/', '.')
|
||||
.replace('*', '.'))
|
||||
|
||||
repositories = (
|
||||
"https://git.yoctoproject.org/git/poky",
|
||||
"https://git.openembedded.org/meta-openembedded",
|
||||
"https://git.yoctoproject.org/git/meta-virtualization",
|
||||
"https://git.yoctoproject.org/git/meta-zephyr",
|
||||
"https://github.com/kraj/meta-clang",
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
if "KAS_REPO_REF_DIR" not in os.environ:
|
||||
print("KAS_REPO_REF_DIR needs to be set")
|
||||
sys.exit(1)
|
||||
|
||||
base_repodir = pathlib.Path(os.environ["KAS_REPO_REF_DIR"])
|
||||
|
||||
for repo in repositories:
|
||||
repodir = base_repodir / repo_shortname(repo)
|
||||
if repodir.exists():
|
||||
subprocess.run(["git", "-C", repodir, "fetch"], check=True)
|
||||
else:
|
||||
subprocess.run(["git", "clone", "--bare", repo, repodir], check=True)
|
||||
@@ -1,26 +0,0 @@
|
||||
# This class is to be inherited by image recipes that want to build and install
|
||||
# an alternate kernel (set via PREFERRED_PROVIDER_alternate/kernel).
|
||||
#
|
||||
# It is mandatory to also set the KERNEL_PACKAGE_NAME for the alternate kernel
|
||||
# recipe via KERNEL_PACKAGE_NAME_pn-${PREFERRED_PROVIDER_alternate/kernel} and
|
||||
# its value needs to be different from "kernel" since this is the default set
|
||||
# for PREFERRED_PROVIDER_virtual/kernel.
|
||||
#
|
||||
# An example of these settings can be found at meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc
|
||||
#
|
||||
# When building and installing an alternate kernel, the kernel-modules packages
|
||||
# for both virtual/kernel and alternate/kernel will be installed.
|
||||
|
||||
PREFERRED_PROVIDER_alternate/kernel ??= ""
|
||||
|
||||
python () {
|
||||
alternate_kernel = d.getVar('PREFERRED_PROVIDER_alternate/kernel')
|
||||
if alternate_kernel:
|
||||
alternate_kernel_pkg_name = d.getVar('KERNEL_PACKAGE_NAME_pn-%s' % alternate_kernel)
|
||||
if alternate_kernel_pkg_name:
|
||||
d.appendVar('EXTRA_IMAGEDEPENDS', ' ' + alternate_kernel)
|
||||
d.appendVar('IMAGE_INSTALL', ' kernel-modules')
|
||||
d.appendVar('IMAGE_INSTALL', ' ' + alternate_kernel_pkg_name + '-modules')
|
||||
else:
|
||||
raise bb.parse.SkipRecipe("No KERNEL_PACKAGE_NAME_pn-%s set" % alternate_kernel )
|
||||
}
|
||||
@@ -43,17 +43,14 @@ XENGUEST_IMAGE_KERNEL ??= "Image"
|
||||
# be included in the xenguest image)
|
||||
XENGUEST_IMAGE_DISK_SIZE ??= "${@ '4' if not d.getVar('INITRAMFS_IMAGE') else '0'}"
|
||||
|
||||
# set empty partition to be used by xenguest-manager for this image
|
||||
XENGUEST_IMAGE_DISK_DEVICE ??= ""
|
||||
|
||||
#
|
||||
# XENGUEST_IMAGE_DISK_PARTITIONS is used to describe the partitions to setup
|
||||
# XENGUEST_IMAGE_DISK PARTITIONS is used to describe the partitions to setup
|
||||
# and their content.
|
||||
# It must be set to a space separated list of entries with each entry having
|
||||
# the format num:sz:[fs]:[file] where:
|
||||
# the format num:sz:fs:[file] where:
|
||||
# - num is a partition number
|
||||
# - sz is the partition size in MB or GB(default), e.g 1000M or 1[G]
|
||||
# - fs is optional filesystem to use for the partition
|
||||
# - sz is the partition size in Gigabit
|
||||
# - fs is the filesystem to use for the partition
|
||||
# - file is optionally pointing to a file to use as content of the partition
|
||||
# Please check image_types_xenguest.bbclass for rootfs handling of files
|
||||
#
|
||||
@@ -132,27 +129,21 @@ xenguest_image_create() {
|
||||
|
||||
# create disk if needed
|
||||
disksize="${XENGUEST_IMAGE_DISK_SIZE}"
|
||||
case ${disksize:=0} in
|
||||
0|0M|0G)
|
||||
;;
|
||||
*)
|
||||
# setup disk size
|
||||
call_xenguest_mkimage update --disk-reset-config --disk-size=$disksize
|
||||
|
||||
diskparts="${XENGUEST_IMAGE_DISK_PARTITIONS}"
|
||||
if [ -n "$diskparts" ]; then
|
||||
for arg in $diskparts; do
|
||||
call_xenguest_mkimage update --disk-add-part=$arg
|
||||
done
|
||||
fi
|
||||
diskdevice="${XENGUEST_IMAGE_DISK_DEVICE}"
|
||||
if [ -n "$diskdevice" ]; then
|
||||
call_xenguest_mkimage update --disk-device="${diskdevice}"
|
||||
fi
|
||||
|
||||
;;
|
||||
esac
|
||||
if [ -z "$disksize" ]; then
|
||||
disksize="0"
|
||||
fi
|
||||
if [ $disksize -gt 0 ]; then
|
||||
# setup disk size
|
||||
call_xenguest_mkimage update --disk-reset-config --disk-size=$disksize
|
||||
|
||||
diskparts="${XENGUEST_IMAGE_DISK_PARTITIONS}"
|
||||
if [ -n "$diskparts" ]; then
|
||||
for arg in $diskparts; do
|
||||
call_xenguest_mkimage update --disk-add-part=$arg
|
||||
partnum="$(expr $partnum + 1)"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${XENGUEST_IMAGE_AUTOBOOT}" = "1" ]; then
|
||||
call_xenguest_mkimage update --set-param=GUEST_AUTOBOOT=1
|
||||
|
||||
@@ -9,11 +9,12 @@ BBFILES += " \
|
||||
|
||||
BBFILE_COLLECTIONS += "meta-arm-autonomy"
|
||||
BBFILE_PATTERN_meta-arm-autonomy = "^${LAYERDIR}/"
|
||||
BBFILE_PRIORITY_meta-arm-autonomy = "5"
|
||||
BBFILE_PRIORITY_meta-arm-autonomy = "6"
|
||||
LAYERDEPENDS_meta-arm-autonomy = " \
|
||||
core \
|
||||
yocto \
|
||||
openembedded-layer \
|
||||
networking-layer \
|
||||
virtualization-layer \
|
||||
"
|
||||
LAYERSERIES_COMPAT_meta-arm-autonomy = "gatesgarth"
|
||||
|
||||
@@ -11,7 +11,7 @@ KERNEL_IMAGETYPE = "Image"
|
||||
IMAGE_FSTYPES += "tar.bz2"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.10%"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
||||
|
||||
DISTRO_FEATURES += "arm-autonomy-guest"
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ First you must download the Yocto layers needed:
|
||||
- all other layers you might want to use
|
||||
|
||||
For each of the downloaded layer make sure you checkout the release of Yocto
|
||||
you want to use (for example gatesgarth using `git checkout gatesgarth`).
|
||||
you want to use (for example zeus using `git checkout zeus`).
|
||||
|
||||
Please follow [Yocto documentation](https://www.yoctoproject.org/docs/latest/brief-yoctoprojectqs/brief-yoctoprojectqs.html)
|
||||
in order to have the required dependencies.
|
||||
@@ -119,6 +119,10 @@ To boot the system using an u-boot base board you will need to:
|
||||
|
||||
In this example the addresses might need to be adapted depending on your board.
|
||||
|
||||
For arm-autonomy host on FVP-Base u-boot has been modified such that
|
||||
`booti 0x84000000 - 0x83000000` is the default boot command. If FVP-Base is your
|
||||
MACHINE target there should be no need to interfere with u-boot.
|
||||
|
||||
Guest project
|
||||
-------------
|
||||
The guest projects are not target specific and will use a Yocto MACHINE defined
|
||||
|
||||
@@ -11,17 +11,12 @@ perform a couple of customizations in the generated wic image:
|
||||
1 MiB per physical volume, hence it needs to be taken into account when
|
||||
setting GUEST_PART_SIZE.
|
||||
|
||||
2. Set the boot partition size (default: 100M) via `BOOT_PART_SIZE` and
|
||||
`BOOT_PART_SIZE_UNIT` (M or G) variables in any conf file. The default
|
||||
bootimg is ~44M so 100M leaves just over 50M of free space.
|
||||
|
||||
3. The wic image partition layout and contents with a custom wks file via
|
||||
2. The wic image partition layout and contents with a custom wks file via
|
||||
`ARM_AUTONOMY_WKS_FILE` variable (default:
|
||||
arm-autonomy-n1sdp-efidisk.wks.in which is affected by GUEST_PART_SIZE,
|
||||
GUEST_PART_SIZE_UNIT, BOOT_PART_SIZE, BOOT_PART_SIZE_UNIT and
|
||||
GRUB_CFG_FILE variables).
|
||||
GUEST_PART_SIZE_UNIT and GRUB_CFG_FILE variables).
|
||||
|
||||
4. Custom grub.cfg file via `GRUB_CFG_FILE` (default:
|
||||
3. Custom grub.cfg file via `GRUB_CFG_FILE` (default:
|
||||
arm-autonomy-n1sdp-grub.cfg) variable to be set in any conf file. The full
|
||||
path or relative to `ARM_AUTONOMY_WKS_FILE` should be set.
|
||||
|
||||
|
||||
@@ -70,10 +70,7 @@ The following parameters are available:
|
||||
This variable is only used if XEN_DEVICETREE_XEN_BOOTARGS has a value
|
||||
containing "dom0_mem=${XEN_DEVICETREE_DOM0_MEM}" as the memory assigned to
|
||||
dom0 is defined using Xen boot arguments.
|
||||
This variable is set by default to "1024M,max:1024", and cannot be empty.
|
||||
The value can simply specify a size, e.g. "1024M", but best practice is to
|
||||
also provide a max, documented here:
|
||||
https://wiki.xenproject.org/wiki/Xen_Project_Best_Practices
|
||||
This variable is set by default to "1024M".
|
||||
|
||||
- XEN_DEVICETREE_DOM0_BOOTARGS: Boot arguments to pass to Dom0 Linux when
|
||||
booting it.
|
||||
@@ -87,8 +84,7 @@ The following parameters are available:
|
||||
- XEN_DEVICETREE_DOM0_ADDR: This is the address from which the Linux kernel to
|
||||
be used for Dom0 will be copied. When using u-boot, this is the address at
|
||||
which you will load the kernel Image before starting Xen.
|
||||
This variable is set by default to "0x80080000", and cannot be empty.
|
||||
Values for this variable can be in hex (prefixed with '0x') or in decimal.
|
||||
This variable is set by default to "0x80080000".
|
||||
|
||||
- XEN_DEVICETREE_DOM0_SIZE: This is the size of the kernel loaded at
|
||||
${XEN_DEVICETREE_DOM0_ADDR}. Xen will copy this amount of data inside the
|
||||
@@ -96,8 +92,7 @@ The following parameters are available:
|
||||
size but can be bigger. You must be careful not to have a value too big as it
|
||||
could slow down boot or copy other parts with it (like the DTB).
|
||||
You might need to increase this if you use a kernel with a bundled initramfs.
|
||||
This variable is set by default to "0x01000000" and cannot be empty.
|
||||
Values for this variable can be in hex (prefixed with '0x') or in decimal.
|
||||
This variable is set by default to "0x01000000".
|
||||
|
||||
- XEN_DEVICETREE_DTSI_MERGE: This variable contains the list of dtsi files that
|
||||
must be included inside the generated DTB file. By default the only one
|
||||
|
||||
@@ -23,7 +23,7 @@ Usage
|
||||
-----
|
||||
|
||||
xenguest-manager must be called like this:
|
||||
`xenguest-manager [-v(v)] OPERATION [OPTIONS]`
|
||||
`xenguest-manager OPERATION [OPTIONS]`
|
||||
The following operations are available:
|
||||
- create XENGUEST_IMAGE [GUESTNAME]: create a guest from a xenguest image file
|
||||
as guest GUESTNAME. If GUESTNAME is not given the image file name is used
|
||||
@@ -37,9 +37,6 @@ The following operations are available:
|
||||
- status [GUESTNAME]: print the current status of GUESTNAME. If GUESTNAME is
|
||||
not given, print the status of all guests.
|
||||
|
||||
Passing -v or -vv will increase the logging written to the logfile.
|
||||
The terminal will always show only error messages, regardless of the logfile.
|
||||
|
||||
For a detailed help on available options please use:
|
||||
`xenguest-manager --help`
|
||||
|
||||
@@ -68,13 +65,6 @@ The following parameters are available:
|
||||
name).
|
||||
This is set by default to "/usr/share/guests".
|
||||
|
||||
- XENGUEST_MANAGER_LOG_LEVEL: Set the default log level for xenguest manager. Must
|
||||
be one of ERROR, INFO, VERBOSE (default: ERROR). The extra will be
|
||||
written to /var/log/xenguest.
|
||||
|
||||
If a verbosity argument (-v or -vv) is passed to xenguest-manager directly, it
|
||||
will override the setting in xenguest-manager.conf
|
||||
|
||||
Init scripts
|
||||
------------
|
||||
|
||||
@@ -90,7 +80,7 @@ directory on the target:
|
||||
|
||||
Inside the directory, scripts will be executed in alphabetical order.
|
||||
|
||||
Since these scripts are sourced by xenguest-manager, they can acccess functions
|
||||
Since these scripts are sourced by xenguest-manager they can acccess functions
|
||||
and variables from the parent file's scope, including:
|
||||
|
||||
- ${guestname} : The name of the guest being created
|
||||
@@ -99,31 +89,12 @@ and variables from the parent file's scope, including:
|
||||
|
||||
- ${guestcfgfile} : The name of the config file for the starting guest
|
||||
|
||||
- log() : Used to write a log to the logfile, default level INFO.
|
||||
Takes an optional log level and a message body
|
||||
e.g. log ERROR "blah"
|
||||
|
||||
Options for log level: ERROR, INFO, VERBOSE, and FATAL, which
|
||||
will call exit 1 immediately after logging the message
|
||||
|
||||
- log_command() : Used to call a shell command and log that it has been
|
||||
called, as well as capturing both stdout and stderr.
|
||||
|
||||
By default the command output is dumped to the logfile as an error
|
||||
if the command returns a status > 0, or as a verbose message if the
|
||||
whole script is running in verbose mode. An optional log level can
|
||||
be passed to alter the level the log should be if the command returns
|
||||
a status >0,
|
||||
e.g. log_command INFO "ls -lh ~"
|
||||
|
||||
Options for log level: ERROR, INFO, and VERBOSE
|
||||
|
||||
Attempting to call any other functions from xenguest_manager in an init script may
|
||||
result in a fatal error, from which cleanup is not guarenteed.
|
||||
|
||||
- ${LOGFILE} : The file to append any logging to, e.g.
|
||||
echo "Hello, World" >> ${LOGFILE}
|
||||
|
||||
Sourcing also allows the script to access params.cfg.
|
||||
|
||||
|
||||
An example of how to create the directory and install an init shell script can
|
||||
be found in:
|
||||
recipes-extended/xenguest/xenguest-network.bb
|
||||
|
||||
@@ -58,19 +58,12 @@ order.
|
||||
### disk.cfg and disk-files
|
||||
disk.cfg contains the guest disk description (disk size and disk partitions).
|
||||
The file contains the following entries:
|
||||
- `DISK_SIZE=X`: size of the disk to create in MB or GB(default),
|
||||
e.g. 1000M or 4[G]
|
||||
- `DISK_SIZE=X`: size of the disk to create in GB
|
||||
- `DISK_PARTX=SIZE:FS:CONTENT`: create a partition number X (1 to 4) with a
|
||||
size of SIZE MB or GB(default), e.g 1000M or 2[G].
|
||||
Format it with filesystem FS (can be ext2, ext3, ext4, vfat or swap)
|
||||
and extract CONTENT as initial partition content (.tar[.gz|.xz|.bz2] file
|
||||
or img[.gz|.bz2] file to be dumped in the partition).
|
||||
FS and CONTENT can be empty.
|
||||
- `DISK_DEVICE=X`: disk or partition to be used by lvm. Setting this option
|
||||
allows to bind guest disk with any partition or disk available on host,
|
||||
e.g. /dev/sda3 or /dev/sdb.
|
||||
This variable is not set by default, but if set, it overrides disk settings
|
||||
inside xenguest-manager.conf - 'XENGUEST_VOLUME_DEVICE'.
|
||||
size of SIZE GB, format it with filesystem FS (can be ext2, ext3, ext4, vfat
|
||||
or swap) and extract CONTENT as initial partition content
|
||||
(.tar[.gz|.xz|.bz2] file or img[.gz|.bz2] file to be dumped in the partition). FS and
|
||||
CONTENT can be empty.
|
||||
|
||||
The disk-files contain files to be used for initializing the disk partitions
|
||||
content. Those should be used to create a LVM or a physical disk and initialize
|
||||
@@ -112,12 +105,12 @@ For a detailed help on available operations, please use:
|
||||
image file. Several script can be added and the basename of FILE is used to
|
||||
distinguish them (calling the option twice with the same file will update the
|
||||
script in the image with the second one).
|
||||
--disk-size=SIZE: set the guest disk size to SIZE in MB or GB(default),
|
||||
e.g 1000M or 2[G]. Calling this with 0 disable the guest disk.
|
||||
--disk-size=SIZE: set the guest disk size to SIZE in GB. Calling this with 0
|
||||
disable the guest disk.
|
||||
- --disk-add-part=NUM:SIZE:FS:CONTENT: This is adding a partition to the
|
||||
xenguest image disk. The partition is described with the arguments:
|
||||
- NUM: partition number.
|
||||
- SIZE: partition size in MB or GB(default), e.g 1000M or 2[G].
|
||||
- SIZE: partition size in GB.
|
||||
- FS: filesystem to format the partition with. This can be ext2, ext3, ext4,
|
||||
vfat of swap. If empty the partition is not formated.
|
||||
- CONTENT: tar of img file to use to initialize the partition. The file must
|
||||
|
||||
+1
-51
@@ -14,19 +14,8 @@ WKS_FILE = "${ARM_AUTONOMY_WKS_FILE}"
|
||||
GUEST_PART_SIZE ?= "4097"
|
||||
GUEST_PART_SIZE_UNIT ?= "M"
|
||||
|
||||
# Set default boot partition size and unit
|
||||
BOOT_PART_SIZE ?= "100"
|
||||
BOOT_PART_SIZE_UNIT ?= "M"
|
||||
|
||||
# The GRUB_CFG_FILE affects arm-autonomy-n1sdp-efidisk.wks.in file
|
||||
#
|
||||
# When alternate-kernel DISTRO_FEATURE is present we set the
|
||||
# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has
|
||||
# additional entries for booting with the PREEMPT_RT kernel.
|
||||
GRUB_CFG_FILE ?= "${@bb.utils.contains('DISTRO_FEATURES','alternate-kernel', \
|
||||
'${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-rt-grub.cfg', \
|
||||
'${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg' \
|
||||
, d)}"
|
||||
GRUB_CFG_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg"
|
||||
|
||||
# From arm-autonomy-n1sdp-efidisk.wks.in, the /boot partition is /dev/sda1, and
|
||||
# the "/" partition is /dev/sda2.
|
||||
@@ -49,42 +38,3 @@ do_image_wic[depends] += "xen:do_deploy"
|
||||
IMAGE_EFI_BOOT_FILES += "xen-n1sdp.efi;xen.efi"
|
||||
IMAGE_EFI_BOOT_FILES += "${XEN_MOD_DEVICETREE_DTBS}"
|
||||
|
||||
# Use 5.4 kernel until later versions have been validated for autonomy-host
|
||||
PREFERRED_PROVIDER_virtual/kernel = "linux-linaro-arm"
|
||||
PREFERRED_VERSION_linux-linaro-arm = "5.4%"
|
||||
|
||||
# When alternate-kernel DISTRO_FEATURE is present we set the linux-linaro-arm-rt
|
||||
# by default
|
||||
PREFERRED_PROVIDER_alternate/kernel ?= "\
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', \
|
||||
'linux-linaro-arm-rt', '', d)}"
|
||||
|
||||
KERNEL_PACKAGE_NAME_alternate/kernel ?= "kernel-rt"
|
||||
# When alternate-kernel DISTRO_FEATURE is present we set the kernel-rt by
|
||||
# default
|
||||
KERNEL_PACKAGE_NAME_pn-linux-linaro-arm-rt = "\
|
||||
${@ d.getVar('KERNEL_PACKAGE_NAME_alternate/kernel') \
|
||||
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) \
|
||||
else 'kernel' }"
|
||||
|
||||
# Relative path from DEPLOY_DIR_IMAGE of the Kernel PREEMPT_RT deployed Image
|
||||
KERNEL_RT_IMAGE ?= "kernel-rt/Image-n1sdp.bin;Image-preempt-rt"
|
||||
# Only include the Kernel PREEMPT_RT Image if we are building with
|
||||
# alternate-kernel DISTRO_FEATURE
|
||||
IMAGE_EFI_BOOT_FILES += "\
|
||||
${@ d.getVar('KERNEL_RT_IMAGE',d) or '' \
|
||||
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \
|
||||
d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}"
|
||||
|
||||
|
||||
EFIDIR ?= "/EFI/BOOT"
|
||||
GRUB_CFG_EXTRA_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg;.${EFIDIR}}"
|
||||
|
||||
# When alternate-kernel DISTRO_FEATURE is present we set the
|
||||
# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has
|
||||
# additional entries for booting with the PREEMPT_RT kernel and also includes
|
||||
# the main GRUB config file set by GRUB_CFG_EXTRA_FILE.
|
||||
IMAGE_EFI_BOOT_FILES += "\
|
||||
${@ d.getVar('GRUB_CFG_EXTRA_FILE',d) or '' \
|
||||
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \
|
||||
d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}"
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
# Yocto kernel-cache sets CONFIG_NLS_CODEPAGE_437=m for LINUX_KERNEL_TYPR=preempt-rt
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
# Yocto kernel-cache sets CONFIG_NLS_ISO8859_1=m for LINUX_KERNEL_TYPR=preempt-rt
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
|
||||
# Set the timer interrupt run at 1000 Hz to have a fast response
|
||||
CONFIG_HZ_1000=y
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
define KFEATURE_DESCRIPTION "Extra kernel configs when building with PREEMPT_RT"
|
||||
|
||||
kconf non-hardware preempt-rt-extras.cfg
|
||||
-80
@@ -1,80 +0,0 @@
|
||||
From c2971c8a3f076ea8a522ce4fbb367d112d86c13a Mon Sep 17 00:00:00 2001
|
||||
From: Stefano Stabellini <sstabellini@kernel.org>
|
||||
Date: Mon, 27 Apr 2020 16:15:26 -0700
|
||||
Subject: [PATCH] xen: use handle_fasteoi_irq to handle xen dynamic events
|
||||
|
||||
When handling Xen events, we need to make sure the following sequence is
|
||||
followed:
|
||||
|
||||
- mask event
|
||||
- handle event and clear event (the order does not matter)
|
||||
- unmask event
|
||||
|
||||
It is not possible to implement this flow with handle_edge_irq, so
|
||||
switch back to handle_fasteoi_irq. Please note that Xen event irqs are
|
||||
ONESHOT. Also note that handle_fasteoi_irq was in-use before the
|
||||
following commit, that is partially reverted by this patch:
|
||||
|
||||
7e186bdd0098 xen: do not clear and mask evtchns in __xen_evtchn_do_upcall
|
||||
|
||||
PIRQ handling is left unchanged.
|
||||
|
||||
This patch fixes a domU hang observed when using LinuxRT as dom0 kernel.
|
||||
|
||||
Link: https://lkml.org/lkml/2020/4/27/1287
|
||||
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
|
||||
|
||||
Upstream-Status: Inappropriate since the upstream solution diverges from this patch
|
||||
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
|
||||
---
|
||||
drivers/xen/events/events_base.c | 13 +++----------
|
||||
1 file changed, 3 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
|
||||
index 6c8843968a52..1873a19b8b24 100644
|
||||
--- a/drivers/xen/events/events_base.c
|
||||
+++ b/drivers/xen/events/events_base.c
|
||||
@@ -845,7 +845,7 @@ int bind_evtchn_to_irq(unsigned int evtchn)
|
||||
goto out;
|
||||
|
||||
irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
|
||||
- handle_edge_irq, "event");
|
||||
+ handle_fasteoi_irq, "event");
|
||||
|
||||
ret = xen_irq_info_evtchn_setup(irq, evtchn);
|
||||
if (ret < 0) {
|
||||
@@ -978,7 +978,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu, bool percpu)
|
||||
handle_percpu_irq, "virq");
|
||||
else
|
||||
irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
|
||||
- handle_edge_irq, "virq");
|
||||
+ handle_fasteoi_irq, "virq");
|
||||
|
||||
bind_virq.virq = virq;
|
||||
bind_virq.vcpu = xen_vcpu_nr(cpu);
|
||||
@@ -1387,12 +1387,6 @@ static void ack_dynirq(struct irq_data *data)
|
||||
clear_evtchn(evtchn);
|
||||
}
|
||||
|
||||
-static void mask_ack_dynirq(struct irq_data *data)
|
||||
-{
|
||||
- disable_dynirq(data);
|
||||
- ack_dynirq(data);
|
||||
-}
|
||||
-
|
||||
static int retrigger_dynirq(struct irq_data *data)
|
||||
{
|
||||
unsigned int evtchn = evtchn_from_irq(data->irq);
|
||||
@@ -1595,8 +1589,7 @@ static struct irq_chip xen_dynamic_chip __read_mostly = {
|
||||
.irq_mask = disable_dynirq,
|
||||
.irq_unmask = enable_dynirq,
|
||||
|
||||
- .irq_ack = ack_dynirq,
|
||||
- .irq_mask_ack = mask_ack_dynirq,
|
||||
+ .irq_eoi = ack_dynirq,
|
||||
|
||||
.irq_set_affinity = set_affinity_irq,
|
||||
.irq_retrigger = retrigger_dynirq,
|
||||
--
|
||||
2.17.1
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-5.4:"
|
||||
|
||||
SRC_URI_append = " \
|
||||
file://0001-xen-use-handle_fasteoi_irq-to-handle-xen-dynamic-eve.patch \
|
||||
"
|
||||
|
||||
KERNEL_FEATURES += "features/arm-autonomy/preempt-rt-extras.scc"
|
||||
@@ -3,7 +3,7 @@
|
||||
# can directly dd to boot media. Uses a custom grub.cfg file to configure the boot.
|
||||
|
||||
# First boot partition normally populated as /dev/sda1
|
||||
part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --size="${BOOT_PART_SIZE}${BOOT_PART_SIZE_UNIT}" --label msdos --active --align 1024
|
||||
part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
|
||||
|
||||
# Second rootfs partition normally populated as /dev/sda2
|
||||
part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
set term="vt100"
|
||||
set default="3"
|
||||
set timeout="5"
|
||||
|
||||
source $prefix/arm-autonomy-n1sdp-grub.cfg
|
||||
|
||||
menuentry 'N1SDP PREEMPT_RT ACPI Boot' {
|
||||
linux /Image-preempt-rt $kernel_cmdline acpi=force
|
||||
}
|
||||
|
||||
menuentry 'N1SDP PREEMPT_RT Single-Chip Boot (Device Tree)' {
|
||||
devicetree /n1sdp-single-chip.dtb
|
||||
linux /Image-preempt-rt $kernel_cmdline
|
||||
}
|
||||
|
||||
menuentry 'N1SDP PREEMPT_RT Multi-Chip Boot (Device Tree)' {
|
||||
devicetree /n1sdp-multi-chip.dtb
|
||||
linux /Image-preempt-rt $kernel_cmdline
|
||||
}
|
||||
|
||||
menuentry 'N1SDP PREEMPT_RT Arm Autonomy (Xen) Single-Chip Boot (Device Tree)' {
|
||||
# no_argumants under here is a workaround for a bug
|
||||
# also any kernel or dom0 cmdline arguments has to be passed via dtb
|
||||
# because any arguments put here will be ignored by xen
|
||||
xen_hypervisor /xen.efi no_arguments=use_dtb_for_xen_or_kernel_cmdline
|
||||
xen_module /Image-preempt-rt
|
||||
devicetree /n1sdp-single-chip-xen.dtb
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
Upstream Status: Inappropriate [meta-arm-autonomy specifc u-boot config]
|
||||
Signed-off-by: Nathan Dunne <nathan.dunne@arm.com>
|
||||
|
||||
diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
|
||||
index e63c335f85..9ee050a4a6 100644
|
||||
--- a/include/configs/vexpress_aemv8a.h
|
||||
+++ b/include/configs/vexpress_aemv8a.h
|
||||
@@ -162,7 +162,7 @@
|
||||
#elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
"kernel_name=Image\0" \
|
||||
- "kernel_addr=0x80080000\0" \
|
||||
+ "kernel_addr=0x84000000\0" \
|
||||
"initrd_name=ramdisk.img\0" \
|
||||
"initrd_addr=0x88000000\0" \
|
||||
"fdtfile=devtree.dtb\0" \
|
||||
@@ -0,0 +1,9 @@
|
||||
# Machine specific u-boot
|
||||
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:"
|
||||
|
||||
#
|
||||
# FVP BASE
|
||||
#
|
||||
|
||||
SRC_URI_append_fvp-base = "${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', ' file://xen_u-boot_kernel_addr.patch', '', d)}"
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
CONTAINER_IMAGE_FILE="###CONTAINER_IMAGE_FILE###"
|
||||
CONTAINER_IMAGE_NAME_AND_TAG="###CONTAINER_IMAGE_NAME_AND_TAG###"
|
||||
CONTAINER_IMAGE_FILE_KEEP="###CONTAINER_IMAGE_FILE_KEEP###"
|
||||
|
||||
has_docker_image() {
|
||||
docker image inspect "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
start() {
|
||||
# Image does not exist and image file exists: Import the image.
|
||||
if ! has_docker_image ${CONTAINER_IMAGE_NAME_AND_TAG} && \
|
||||
[ -f "/usr/share/docker/images/${CONTAINER_IMAGE_FILE}" ]; then
|
||||
echo "Importing ${CONTAINER_IMAGE_NAME_AND_TAG} container image..."
|
||||
docker import \
|
||||
/usr/share/docker/images/${CONTAINER_IMAGE_FILE} \
|
||||
${CONTAINER_IMAGE_NAME_AND_TAG} 2>&1 || {
|
||||
echo "Import ${CONTAINER_IMAGE_NAME_AND_TAG} container image: Failed."
|
||||
exit $?
|
||||
}
|
||||
echo "Import ${CONTAINER_IMAGE_NAME_AND_TAG} container image: Done."
|
||||
|
||||
if [ "${CONTAINER_IMAGE_FILE_KEEP}" != "1" ]; then
|
||||
rm /usr/share/docker/images/${CONTAINER_IMAGE_FILE}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start && exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
||||
@@ -1,79 +0,0 @@
|
||||
#
|
||||
# This recipe imports a docker container image to the xenguest image
|
||||
# Notes:
|
||||
# - Users should add docker in the local.conf of their target with
|
||||
# DISTRO_FEATURES += " docker" to make sure docker is installed.
|
||||
# - The CONTAINER_IMAGE_FILE variable defines the docker
|
||||
# container image to be imported and should be set in local.conf.
|
||||
# - The CONTAINER_IMAGE_FILE_KEEP variable defines the
|
||||
# behaviour that if the container image file is kept after import.
|
||||
# Setting this variable to 1 means keep the container image file after
|
||||
# import. This variable can be set in local.conf.
|
||||
# - The CONTAINER_IMAGE_NAME_AND_TAG variable defines the name and
|
||||
# tag of the imported image. The value of this variable should follow
|
||||
# the format of `NAME:TAG`. This variable can be set in local.conf.
|
||||
#
|
||||
|
||||
DESCRIPTION = "Import a docker image to xenguest"
|
||||
LICENSE = "MIT"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
CONTAINER_IMAGE_FILE ??= ""
|
||||
CONTAINER_IMAGE_FILE_KEEP ??= ""
|
||||
CONTAINER_IMAGE_NAME_AND_TAG ??= "local:local"
|
||||
|
||||
inherit features_check
|
||||
REQUIRED_DISTRO_FEATURES = "docker"
|
||||
|
||||
python __anonymous() {
|
||||
# Check if `CONTAINER_IMAGE_FILE` is empty.
|
||||
container_image_file = d.getVar('CONTAINER_IMAGE_FILE')
|
||||
if not container_image_file:
|
||||
raise bb.parse.SkipRecipe("CONTAINER_IMAGE_FILE is empty")
|
||||
|
||||
# In case we have a symlink we need to convert the link to its realpath.
|
||||
if os.path.islink(container_image_file):
|
||||
container_image_file = os.path.realpath(container_image_file)
|
||||
bb.warn("Given CONTAINER_IMAGE_FILE: %s is a symlink, "
|
||||
"convert the link to its realpath: %s" %
|
||||
(d.getVar('CONTAINER_IMAGE_FILE'), container_image_file))
|
||||
d.setVar('CONTAINER_IMAGE_FILE', container_image_file)
|
||||
|
||||
# Check if the container image file exists.
|
||||
# The container image file here is either the real file or the symlink target.
|
||||
if not os.path.exists(container_image_file):
|
||||
raise bb.parse.SkipRecipe("CONTAINER_IMAGE_FILE: %s does not exist." %
|
||||
container_image_file)
|
||||
|
||||
# Here we can ensure that the CONTAINER_IMAGE_FILE exists and is valid.
|
||||
# Therefore we can append this file to SRC_URI.
|
||||
d.appendVar('SRC_URI', ' file://' + container_image_file + ';unpack=0')
|
||||
}
|
||||
|
||||
S = "${WORKDIR}"
|
||||
SRC_URI = "file://import_container.sh"
|
||||
|
||||
inherit update-rc.d
|
||||
INITSCRIPT_PARAMS = "start 30 2 3 4 5 ."
|
||||
INITSCRIPT_NAME = "import_container.sh"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -d -m 755 ${D}${datadir}/docker/images
|
||||
|
||||
install -m 777 ${CONTAINER_IMAGE_FILE} ${D}${datadir}/docker/images/.
|
||||
install -m 755 import_container.sh ${D}${sysconfdir}/init.d
|
||||
|
||||
BASENAME_CONTAINER_IMAGE_FILE=$(basename "${CONTAINER_IMAGE_FILE}")
|
||||
|
||||
sed -i "s,###CONTAINER_IMAGE_FILE###,${BASENAME_CONTAINER_IMAGE_FILE}," \
|
||||
${D}${sysconfdir}/init.d/import_container.sh
|
||||
sed -i "s,###CONTAINER_IMAGE_NAME_AND_TAG###,${CONTAINER_IMAGE_NAME_AND_TAG}," \
|
||||
${D}${sysconfdir}/init.d/import_container.sh
|
||||
sed -i "s,###CONTAINER_IMAGE_FILE_KEEP###,${CONTAINER_IMAGE_FILE_KEEP}," \
|
||||
${D}${sysconfdir}/init.d/import_container.sh
|
||||
}
|
||||
|
||||
FILES_${PN} += "${datadir}/docker/images"
|
||||
RDEPENDS_${PN} = "packagegroup-docker-runtime-minimal"
|
||||
@@ -1 +0,0 @@
|
||||
CONFIG_FEATURE_TAR_LONG_OPTIONS=y
|
||||
@@ -1,4 +0,0 @@
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
# The --exclude flag in Busybox tar is required by xenguest-mkimage
|
||||
SRC_URI += "file://feature_tar_long_options.cfg"
|
||||
@@ -2,11 +2,7 @@
|
||||
|
||||
DESCRIPTION = "Arm Autonomy stack host minimal image"
|
||||
|
||||
# When alternate-kernel DISTRO_FEATURE is present we will build
|
||||
# and install the alternate kernel
|
||||
inherit ${@bb.utils.filter('DISTRO_FEATURES', 'alternate-kernel', d)}
|
||||
|
||||
inherit core-image features_check
|
||||
inherit core-image
|
||||
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
@@ -14,21 +10,12 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda
|
||||
# The ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS variable can be used to include in the
|
||||
# image one or several xenguest images.
|
||||
# The list must be space separated and each entry must have the following
|
||||
# format: URL[;params]
|
||||
# format: URL[;guestname=NAME]
|
||||
# - URL can be the full path to a file or a Yocto compatible SRC_URI url
|
||||
# - params encompasses two values that can be optionally set:
|
||||
# - guestname=NAME can be used to specify the name of the guest. If not
|
||||
# specified the default value is the basename of the file
|
||||
# (without .xenguest extension).
|
||||
# - guestcount=NUM can be used to created NUM guests with the same config.
|
||||
# All guests after the first will have numbers appended to the guestname,
|
||||
# starting from 2. In the rootfs additional xenguest files will be
|
||||
# symlinks to the original.
|
||||
# params should be semicolon seperated, without a space, and can appear in
|
||||
# any order.
|
||||
#
|
||||
# - guestname=NAME can be used to specify the name of the guest. If not
|
||||
# specified the basename of the file (without .xenguest extension) is used.
|
||||
# Here are examples of values:
|
||||
# /home/mydir/myguest.xenguest;guestname=guest1;guestcount=3
|
||||
# /home/mydir/myguest.xenguest;guestname=guest1
|
||||
# http://www.url.com/testguest.xenguest
|
||||
#
|
||||
# If you are using the output of an other Yocto project, you should use the
|
||||
@@ -80,14 +67,13 @@ DO_IMAGE_MCDEPENDS := "${@ '${MC_DOIMAGE_MCDEPENDS}' if d.getVar('BBMULTICONFIG'
|
||||
# Apply mc dependency. Empty string if multiconfig not enabled
|
||||
do_image[mcdepends] += "${DO_IMAGE_MCDEPENDS}"
|
||||
|
||||
REQUIRED_DISTRO_FEATURES += 'arm-autonomy-host'
|
||||
REQUIRED_DISTRO_FEATURES += 'xen'
|
||||
|
||||
python __anonymous() {
|
||||
import re
|
||||
guestfile_pattern = re.compile(r"^([^;]+);")
|
||||
guestname_pattern = re.compile(r";guestname=([^;]+);?")
|
||||
guestcount_pattern = re.compile(r";guestcount=(\d+);?")
|
||||
if bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', False, True, d):
|
||||
raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'arm-autonomy-host'")
|
||||
|
||||
if bb.utils.contains('DISTRO_FEATURES', 'xen', False, True, d):
|
||||
raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'xen'")
|
||||
|
||||
# Check in ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS for extra guests and add them
|
||||
# to SRC_URI with xenguest parameter if not set
|
||||
@@ -97,19 +83,16 @@ python __anonymous() {
|
||||
# If the user just specified a file instead of file://FILE, add
|
||||
# the file:// prefix
|
||||
if guest.startswith('/'):
|
||||
guestname = os.path.basename(guest)
|
||||
guestfile = guest
|
||||
guestcount = "1"
|
||||
f = guestfile_pattern.search(guest)
|
||||
n = guestname_pattern.search(guest)
|
||||
c = guestcount_pattern.search(guest)
|
||||
|
||||
if f is not None:
|
||||
guestfile = f.group(1)
|
||||
if n is not None:
|
||||
guestname = n.group(1)
|
||||
if c is not None:
|
||||
guestcount = c.group(1)
|
||||
guestfile = ''
|
||||
guestname = ''
|
||||
if ';guestname=' in guest:
|
||||
# user specified a guestname
|
||||
guestname = guest.split(';guestname=')[1]
|
||||
guestfile = guest.split(';guestname=')[0]
|
||||
else:
|
||||
# no guestname so use the basename
|
||||
guestname = os.path.basename(guest)
|
||||
guestfile = guest
|
||||
# in case we have a link we need the destination
|
||||
guestfile = os.path.realpath(guestfile)
|
||||
|
||||
@@ -118,7 +101,7 @@ python __anonymous() {
|
||||
raise bb.parse.SkipRecipe("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS entry does not exist: " + guest)
|
||||
|
||||
# In case the file is a symlink make sure we use the destination
|
||||
d.appendVar('SRC_URI', ' file://' + guestfile + ';guestname=' + guestname + ';guestcount=' + guestcount)
|
||||
d.appendVar('SRC_URI', ' file://' + guestfile + ';guestname=' + guestname)
|
||||
else:
|
||||
# we have a Yocto URL
|
||||
try:
|
||||
@@ -154,15 +137,8 @@ python add_extern_guests () {
|
||||
# Add file extension if not there
|
||||
if not dstname.endswith('.xenguest'):
|
||||
dstname += '.xenguest'
|
||||
|
||||
if not bb.utils.copyfile(path, guestdir + '/' + dstname):
|
||||
bb.fatal("Fail to copy Guest file " + path)
|
||||
|
||||
if 'guestcount' in parm:
|
||||
guestcount = int(parm['guestcount']) + 1
|
||||
|
||||
for i in range(2, guestcount):
|
||||
os.symlink('./' + dstname, guestdir + '/' + dstname.replace('.xenguest', str(i) + '.xenguest'))
|
||||
}
|
||||
|
||||
IMAGE_PREPROCESS_COMMAND += "add_extern_guests; "
|
||||
|
||||
@@ -19,7 +19,7 @@ DESCRIPTION = "Add entries in DTB for Xen and Dom0"
|
||||
XEN_DEVICETREE_DEPEND_append = " virtual/kernel:do_deploy"
|
||||
XEN_DEVICETREE_DTBS ?= "${KERNEL_DEVICETREE}"
|
||||
XEN_DEVICETREE_XEN_BOOTARGS ?= "noreboot dom0_mem=${XEN_DEVICETREE_DOM0_MEM}"
|
||||
XEN_DEVICETREE_DOM0_MEM ?= "1024M,max:1024M"
|
||||
XEN_DEVICETREE_DOM0_MEM ?= "1024M"
|
||||
XEN_DEVICETREE_DOM0_BOOTARGS ?= "console=hvc0 earlycon=xen"
|
||||
XEN_DEVICETREE_DOM0_ADDR ?= "0x80080000"
|
||||
XEN_DEVICETREE_DOM0_SIZE ?= "0x01000000"
|
||||
@@ -30,36 +30,11 @@ XEN_DEVICETREE_DTSI_MERGE ?= "xen.dtsi"
|
||||
inherit nopackages deploy
|
||||
|
||||
DEPENDS += "dtc-native"
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
do_configure[noexec] = "1"
|
||||
do_compile[noexec] = "1"
|
||||
do_install[noexec] = "1"
|
||||
|
||||
# Validate xen devicetree variables
|
||||
python __anonymous() {
|
||||
|
||||
# Compare values of a list of variables to a regex pattern
|
||||
def validate_type(pattern, var_list):
|
||||
for varname in var_list:
|
||||
if d.getVar(varname):
|
||||
if not pattern.match(d.getVar(varname)):
|
||||
raise bb.parse.SkipRecipe(d.getVar(varname) + "' is not a valid value for " + varname + "!")
|
||||
else:
|
||||
raise bb.parse.SkipRecipe('Required variable ' + varname + ' is empty!')
|
||||
|
||||
import re
|
||||
|
||||
num_vars_to_check = ['XEN_DEVICETREE_DOM0_ADDR', 'XEN_DEVICETREE_DOM0_SIZE']
|
||||
size_vars_to_check = ['XEN_DEVICETREE_DOM0_MEM']
|
||||
|
||||
num_pattern = re.compile(r'((0x[0-9a-fA-F]+)|[0-9]+)$')
|
||||
size_pattern = re.compile(r'[0-9]+[MG](,max:[0-9]+[MG])?$')
|
||||
|
||||
validate_type(num_pattern, num_vars_to_check)
|
||||
validate_type(size_pattern, size_vars_to_check)
|
||||
}
|
||||
|
||||
do_deploy() {
|
||||
if [ ! -f ${WORKDIR}/xen.dtsi.in ]; then
|
||||
die "xen.dtsi.in does not exist"
|
||||
@@ -113,18 +88,14 @@ python calc_xen_dtb_dom0_size() {
|
||||
bb.note('size in bytes: %d' % size)
|
||||
# Ceil to MiB
|
||||
size_required = ceil(size / (2 ** 20)) * (2 ** 20)
|
||||
xen_devicetree_dom0_size = d.getVar('XEN_DEVICETREE_DOM0_SIZE')
|
||||
if xen_devicetree_dom0_size[:2] == "0x":
|
||||
size_defined = int(xen_devicetree_dom0_size, 16)
|
||||
else:
|
||||
size_defined = int(xen_devicetree_dom0_size)
|
||||
size_defined = int(d.getVar('XEN_DEVICETREE_DOM0_SIZE'), 16)
|
||||
|
||||
if size_required > size_defined:
|
||||
bb.note ("Wrong kernel size setting inside xen dtb!\n"\
|
||||
bb.warn ("Wrong kernel size setting inside xen dtb!\n"\
|
||||
"Required:\t%(req)d (%(req)#010X)\n"\
|
||||
"Requested:\t%(def)d (%(def)#010X)"\
|
||||
% {"req": size_required, "def": size_defined})
|
||||
bb.note ("Overriding XEN_DEVICETREE_DOM0_SIZE with "\
|
||||
bb.warn ("Overriding XEN_DEVICETREE_DOM0_SIZE with "\
|
||||
"%(req)d (%(req)#010X)" % {"req": size_required})
|
||||
d.setVar('XEN_DEVICETREE_DOM0_SIZE', hex(size_required))
|
||||
}
|
||||
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
From 3b418b33265402aab0cb1bf2b745a25724bae2d8 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <3b418b33265402aab0cb1bf2b745a25724bae2d8.1602684880.git.diego.sueiro@arm.com>
|
||||
From: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||
Date: Tue, 18 Aug 2020 14:47:38 +0100
|
||||
Subject: [PATCH] arm: Add Neoverse N1 processor identification
|
||||
|
||||
Add MIDR and CPU part numbers for Neoverse N1
|
||||
|
||||
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||
Acked-by: Julien Grall <jgrall@amazon.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||
---
|
||||
xen/include/asm-arm/processor.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
|
||||
index aa642e3..3ca67f8 100644
|
||||
--- a/xen/include/asm-arm/processor.h
|
||||
+++ b/xen/include/asm-arm/processor.h
|
||||
@@ -58,6 +58,7 @@
|
||||
#define ARM_CPU_PART_CORTEX_A73 0xD09
|
||||
#define ARM_CPU_PART_CORTEX_A75 0xD0A
|
||||
#define ARM_CPU_PART_CORTEX_A76 0xD0B
|
||||
+#define ARM_CPU_PART_NEOVERSE_N1 0xD0C
|
||||
|
||||
#define MIDR_CORTEX_A12 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A12)
|
||||
#define MIDR_CORTEX_A17 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A17)
|
||||
@@ -68,6 +69,7 @@
|
||||
#define MIDR_CORTEX_A73 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A73)
|
||||
#define MIDR_CORTEX_A75 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A75)
|
||||
#define MIDR_CORTEX_A76 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A76)
|
||||
+#define MIDR_NEOVERSE_N1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N1)
|
||||
|
||||
/* MPIDR Multiprocessor Affinity Register */
|
||||
#define _MPIDR_UP (30)
|
||||
--
|
||||
2.7.4
|
||||
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
From 858c0be8c2fa4125a0fa0acaa03ae730e5c7cb3c Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <858c0be8c2fa4125a0fa0acaa03ae730e5c7cb3c.1602684183.git.diego.sueiro@arm.com>
|
||||
From: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||
Date: Tue, 18 Aug 2020 14:47:39 +0100
|
||||
Subject: [PATCH] xen/arm: Enable CPU Erratum 1165522 for Neoverse
|
||||
|
||||
Enable CPU erratum of Speculative AT on the Neoverse N1 processor
|
||||
versions r0p0 to r2p0.
|
||||
Also Fix Cortex A76 Erratum string which had a wrong errata number.
|
||||
|
||||
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||
Acked-by: Julien Grall <jgrall@amazon.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||
---
|
||||
xen/arch/arm/cpuerrata.c | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
|
||||
index 0248893..6c09017 100644
|
||||
--- a/xen/arch/arm/cpuerrata.c
|
||||
+++ b/xen/arch/arm/cpuerrata.c
|
||||
@@ -477,8 +477,14 @@ static const struct arm_cpu_capabilities arm_errata[] = {
|
||||
},
|
||||
#endif
|
||||
{
|
||||
+ /* Neoverse r0p0 - r2p0 */
|
||||
+ .desc = "ARM erratum 1165522",
|
||||
+ .capability = ARM64_WORKAROUND_AT_SPECULATE,
|
||||
+ MIDR_RANGE(MIDR_NEOVERSE_N1, 0, 2 << MIDR_VARIANT_SHIFT),
|
||||
+ },
|
||||
+ {
|
||||
/* Cortex-A76 r0p0 - r2p0 */
|
||||
- .desc = "ARM erratum 116522",
|
||||
+ .desc = "ARM erratum 1165522",
|
||||
.capability = ARM64_WORKAROUND_AT_SPECULATE,
|
||||
MIDR_RANGE(MIDR_CORTEX_A76, 0, 2 << MIDR_VARIANT_SHIFT),
|
||||
},
|
||||
--
|
||||
2.7.4
|
||||
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
From 1814a626fb5811184eda64fe22f0055df4600211 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <1814a626fb5811184eda64fe22f0055df4600211.1602684203.git.diego.sueiro@arm.com>
|
||||
From: Julien Grall <jgrall@amazon.com>
|
||||
Date: Tue, 25 Aug 2020 18:38:10 +0100
|
||||
Subject: [PATCH] xen/arm: Update silicon-errata.txt with the Neovers AT
|
||||
erratum
|
||||
|
||||
Commit 858c0be8c2fa "xen/arm: Enable CPU Erratum 1165522 for Neoverse"
|
||||
added a new erratum but forgot to update silicon-errata.txt.
|
||||
|
||||
Update the file accordingly to keep track of errata workaround in Xen.
|
||||
|
||||
Signed-off-by: Julien Grall <jgrall@amazon.com>
|
||||
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||
---
|
||||
docs/misc/arm/silicon-errata.txt | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
|
||||
index 11e5a9d..e15d092 100644
|
||||
--- a/docs/misc/arm/silicon-errata.txt
|
||||
+++ b/docs/misc/arm/silicon-errata.txt
|
||||
@@ -51,4 +51,5 @@ stable hypervisors.
|
||||
| ARM | Cortex-A57 | #1319537 | N/A |
|
||||
| ARM | Cortex-A72 | #1319367 | N/A |
|
||||
| ARM | Cortex-A76 | #1165522 | N/A |
|
||||
+| ARM | Neoverse-N1 | #1165522 | N/A
|
||||
| ARM | MMU-500 | #842869 | N/A |
|
||||
--
|
||||
2.7.4
|
||||
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
From 968bb86d04913f52d7678a842474f2a674a8b23e Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <968bb86d04913f52d7678a842474f2a674a8b23e.1602683678.git.diego.sueiro@arm.com>
|
||||
From: Wei Chen <wei.chen@arm.com>
|
||||
Date: Fri, 28 Aug 2020 02:34:03 +0000
|
||||
Subject: [PATCH] xen/arm: Missing N1/A76/A75 FP registers in vCPU context
|
||||
switch
|
||||
|
||||
Xen has cpu_has_fp/cpu_has_simd to detect whether the CPU supports
|
||||
FP/SIMD or not. But currently, these two MACROs only consider value 0
|
||||
of ID_AA64PFR0_EL1.FP/SIMD as FP/SIMD features enabled. But for CPUs
|
||||
that support FP/SIMD and half-precision floating-point arithmetic, the
|
||||
ID_AA64PFR0_EL1.FP/SIMD are 1 (see Arm ARM DDI0487F.b, D13.2.64).
|
||||
For these CPUs, xen will treat them as no FP/SIMD support, the
|
||||
vfp_save/restore_state will not take effect.
|
||||
|
||||
From the TRM documents of Cortex-A75/A76/N1, we know these CPUs support
|
||||
basic Advanced SIMD/FP and half-precision floating-point arithmetic. In
|
||||
this case, on N1/A76/A75 platforms, Xen will always miss the floating
|
||||
pointer registers save/restore. If different vCPUs are running on the
|
||||
same pCPU, the floating pointer registers will be corrupted randomly.
|
||||
|
||||
This patch fixes Xen on these new cores.
|
||||
|
||||
Signed-off-by: Wei Chen <wei.chen@arm.com>
|
||||
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||
Reviewed-by: Julien Grall <jgrall@amazon.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||
---
|
||||
xen/include/asm-arm/cpufeature.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
|
||||
index 674beb0..10878ea 100644
|
||||
--- a/xen/include/asm-arm/cpufeature.h
|
||||
+++ b/xen/include/asm-arm/cpufeature.h
|
||||
@@ -13,8 +13,8 @@
|
||||
#define cpu_has_el2_64 (boot_cpu_feature64(el2) >= 1)
|
||||
#define cpu_has_el3_32 (boot_cpu_feature64(el3) == 2)
|
||||
#define cpu_has_el3_64 (boot_cpu_feature64(el3) >= 1)
|
||||
-#define cpu_has_fp (boot_cpu_feature64(fp) == 0)
|
||||
-#define cpu_has_simd (boot_cpu_feature64(simd) == 0)
|
||||
+#define cpu_has_fp (boot_cpu_feature64(fp) < 8)
|
||||
+#define cpu_has_simd (boot_cpu_feature64(simd) < 8)
|
||||
#define cpu_has_gicv3 (boot_cpu_feature64(gic) == 1)
|
||||
#endif
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-4.14:"
|
||||
|
||||
SRC_URI += " \
|
||||
file://0001-arm-Add-Neoverse-N1-processor-identification.patch \
|
||||
file://0002-xen-arm-Enable-CPU-Erratum-1165522-for-Neoverse.patch \
|
||||
file://0003-xen-arm-Update-silicon-errata.txt-with-the-Neovers-A.patch \
|
||||
file://0004-xen-arm-Missing-N1-A76-A75-FP-registers-in-vCPU-cont.patch \
|
||||
file://0005-xen-arm-Throw-messages-for-unknown-FP-SIMD-implement.patch \
|
||||
file://0001-xen-arm-Throw-messages-for-unknown-FP-SIMD-implement.patch \
|
||||
"
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
/var/log/xenguest {
|
||||
missingok
|
||||
size 10k
|
||||
copytruncate
|
||||
rotate 2
|
||||
}
|
||||
@@ -11,13 +11,11 @@ BRIDGE_NAME="###BRIDGE_NAME###"
|
||||
case "${XENGUEST_NETWORK_TYPE:=}" in
|
||||
nat)
|
||||
echo "vif = ['script=vif-nat']" >> ${guestcfgfile}
|
||||
log info "Network type is NAT"
|
||||
;;
|
||||
bridge)
|
||||
echo "vif = ['script=vif-bridge,bridge=${BRIDGE_NAME}']" >> ${guestcfgfile}
|
||||
log info "Network type is bridge: ${BRIDGE_NAME}"
|
||||
;;
|
||||
*)
|
||||
log error "XENGUEST_NETWORK_TYPE=$XENGUEST_NETWORK_TYPE invalid"
|
||||
echo "${@}: XENGUEST_NETWORK_TYPE=$XENGUEST_NETWORK_TYPE invalid"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -68,7 +68,7 @@ case "$1" in
|
||||
# update guest list
|
||||
guestlist=$(xenguest-manager status | grep Running | cut -d ":" -f1)
|
||||
for f in ${guestlist}; do
|
||||
xenguest-manager shutdown ${f} --kill
|
||||
xl shutdown -w ${f} || xl destroy ${f}
|
||||
done
|
||||
;;
|
||||
reload)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -110,8 +110,7 @@ Init configuration
|
||||
|
||||
Disk configuration
|
||||
--disk-reset-config reset disk guest configuration to default (no disk)
|
||||
--disk-size=SZ set guest disk size in MB or GB(default),
|
||||
e.g 1000M or 2[G].
|
||||
--disk-size=SZ set guest disk size (in GB)
|
||||
--disk-device=DEV set device to be used to create the guest disk
|
||||
if unset or set to an empty string, the volume will be
|
||||
create in the default manager volume group.
|
||||
@@ -128,7 +127,7 @@ Disk configuration
|
||||
--disk-rm-part=ID remove partition ID from the guest disk
|
||||
--disk-add-file=SRC:DST add file SRC as disk file DST in the xenguest image.
|
||||
DST can then be used as a partition CONTENT.
|
||||
--disk-rm-file=DST remove disk file DST from the xenguest image.
|
||||
--disk--rm-file=DST remove disk file DST from the xenguest image.
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -371,159 +370,13 @@ disk_config_rm_part() {
|
||||
sed -i "/DISK_PART${partid}=.*/d" ${IMAGE_TMPDIR}/disk.cfg
|
||||
}
|
||||
|
||||
is_integer() {
|
||||
if ! [[ "${1}" =~ ^[0-9]+$ ]]; then
|
||||
>&2 echo "error: invalid number '${1}'"; exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# check size and convert it to MB, e.g '1[G]' => '1000M'
|
||||
check_size() {
|
||||
local disksize="${1}"
|
||||
|
||||
[ -n "${disksize}" ] || disksize="invalid"
|
||||
|
||||
# disksize may have appended M or G suffix, let's extract it
|
||||
# ${var:offset:length}, where #var is var length
|
||||
local lastchar="${disksize:${#disksize}-1}"
|
||||
case "${lastchar}" in
|
||||
[0-9])
|
||||
# backwards compatibility
|
||||
is_integer "${disksize}"
|
||||
echo -e "$((${disksize} * 1000))M"
|
||||
return
|
||||
;;
|
||||
G|M)
|
||||
if [ "${#disksize}" -gt "1" ]; then
|
||||
local size="${disksize::${#disksize}-1}"
|
||||
is_integer "${size}"
|
||||
# convert GB to MB
|
||||
[ "${lastchar}" = "M" ] || size=$((${size} * 1000))
|
||||
echo -e "${size}M"
|
||||
return
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
>&2 echo -e "Invalid size format '${1}'" \
|
||||
"\n\tSupported size format is e.g 1000M or 2[G]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
disk_config_get_size() {
|
||||
disksize=$(echo -e "$( . ${IMAGE_TMPDIR}/disk.cfg && echo $DISK_SIZE)")
|
||||
check_size "${disksize}"
|
||||
}
|
||||
|
||||
disk_config_get_parts() {
|
||||
echo -e "$( . ${IMAGE_TMPDIR}/disk.cfg && \
|
||||
typeset -p | awk '$3 ~ /^DISK_PART/ { print $3 }')"
|
||||
}
|
||||
|
||||
disk_config_get_free_space() {
|
||||
disk_usage="0"
|
||||
for partinfo in $(disk_config_get_parts)
|
||||
do
|
||||
partsize=$(echo "${partinfo}" | cut -d '"' -f2 | sed -e "s/:.*//")
|
||||
sizeMB=$(check_size "${partsize}")
|
||||
[ -n "${sizeMB}" ] || exit 1
|
||||
disk_usage=$((${sizeMB::${#sizeMB}-1} + $disk_usage))
|
||||
done
|
||||
|
||||
disk_size=$(disk_config_get_size)
|
||||
echo -e "$((${disk_size::${#disk_size}-1} - ${disk_usage}))M"
|
||||
}
|
||||
|
||||
disk_check_partition_format() {
|
||||
local partformat="${1}"
|
||||
# if partformat is not defined let's skip this check
|
||||
[ -n "${partformat}" ] || return 0
|
||||
|
||||
case "${partformat}" in
|
||||
vfat|ext2|ext3|ext4|swap)
|
||||
;;
|
||||
*)
|
||||
# invalid/unknown fstype
|
||||
echo "Invalid file fstype ${partformat}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
disk_check_partition_content() {
|
||||
local partcontent="${1}"
|
||||
# if partcontent is not defined let's skip this check
|
||||
[ -n "${partcontent}" ] || return 0
|
||||
|
||||
case "${partcontent}" in
|
||||
*.img*)
|
||||
case "${partcontent}" in
|
||||
*.img.gz|*.img.bz2|*.img)
|
||||
;;
|
||||
*)
|
||||
# invalid/unknown compression type
|
||||
echo "Invalid file format in disk ${partcontent}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.tar*)
|
||||
case "${partcontent}" in
|
||||
*.tar.gz|*.tar.bz2|*.tar.xz|*.tar)
|
||||
;;
|
||||
*)
|
||||
# invalid/unknown tar type
|
||||
echo "Invalid file format in disk ${partcontent}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#invalid content type
|
||||
echo "Unsupported content type ${partcontent}!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
# do not allow to create multiple partitions the same content
|
||||
if grep ":${partcontent}\"" <<< "$(disk_config_get_parts)"; then
|
||||
echo "Error ${partcontent} is already inside guest image"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
disk_config_add_part() {
|
||||
partconf="${1}"
|
||||
partid=$(echo ${partconf} | sed -e "s/:.*//")
|
||||
partinfo=$(echo ${partconf} | sed -e "s/[^:]*://")
|
||||
partsize=$(echo ${partinfo} | cut -d ":" -f1)
|
||||
partformat=$(echo ${partinfo} | cut -d ":" -f2)
|
||||
partcontent=$(echo ${partinfo} | cut -d ":" -f3)
|
||||
|
||||
# check size "ID:*SIZE*:FORMAT:CONTENT"
|
||||
partsizeMB=$(check_size "${partsize}")
|
||||
|
||||
# Make sure we don't add the same partition twice
|
||||
disk_config_rm_part "${partid}"
|
||||
|
||||
# check available disk space
|
||||
freespace=$(disk_config_get_free_space)
|
||||
if ((${partsizeMB::${#partsizeMB}-1} > ${freespace::${#freespace}-1}))
|
||||
then
|
||||
echo -e "Not enough free disk space(${freespace}) for partition "\
|
||||
"'${partconf}'!"\
|
||||
"\tTo adjust disk size use '--disk-size' parameter"\
|
||||
"\tor shrink the partition with '--disk-add-part' parameter"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check format "ID:SIZE:*FORMAT*:CONTENT"
|
||||
disk_check_partition_format "${partformat}"
|
||||
|
||||
# check content "ID:SIZE:FORMAT:*CONTENT*"
|
||||
disk_check_partition_content "${partcontent}"
|
||||
|
||||
disk_config_rm_part ${partid}
|
||||
echo "DISK_PART${partid}=\"${partinfo}\"" >> \
|
||||
${IMAGE_TMPDIR}/disk.cfg
|
||||
}
|
||||
@@ -889,13 +742,11 @@ for arg in "${@}"; do
|
||||
disk_config_reset
|
||||
;;
|
||||
--disk-size=*)
|
||||
size=$(check_size "${optarg}")
|
||||
[ -n "size" ] || exit 1
|
||||
sed -i "s/DISK_SIZE=.*/DISK_SIZE=\"${size}\"/" \
|
||||
sed -i "s/DISK_SIZE=.*/DISK_SIZE=\"${optarg}\"/" \
|
||||
${IMAGE_TMPDIR}/disk.cfg
|
||||
;;
|
||||
--disk-device=*)
|
||||
sed -i "s@DISK_DEVICE=.*@DISK_DEVICE=\"${optarg}\"@" \
|
||||
sed -i "s/DISK_DEVICE=.*/DISK_SIZE=\"${optarg}\"/" \
|
||||
${IMAGE_TMPDIR}/disk.cfg
|
||||
;;
|
||||
--disk-add-part=*)
|
||||
|
||||
@@ -31,14 +31,15 @@ case "${XENGUEST_NETWORK_TYPE:-}" in
|
||||
release_lock "vif-nat-kea"
|
||||
exit 0
|
||||
fi
|
||||
log info "Waiting for ${vif_name} - network interface is not ready..."
|
||||
log info "try #${try}"
|
||||
echo "Waiting for ${vif_name} - network interface is not ready..."\
|
||||
" try #${try}" >> "${LOGFILE}" 2>&1
|
||||
sleep 1
|
||||
done
|
||||
log error "Failed to get ${vif_name}. network interface ready!"
|
||||
echo "ERROR: Failed to get ${vif_name} "\
|
||||
"network interface ready!" >> "${LOGFILE}" 2>&1
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
log verbose "No action needed"
|
||||
echo "No action needed" >> "${LOGFILE}" 2>&1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -2,16 +2,6 @@
|
||||
#
|
||||
# xenguest-manager is a tool to control xen guest (e.g. create, start, stop)
|
||||
#
|
||||
# By default xenguest-manager logs to /var/log when in verbose mode, which is a
|
||||
# Volatile directory. To persist logs across reboots the following needs to be
|
||||
# added to either local.conf or distro.conf
|
||||
#
|
||||
# VOLATILE_LOG_DIR="no"
|
||||
#
|
||||
# Read more here: https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-VOLATILE_LOG_DIR
|
||||
#
|
||||
# When this is enabled, logrotate will monitor the file to ensure it does not grow
|
||||
# excessively large. See files/logrotate-xenguest
|
||||
|
||||
DESCRIPTION = "Xen Guest Manager"
|
||||
LICENSE = "MIT"
|
||||
@@ -19,7 +9,6 @@ LICENSE = "MIT"
|
||||
SRC_URI = " \
|
||||
file://xenguest-manager \
|
||||
file://xenguest-init \
|
||||
file://logrotate-xenguest \
|
||||
"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
@@ -28,16 +17,15 @@ S = "${WORKDIR}"
|
||||
# Please refer to documentation/xenguest-manager.md for documentation on those
|
||||
# parameters
|
||||
XENGUEST_MANAGER_VOLUME_DEVICE ?= "/dev/sda2"
|
||||
XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen-$(basename ${XENGUEST_MANAGER_VOLUME_DEVICE})"
|
||||
XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen"
|
||||
XENGUEST_MANAGER_GUEST_DIR ?= "${datadir}/guests/"
|
||||
XENGUEST_MANAGER_LOG_LEVEL ?= "ERROR"
|
||||
|
||||
# We add an init script to create and start guests automatically
|
||||
# run start script after xen-tools and run stop script before xen-tools
|
||||
INITSCRIPT_NAME = "xenguest"
|
||||
INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 79 0 1 6 ."
|
||||
|
||||
inherit allarch update-rc.d
|
||||
inherit update-rc.d
|
||||
|
||||
do_compile() {
|
||||
echo "XENGUEST_VOLUME_DEVICE=\"${XENGUEST_MANAGER_VOLUME_DEVICE}\"" > \
|
||||
@@ -46,8 +34,6 @@ do_compile() {
|
||||
xenguest-manager.conf
|
||||
echo "XENGUEST_GUEST_DIR=\"${XENGUEST_MANAGER_GUEST_DIR}\"" >> \
|
||||
xenguest-manager.conf
|
||||
echo "XENGUEST_LOG_LEVEL=\"${XENGUEST_MANAGER_LOG_LEVEL}\"" >> \
|
||||
xenguest-manager.conf
|
||||
}
|
||||
|
||||
do_install() {
|
||||
@@ -58,13 +44,10 @@ do_install() {
|
||||
install -d -m 755 ${D}${sysconfdir}/init.d
|
||||
install -m 755 xenguest-init ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
|
||||
install -d -m 755 ${D}${XENGUEST_GUEST_DIR}
|
||||
install -d -m 755 ${D}${sysconfdir}/logrotate.d
|
||||
install -m 644 logrotate-xenguest ${D}${sysconfdir}/logrotate.d/xenguest
|
||||
}
|
||||
|
||||
# Things that we need on the target
|
||||
RDEPENDS_${PN} += "bash xenguest-mkimage lvm2 xen-tools parted e2fsprogs \
|
||||
dosfstools logrotate"
|
||||
RDEPENDS_${PN} += "bash tar xenguest-mkimage lvm2 xen-tools parted e2fsprogs dosfstools"
|
||||
|
||||
FILES_${PN} += "${bindir}/xenguest-manager \
|
||||
${sysconfdir}/xenguest"
|
||||
|
||||
@@ -17,8 +17,6 @@ S = "${WORKDIR}"
|
||||
# Can be built native also to produce xenguest images during Yocto build
|
||||
BBCLASSEXTEND = "native"
|
||||
|
||||
inherit allarch
|
||||
|
||||
do_configure[noexec] = "1"
|
||||
do_compile[noexec] = "1"
|
||||
|
||||
@@ -27,7 +25,7 @@ do_install() {
|
||||
install -m 755 xenguest-mkimage ${D}${bindir}/.
|
||||
}
|
||||
|
||||
# We need bash
|
||||
RDEPENDS_${PN} = "bash"
|
||||
# We need bash and tar
|
||||
RDEPENDS_${PN} = "bash tar"
|
||||
FILES_${PN} = "${bindir}/xenguest-mkimage"
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ INITSCRIPT_PARAMS_${PN} = "start 01 2 3 4 5 . stop 81 0 1 6 ."
|
||||
INITSCRIPT_NAME_${PN}-kea-dhcp4 = "kea-restore-default-config"
|
||||
INITSCRIPT_PARAMS_${PN}-kea-dhcp4 = "defaults 20"
|
||||
|
||||
inherit allarch update-rc.d
|
||||
inherit update-rc.d
|
||||
|
||||
do_install() {
|
||||
cat ${WORKDIR}/xenguest-network-bridge.in \
|
||||
|
||||
-1
@@ -5,6 +5,5 @@
|
||||
define KFEATURE_DESCRIPTION "Enable netfilter + conn tracking + extras"
|
||||
define KFEATURE_COMPATIBILITY all
|
||||
|
||||
include cfg/net/bridge.scc
|
||||
include features/netfilter/netfilter.scc
|
||||
kconf non-hardware netfilter-extra.cfg
|
||||
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
From 5a0677110b73dd3e1766f89159701bfe8ac06808 Mon Sep 17 00:00:00 2001
|
||||
From: Masami Hiramatsu <mhiramat@kernel.org>
|
||||
Date: Tue, 6 Oct 2020 15:49:31 +0900
|
||||
Subject: [PATCH] arm/arm64: xen: Fix to convert percpu address to gfn
|
||||
correctly
|
||||
|
||||
Use per_cpu_ptr_to_phys() instead of virt_to_phys() for per-cpu
|
||||
address conversion.
|
||||
|
||||
In xen_starting_cpu(), per-cpu xen_vcpu_info address is converted
|
||||
to gfn by virt_to_gfn() macro. However, since the virt_to_gfn(v)
|
||||
assumes the given virtual address is in linear mapped kernel memory
|
||||
area, it can not convert the per-cpu memory if it is allocated on
|
||||
vmalloc area.
|
||||
|
||||
This depends on CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK.
|
||||
If it is enabled, the first chunk of percpu memory is linear mapped.
|
||||
In the other case, that is allocated from vmalloc area. Moreover,
|
||||
if the first chunk of percpu has run out until allocating
|
||||
xen_vcpu_info, it will be allocated on the 2nd chunk, which is
|
||||
based on kernel memory or vmalloc memory (depends on
|
||||
CONFIG_NEED_PER_CPU_KM).
|
||||
|
||||
Without this fix and kernel configured to use vmalloc area for
|
||||
the percpu memory, the Dom0 kernel will fail to boot with following
|
||||
errors.
|
||||
|
||||
[ 0.466172] Xen: initializing cpu0
|
||||
[ 0.469601] ------------[ cut here ]------------
|
||||
[ 0.474295] WARNING: CPU: 0 PID: 1 at arch/arm64/xen/../../arm/xen/enlighten.c:153 xen_starting_cpu+0x160/0x180
|
||||
[ 0.484435] Modules linked in:
|
||||
[ 0.487565] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc4+ #4
|
||||
[ 0.493895] Hardware name: Socionext Developer Box (DT)
|
||||
[ 0.499194] pstate: 00000005 (nzcv daif -PAN -UAO BTYPE=--)
|
||||
[ 0.504836] pc : xen_starting_cpu+0x160/0x180
|
||||
[ 0.509263] lr : xen_starting_cpu+0xb0/0x180
|
||||
[ 0.513599] sp : ffff8000116cbb60
|
||||
[ 0.516984] x29: ffff8000116cbb60 x28: ffff80000abec000
|
||||
[ 0.522366] x27: 0000000000000000 x26: 0000000000000000
|
||||
[ 0.527754] x25: ffff80001156c000 x24: fffffdffbfcdb600
|
||||
[ 0.533129] x23: 0000000000000000 x22: 0000000000000000
|
||||
[ 0.538511] x21: ffff8000113a99c8 x20: ffff800010fe4f68
|
||||
[ 0.543892] x19: ffff8000113a9988 x18: 0000000000000010
|
||||
[ 0.549274] x17: 0000000094fe0f81 x16: 00000000deadbeef
|
||||
[ 0.554655] x15: ffffffffffffffff x14: 0720072007200720
|
||||
[ 0.560037] x13: 0720072007200720 x12: 0720072007200720
|
||||
[ 0.565418] x11: 0720072007200720 x10: 0720072007200720
|
||||
[ 0.570801] x9 : ffff8000100fbdc0 x8 : ffff800010715208
|
||||
[ 0.576182] x7 : 0000000000000054 x6 : ffff00001b790f00
|
||||
[ 0.581564] x5 : ffff800010bbf880 x4 : 0000000000000000
|
||||
[ 0.586945] x3 : 0000000000000000 x2 : ffff80000abec000
|
||||
[ 0.592327] x1 : 000000000000002f x0 : 0000800000000000
|
||||
[ 0.597716] Call trace:
|
||||
[ 0.600232] xen_starting_cpu+0x160/0x180
|
||||
[ 0.604309] cpuhp_invoke_callback+0xac/0x640
|
||||
[ 0.608736] cpuhp_issue_call+0xf4/0x150
|
||||
[ 0.612728] __cpuhp_setup_state_cpuslocked+0x128/0x2c8
|
||||
[ 0.618030] __cpuhp_setup_state+0x84/0xf8
|
||||
[ 0.622192] xen_guest_init+0x324/0x364
|
||||
[ 0.626097] do_one_initcall+0x54/0x250
|
||||
[ 0.630003] kernel_init_freeable+0x12c/0x2c8
|
||||
[ 0.634428] kernel_init+0x1c/0x128
|
||||
[ 0.637988] ret_from_fork+0x10/0x18
|
||||
[ 0.641635] ---[ end trace d95b5309a33f8b27 ]---
|
||||
[ 0.646337] ------------[ cut here ]------------
|
||||
[ 0.651005] kernel BUG at arch/arm64/xen/../../arm/xen/enlighten.c:158!
|
||||
[ 0.657697] Internal error: Oops - BUG: 0 [#1] SMP
|
||||
[ 0.662548] Modules linked in:
|
||||
[ 0.665676] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 5.9.0-rc4+ #4
|
||||
[ 0.673398] Hardware name: Socionext Developer Box (DT)
|
||||
[ 0.678695] pstate: 00000005 (nzcv daif -PAN -UAO BTYPE=--)
|
||||
[ 0.684338] pc : xen_starting_cpu+0x178/0x180
|
||||
[ 0.688765] lr : xen_starting_cpu+0x144/0x180
|
||||
[ 0.693188] sp : ffff8000116cbb60
|
||||
[ 0.696573] x29: ffff8000116cbb60 x28: ffff80000abec000
|
||||
[ 0.701955] x27: 0000000000000000 x26: 0000000000000000
|
||||
[ 0.707344] x25: ffff80001156c000 x24: fffffdffbfcdb600
|
||||
[ 0.712718] x23: 0000000000000000 x22: 0000000000000000
|
||||
[ 0.718107] x21: ffff8000113a99c8 x20: ffff800010fe4f68
|
||||
[ 0.723481] x19: ffff8000113a9988 x18: 0000000000000010
|
||||
[ 0.728863] x17: 0000000094fe0f81 x16: 00000000deadbeef
|
||||
[ 0.734245] x15: ffffffffffffffff x14: 0720072007200720
|
||||
[ 0.739626] x13: 0720072007200720 x12: 0720072007200720
|
||||
[ 0.745008] x11: 0720072007200720 x10: 0720072007200720
|
||||
[ 0.750390] x9 : ffff8000100fbdc0 x8 : ffff800010715208
|
||||
[ 0.755771] x7 : 0000000000000054 x6 : ffff00001b790f00
|
||||
[ 0.761153] x5 : ffff800010bbf880 x4 : 0000000000000000
|
||||
[ 0.766534] x3 : 0000000000000000 x2 : 00000000deadbeef
|
||||
[ 0.771916] x1 : 00000000deadbeef x0 : ffffffffffffffea
|
||||
[ 0.777304] Call trace:
|
||||
[ 0.779819] xen_starting_cpu+0x178/0x180
|
||||
[ 0.783898] cpuhp_invoke_callback+0xac/0x640
|
||||
[ 0.788325] cpuhp_issue_call+0xf4/0x150
|
||||
[ 0.792317] __cpuhp_setup_state_cpuslocked+0x128/0x2c8
|
||||
[ 0.797619] __cpuhp_setup_state+0x84/0xf8
|
||||
[ 0.801779] xen_guest_init+0x324/0x364
|
||||
[ 0.805683] do_one_initcall+0x54/0x250
|
||||
[ 0.809590] kernel_init_freeable+0x12c/0x2c8
|
||||
[ 0.814016] kernel_init+0x1c/0x128
|
||||
[ 0.817583] ret_from_fork+0x10/0x18
|
||||
[ 0.821226] Code: d0006980 f9427c00 cb000300 17ffffea (d4210000)
|
||||
[ 0.827415] ---[ end trace d95b5309a33f8b28 ]---
|
||||
[ 0.832076] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
|
||||
[ 0.839815] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---
|
||||
|
||||
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
|
||||
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
|
||||
Link: https://lore.kernel.org/r/160196697165.60224.17470743378683334995.stgit@devnote2
|
||||
Signed-off-by: Juergen Gross <jgross@suse.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Richard Neill <richard.neill@arm.com>
|
||||
---
|
||||
arch/arm/xen/enlighten.c | 2 +-
|
||||
include/xen/arm/page.h | 3 +++
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
|
||||
index e93145d72c26..a6ab3689b2f4 100644
|
||||
--- a/arch/arm/xen/enlighten.c
|
||||
+++ b/arch/arm/xen/enlighten.c
|
||||
@@ -150,7 +150,7 @@ static int xen_starting_cpu(unsigned int cpu)
|
||||
pr_info("Xen: initializing cpu%d\n", cpu);
|
||||
vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
|
||||
|
||||
- info.mfn = virt_to_gfn(vcpup);
|
||||
+ info.mfn = percpu_to_gfn(vcpup);
|
||||
info.offset = xen_offset_in_page(vcpup);
|
||||
|
||||
err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, xen_vcpu_nr(cpu),
|
||||
diff --git a/include/xen/arm/page.h b/include/xen/arm/page.h
|
||||
index 39df751d0dc4..ac1b65470563 100644
|
||||
--- a/include/xen/arm/page.h
|
||||
+++ b/include/xen/arm/page.h
|
||||
@@ -83,6 +83,9 @@ static inline unsigned long bfn_to_pfn(unsigned long bfn)
|
||||
})
|
||||
#define gfn_to_virt(m) (__va(gfn_to_pfn(m) << XEN_PAGE_SHIFT))
|
||||
|
||||
+#define percpu_to_gfn(v) \
|
||||
+ (pfn_to_gfn(per_cpu_ptr_to_phys(v) >> XEN_PAGE_SHIFT))
|
||||
+
|
||||
/* Only used in PV code. But ARM guests are always HVM. */
|
||||
static inline xmaddr_t arbitrary_virt_to_machine(void *vaddr)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
From 18d691d837b340c941ad778bc8dfa77446e48bb4 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <18d691d837b340c941ad778bc8dfa77446e48bb4.1613579395.git.diego.sueiro@arm.com>
|
||||
From: Julien Grall <jgrall@amazon.com>
|
||||
Date: Wed, 10 Feb 2021 17:06:54 +0000
|
||||
Subject: [PATCH] arm/xen: Don't probe xenbus as part of an early initcall
|
||||
|
||||
commit c4295ab0b485b8bc50d2264bcae2acd06f25caaf upstream.
|
||||
|
||||
After Commit 3499ba8198cad ("xen: Fix event channel callback via
|
||||
INTX/GSI"), xenbus_probe() will be called too early on Arm. This will
|
||||
recent to a guest hang during boot.
|
||||
|
||||
If the hang wasn't there, we would have ended up to call
|
||||
xenbus_probe() twice (the second time is in xenbus_probe_initcall()).
|
||||
|
||||
We don't need to initialize xenbus_probe() early for Arm guest.
|
||||
Therefore, the call in xen_guest_init() is now removed.
|
||||
|
||||
After this change, there is no more external caller for xenbus_probe().
|
||||
So the function is turned to a static one. Interestingly there were two
|
||||
prototypes for it.
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Fixes: 3499ba8198cad ("xen: Fix event channel callback via INTX/GSI")
|
||||
Reported-by: Ian Jackson <iwj@xenproject.org>
|
||||
Signed-off-by: Julien Grall <jgrall@amazon.com>
|
||||
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
|
||||
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20210210170654.5377-1-julien@xen.org
|
||||
Signed-off-by: Juergen Gross <jgross@suse.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||
---
|
||||
arch/arm/xen/enlighten.c | 2 --
|
||||
drivers/xen/xenbus/xenbus.h | 1 -
|
||||
drivers/xen/xenbus/xenbus_probe.c | 2 +-
|
||||
include/xen/xenbus.h | 2 --
|
||||
4 files changed, 1 insertion(+), 6 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
|
||||
index f45bff158fc2..57dfc13b2752 100644
|
||||
--- a/arch/arm/xen/enlighten.c
|
||||
+++ b/arch/arm/xen/enlighten.c
|
||||
@@ -370,8 +370,6 @@ static int __init xen_guest_init(void)
|
||||
return -ENOMEM;
|
||||
}
|
||||
gnttab_init();
|
||||
- if (!xen_initial_domain())
|
||||
- xenbus_probe();
|
||||
|
||||
/*
|
||||
* Making sure board specific code will not set up ops for
|
||||
diff --git a/drivers/xen/xenbus/xenbus.h b/drivers/xen/xenbus/xenbus.h
|
||||
index a9bb5f91082d..88516a8a9f93 100644
|
||||
--- a/drivers/xen/xenbus/xenbus.h
|
||||
+++ b/drivers/xen/xenbus/xenbus.h
|
||||
@@ -115,7 +115,6 @@ int xenbus_probe_node(struct xen_bus_type *bus,
|
||||
const char *type,
|
||||
const char *nodename);
|
||||
int xenbus_probe_devices(struct xen_bus_type *bus);
|
||||
-void xenbus_probe(void);
|
||||
|
||||
void xenbus_dev_changed(const char *node, struct xen_bus_type *bus);
|
||||
|
||||
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
|
||||
index 786494bb7f20..652894d61967 100644
|
||||
--- a/drivers/xen/xenbus/xenbus_probe.c
|
||||
+++ b/drivers/xen/xenbus/xenbus_probe.c
|
||||
@@ -683,7 +683,7 @@ void unregister_xenstore_notifier(struct notifier_block *nb)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(unregister_xenstore_notifier);
|
||||
|
||||
-void xenbus_probe(void)
|
||||
+static void xenbus_probe(void)
|
||||
{
|
||||
xenstored_ready = 1;
|
||||
|
||||
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
|
||||
index fe9a9fa2ebc4..14d47ed4114f 100644
|
||||
--- a/include/xen/xenbus.h
|
||||
+++ b/include/xen/xenbus.h
|
||||
@@ -187,8 +187,6 @@ void xs_suspend_cancel(void);
|
||||
|
||||
struct work_struct;
|
||||
|
||||
-void xenbus_probe(void);
|
||||
-
|
||||
#define XENBUS_IS_ERR_READ(str) ({ \
|
||||
if (!IS_ERR(str) && strlen(str) == 0) { \
|
||||
kfree(str); \
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -38,6 +38,17 @@ python() {
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
kernelVersion = d.getVar('LINUX_VERSION')
|
||||
pn = d.getVar('PN')
|
||||
|
||||
if kernelVersion and LooseVersion(kernelVersion) < '5.4.99' \
|
||||
and pn != 'linux-libc-headers' \
|
||||
and oe.utils.any_distro_features(d, "arm-autonomy-guest"):
|
||||
d.appendVar('SRC_URI', ' file://files/0001-arm-xen-Don-t-probe-xenbus-as-part-of-an-early-initc.patch' )
|
||||
|
||||
if kernelVersion and LooseVersion(kernelVersion) < '5.9' \
|
||||
and pn != 'linux-libc-headers' \
|
||||
and oe.utils.any_distro_features(d, "arm-autonomy-host arm-autonomy-guest"):
|
||||
d.appendVar('SRC_URI', ' file://files/0001-arm-arm64-xen-Fix-to-convert-percpu-address-to-gfn-c.patch' )
|
||||
|
||||
if kernelVersion and LooseVersion(kernelVersion) < '5.10':
|
||||
if oe.utils.any_distro_features(d, "arm-autonomy-host arm-autonomy-guest"):
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
# The empty wic plugin is used to create unformatted empty partitions for wic
|
||||
# images.
|
||||
# To use it you must pass "empty" as argument for the "--source" parameter in
|
||||
# the wks file. For example:
|
||||
# part foo --source empty --ondisk sda --size="1024" --align 1024
|
||||
|
||||
import logging
|
||||
|
||||
from wic.pluginbase import SourcePlugin
|
||||
|
||||
logger = logging.getLogger('wic')
|
||||
|
||||
class EmptyPartitionPlugin(SourcePlugin):
|
||||
"""
|
||||
Populate unformatted empty partition.
|
||||
"""
|
||||
|
||||
name = 'empty'
|
||||
|
||||
@classmethod
|
||||
def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
|
||||
oe_builddir, bootimg_dir, kernel_dir,
|
||||
rootfs_dir, native_sysroot):
|
||||
"""
|
||||
Called to do the actual content population for a partition i.e. it
|
||||
'prepares' the partition to be incorporated into the image.
|
||||
"""
|
||||
return
|
||||
@@ -7,7 +7,7 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
|
||||
|
||||
BBFILE_COLLECTIONS += "meta-arm-bsp"
|
||||
BBFILE_PATTERN_meta-arm-bsp = "^${LAYERDIR}/"
|
||||
BBFILE_PRIORITY_meta-arm-bsp = "5"
|
||||
BBFILE_PRIORITY_meta-arm-bsp = "6"
|
||||
|
||||
LAYERSERIES_COMPAT_meta-arm-bsp = "gatesgarth"
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# Configuration for Cortex-A5 DesignStart development board
|
||||
|
||||
#@TYPE: Machine
|
||||
#@NAME: a5ds machine
|
||||
#@DESCRIPTION: Machine configuration for Cortex-A5 DesignStart
|
||||
|
||||
require conf/machine/include/tune-cortexa5.inc
|
||||
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.3%"
|
||||
KBUILD_DEFCONFIG = "multi_v7_defconfig"
|
||||
KCONFIG_MODE = "--alldefconfig"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
|
||||
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
IMAGE_FSTYPES += "tar.bz2 cpio.gz"
|
||||
|
||||
# Cortex-a5 u-boot configuration
|
||||
UBOOT_MACHINE = "designstart_ca5_defconfig"
|
||||
UBOOT_IMAGE_ENTRYPOINT = "0x84000000"
|
||||
UBOOT_IMAGE_LOADADDRESS = "0x84000000"
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#@TYPE: Machine
|
||||
#@NAME: Corstone-500 machine
|
||||
#@DESCRIPTION: Machine configuration for the Corstone-500 platform
|
||||
|
||||
require conf/machine/include/tune-cortexa5.inc
|
||||
|
||||
#
|
||||
# Corstone-500 is built against poky-tiny distro.
|
||||
# poky-tiny sets PREFERRED_PROVIDER_virtual/kernel to linux-yocto-tiny.
|
||||
# Since distro config is evaluated after the machine config, we need to
|
||||
# use the strongest override possible (forcevariable) so the
|
||||
# PREFERRED_PROVIDER_virtual/kernel specified in the machine config will
|
||||
# apply.
|
||||
#
|
||||
PREFERRED_PROVIDER_virtual/kernel_forcevariable = "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.3%"
|
||||
KBUILD_DEFCONFIG = "multi_v7_defconfig"
|
||||
KCONFIG_MODE = "--alldefconfig"
|
||||
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
|
||||
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
IMAGE_FSTYPES += "tar.bz2 cpio.gz"
|
||||
|
||||
# Corstone-500 u-boot configuration
|
||||
UBOOT_MACHINE = "designstart_ca5_defconfig"
|
||||
UBOOT_IMAGE_ENTRYPOINT = "0x84000000"
|
||||
UBOOT_IMAGE_LOADADDRESS = "0x84000000"
|
||||
PREFERRED_VERSION_u-boot ?= "2020.07"
|
||||
@@ -0,0 +1,17 @@
|
||||
# Configuration for Armv8-A Foundation
|
||||
|
||||
#@TYPE: Machine
|
||||
#@NAME: Armv8-A Foundation Platform machine
|
||||
#@DESCRIPTION: Machine configuration for Armv8-A Foundation Platform model
|
||||
|
||||
require conf/machine/fvp-common.inc
|
||||
require conf/machine/include/arm/arch-armv8a.inc
|
||||
|
||||
TUNE_FEATURES = "aarch64"
|
||||
|
||||
# FVP u-boot configuration
|
||||
UBOOT_MACHINE = "vexpress_aemv8a_semi_defconfig"
|
||||
|
||||
KERNEL_IMAGETYPE = "Image"
|
||||
|
||||
KERNEL_DEVICETREE = "arm/foundation-v8-gicv3-psci.dtb"
|
||||
@@ -9,6 +9,8 @@ require conf/machine/include/arm/arch-armv7a.inc
|
||||
|
||||
KERNEL_IMAGETYPE = "zImage"
|
||||
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.2%"
|
||||
|
||||
# FVP u-boot configuration
|
||||
UBOOT_MACHINE = "vexpress_aemv8a_aarch32_defconfig"
|
||||
|
||||
|
||||
@@ -29,10 +29,7 @@ DISK_IMG_PARTITION3_CONTENT = ""
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.10%"
|
||||
|
||||
PREFERRED_VERSION_u-boot ?= "2020.10"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ PREFERRED_VERSION_linux-yocto ?= "5.6%"
|
||||
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/control-processor-firmware ?= "boot-firmware"
|
||||
PREFERRED_PROVIDER_virtual/control-processor-firmware ?= "scp-firmware"
|
||||
PREFERRED_VERSION_control-processor-firmware ?= "2.6.0"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += " \
|
||||
virtual/trusted-firmware-a \
|
||||
|
||||
@@ -10,21 +10,22 @@ require conf/machine/include/arm/arch-armv8a.inc
|
||||
|
||||
MACHINE_FEATURES = "usbhost usbgadget alsa screen wifi bluetooth optee pci"
|
||||
|
||||
KERNEL_IMAGETYPE = "Image"
|
||||
KERNEL_IMAGETYPE = "Image.gz"
|
||||
KERNEL_DEVICETREE = "arm/juno.dtb arm/juno-r1.dtb arm/juno-r2.dtb"
|
||||
|
||||
IMAGE_FSTYPES += "tar.bz2 ext4"
|
||||
IMAGE_FSTYPES += "tar.bz2 ext4 cpio.gz"
|
||||
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
# Use kernel provided by yocto
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
||||
PREFERRED_VERSION_scp-firmware ?= "2.6%"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
||||
PREFERRED_VERSION_u-boot ?= "2020.07"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot firmware-image-juno"
|
||||
|
||||
# Juno u-boot configuration
|
||||
UBOOT_MACHINE = "vexpress_aemv8a_juno_defconfig"
|
||||
|
||||
INITRAMFS_IMAGE_BUNDLE ?= "1"
|
||||
INITRAMFS_IMAGE = "core-image-minimal"
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#@NAME: Musca-B1 machine
|
||||
#@DESCRIPTION: Machine configuration for Musca-B1
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m"
|
||||
PREFERRED_VERSION_trusted-firmware-m = "1.0"
|
||||
|
||||
DEFAULTTUNE ?= "armv8m-main"
|
||||
require conf/machine/include/tune-cortexm33.inc
|
||||
|
||||
@@ -11,8 +14,7 @@ require conf/machine/include/tune-cortexm33.inc
|
||||
TCLIBC = "newlib"
|
||||
|
||||
# For runqemu
|
||||
IMAGE_FSTYPES += "ext4"
|
||||
IMAGE_CLASSES += "qemuboot"
|
||||
require conf/machine/include/qemu.inc
|
||||
QB_SYSTEM_NAME = "qemu-system-arm"
|
||||
QB_MACHINE = "-machine musca-b1"
|
||||
QB_CPU = "-cpu cortex-m33"
|
||||
@@ -23,5 +25,3 @@ QB_MEM = "512k"
|
||||
ZEPHYR_BOARD = "v2m_musca_b1"
|
||||
ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
|
||||
ARCH_musca-b1 = "arm"
|
||||
|
||||
TFM_PLATFORM = "MUSCA_B1"
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
#@NAME: Musca-S1 machine
|
||||
#@DESCRIPTION: Machine configuration for Musca-S1
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m"
|
||||
PREFERRED_VERSION_trusted-firmware-m = "1.0"
|
||||
|
||||
require conf/machine/include/tune-cortexm33.inc
|
||||
|
||||
# GLIBC will not work with Cortex-M.
|
||||
TCLIBC = "newlib"
|
||||
|
||||
TFM_PLATFORM = "MUSCA_S1"
|
||||
|
||||
@@ -8,7 +8,7 @@ require conf/machine/include/tune-neoversen1.inc
|
||||
|
||||
KERNEL_IMAGETYPE = "Image"
|
||||
|
||||
IMAGE_FSTYPES += "wic wic.gz wic.bmap tar.bz2 ext4"
|
||||
IMAGE_FSTYPES += "wic tar.bz2 ext4"
|
||||
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
@@ -17,23 +17,22 @@ WKS_FILE ?= "n1sdp-efidisk.wks"
|
||||
IMAGE_EFI_BOOT_FILES ?= "n1sdp-multi-chip.dtb n1sdp-single-chip.dtb"
|
||||
WKS_FILE_DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}"
|
||||
|
||||
# Use kernel provided by yocto
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.10%"
|
||||
# Use kernel provided by linaro (Contains support for SCMi or HDMI)
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-linaro-arm"
|
||||
PREFERRED_VERSION_linux-linaro-arm ?= "5.4%"
|
||||
|
||||
# RTL8168E Gigabit Ethernet Controller is attached to the PCIe interface
|
||||
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "linux-firmware-rtl8168"
|
||||
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||
# Trusted firmware v2.3 version
|
||||
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
|
||||
EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware"
|
||||
|
||||
PREFERRED_VERSION_scp-firmware ?= "2.7%"
|
||||
|
||||
#UEFI EDK2 firmware
|
||||
EXTRA_IMAGEDEPENDS += "virtual/uefi-firmware"
|
||||
PREFERRED_VERSION_edk2-firmware ?= "201911%"
|
||||
|
||||
#grub-efi
|
||||
EFI_PROVIDER ?= "grub-efi"
|
||||
|
||||
@@ -21,8 +21,6 @@ PREFERRED_VERSION_linux-yocto ?= "5.7%"
|
||||
KCONFIG_MODE = "--alldefconfig"
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
PREFERRED_VERSION_edk2-firmware ?= "202011%"
|
||||
|
||||
#grub-efi
|
||||
EFI_PROVIDER ?= "grub-efi"
|
||||
MACHINE_FEATURES += "efi"
|
||||
|
||||
@@ -10,34 +10,19 @@ require conf/machine/include/arm/arch-armv8a.inc
|
||||
|
||||
# Das U-boot
|
||||
UBOOT_MACHINE ?= "total_compute_defconfig"
|
||||
PREFERRED_VERSION_u-boot ?= "2020.10"
|
||||
UBOOT_RD_LOADADDRESS = "0x88000000"
|
||||
UBOOT_RD_ENTRYPOINT = "0x88000000"
|
||||
UBOOT_LOADADDRESS = "0x80080000"
|
||||
UBOOT_ENTRYPOINT = "0x80080000"
|
||||
# Below options will generate a key to sign the kernel Image and INITRAMFS_IMAGE
|
||||
# according to the default parameters of kernel-fitimage.bbclass. If the user
|
||||
# would prefer to use their own keys, disable the key generation using the
|
||||
# FIT_GENERATE_KEYS parameter and specify the location of the keys using the
|
||||
# below paramters.
|
||||
UBOOT_SIGN_ENABLE = "1"
|
||||
UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb"
|
||||
UBOOT_SIGN_KEYNAME = "dev_key"
|
||||
UBOOT_SIGN_KEYDIR = "${DEPLOY_DIR_IMAGE}/keys"
|
||||
FIT_GENERATE_KEYS = "1"
|
||||
|
||||
# Trusted firmware A v2.3
|
||||
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
||||
PREFERRED_VERSION_linux-arm64-ack ?= "5.4"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-arm64-ack"
|
||||
|
||||
# Cannot use the default zImage on arm64
|
||||
KERNEL_IMAGETYPE = "Image"
|
||||
KERNEL_IMAGETYPES += "fitImage"
|
||||
KERNEL_CLASSES = " kernel-fitimage "
|
||||
|
||||
IMAGE_FSTYPES += "cpio.gz"
|
||||
INITRAMFS_IMAGE ?= "core-image-minimal"
|
||||
KERNEL_BOOTCMD = "booti"
|
||||
IMAGE_FSTYPES += "cpio.gz.u-boot"
|
||||
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# Corstone-500 Platform Support in meta-arm-bsp
|
||||
# Cortex-A5 DesignStart A5DS Platform Support in meta-arm-bsp
|
||||
|
||||
## Howto Build and Run
|
||||
|
||||
### Configuration:
|
||||
In the local.conf file, MACHINE should be set as follow:
|
||||
MACHINE ?= "corstone500"
|
||||
DISTRO ?= "poky-tiny"
|
||||
MACHINE ?= "a5ds"
|
||||
DISTRO ?= "iota-tiny"
|
||||
|
||||
Or set environment variables with that values:
|
||||
|
||||
MACHINE "corstone500"
|
||||
DISTRO "poky-tiny"
|
||||
MACHINE "a5ds"
|
||||
DISTRO "iota-tiny"
|
||||
|
||||
### Build:
|
||||
``bash$ bitbake arm-reference-image```
|
||||
``bash$ bitbake iota-tiny-image```
|
||||
|
||||
### Run:
|
||||
To run the result in a Fixed Virtual Platform please get:
|
||||
@@ -0,0 +1,51 @@
|
||||
# Armv8-A Base Platform Support in meta-arm-bsp
|
||||
|
||||
## Howto Build and Run
|
||||
|
||||
### Configuration:
|
||||
In the local.conf file, MACHINE should be set as follow:
|
||||
MACHINE ?= "foundation-armv8"
|
||||
|
||||
### Build:
|
||||
```bash$ bitbake core-image-minimal```
|
||||
|
||||
### Run:
|
||||
To Run the Fixed Virtual Platform simulation tool you must download "Armv8-A
|
||||
Foundation Platform" from Arm developer (This might require the user to
|
||||
register) from this address:
|
||||
https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
|
||||
and install it on your host PC.
|
||||
|
||||
Fast Models Fixed Virtual Platforms (FVP) Reference Guide:
|
||||
https://developer.arm.com/docs/100966/latest
|
||||
|
||||
Armv8‑A Foundation Platform User Guide:
|
||||
https://developer.arm.com/docs/100961/latest/
|
||||
|
||||
|
||||
Once done, do the following to build and run an image:
|
||||
```bash$ bitbake core-image-minimal```
|
||||
```bash$ export YOCTO_DEPLOY_IMGS_DIR="<yocto-build-dir/tmp/deploy/images/foundation-v8>"```
|
||||
```bash$ cd <path-to-Foundation_Platformpkg-dir/models/Linux64_GCC-X.X/>```
|
||||
```
|
||||
bash$ ./Foundation_Platform --cores=4 --no-sve --gicv3 \
|
||||
--data=${YOCTO_DEPLOY_IMGS_DIR}/bl1-fvp.bin@0x0 \
|
||||
--data=${YOCTO_DEPLOY_IMGS_DIR}/fip-fvp.bin@0x8000000 \
|
||||
--data=${YOCTO_DEPLOY_IMGS_DIR}/Image@0x80080000 \
|
||||
--data=${YOCTO_DEPLOY_IMGS_DIR}/foundation-v8-gicv3-psci.dtb@0x83000000 \
|
||||
--block-device=${YOCTO_DEPLOY_IMGS_DIR}/core-image-minimal-foundation-armv8.disk.img
|
||||
```
|
||||
|
||||
If you have built a configuration without a ramdisk, you can use the following
|
||||
command in U-boot to start Linux:
|
||||
```VExpress64# booti 0x80080000 - 0x83000000```
|
||||
|
||||
## Devices supported in the kernel
|
||||
- serial
|
||||
- virtio disk
|
||||
- network
|
||||
- watchdog
|
||||
- rtc
|
||||
|
||||
## Devices not supported or not functional
|
||||
None
|
||||
@@ -15,12 +15,9 @@ https://git.linaro.org/landing-teams/working/arm/arm-reference-platforms.git/tre
|
||||
In the local.conf file, MACHINE should be set as follows:
|
||||
MACHINE = "tc0"
|
||||
|
||||
To build the required binaries for tc0, run the commmand:
|
||||
```bash$ bitbake tc0-artifacts-image```
|
||||
|
||||
Trusted-firmware-a is the final component to be built with the rest of the
|
||||
components dependent of it, therefore building tc0-artifacts-image which depends
|
||||
on trusted-firmware-a will build all the required binaries.
|
||||
To build the required binaries for tc0, run the commmand for the required image,
|
||||
for e.g for core-image-minimal:
|
||||
```bash$ bitbake core-image-minimal```
|
||||
|
||||
## Running
|
||||
To run the produced binaries in a TC0 Fixed Virtual Platform please get
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
SUMMARY = "Boot Processor firmware for Corstone700"
|
||||
DESCRIPTION = "Boot Processor firmware"
|
||||
|
||||
LICENSE = "BSD-3-Clause & Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://license.md;md5=e44b2531cd6ffe9dece394dbe988d9a0 \
|
||||
file://cmsis/LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
|
||||
SRC_URI = "gitsm://git.linaro.org/landing-teams/working/arm/boot-firmware.git;protocol=https"
|
||||
SRCREV = "af7eeb1bb8c5a85a5e5a76d48acc6fe864d715a9"
|
||||
PV = "2020.02.10+git${SRCPV}"
|
||||
|
||||
PROVIDES += "virtual/control-processor-firmware"
|
||||
|
||||
DEPENDS = "virtual/arm-none-eabi-gcc-native virtual/trusted-firmware-a"
|
||||
|
||||
inherit deploy
|
||||
|
||||
B = "${WORKDIR}/build"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
COMPATIBLE_MACHINE = "(corstone700-*)"
|
||||
SCP_PLATFORM = "corstone-700"
|
||||
|
||||
LDFLAGS[unexport] = "1"
|
||||
|
||||
do_configure[noexec] = "1"
|
||||
|
||||
EXTRA_OEMAKE = "PRODUCT='${SCP_PLATFORM}' \
|
||||
BUILD_PATH=${B} \
|
||||
CROSS_COMPILE='arm-none-eabi-' \
|
||||
V=y \
|
||||
"
|
||||
|
||||
do_compile() {
|
||||
oe_runmake -C ${S}/tools/spitoc CC=${BUILD_CC} all
|
||||
oe_runmake -C ${S}
|
||||
}
|
||||
do_compile[cleandirs] += "${B}"
|
||||
|
||||
do_install() {
|
||||
install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_ramfw/release/bin/firmware.bin ${D}/firmware/se_ramfw.bin
|
||||
install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_romfw/release/bin/firmware.bin ${D}/firmware/se_romfw.bin
|
||||
${S}/tools/spitoc/spitoc \
|
||||
--seram ${D}/firmware/se_ramfw.bin \
|
||||
--offset 1 \
|
||||
--fip ${RECIPE_SYSROOT}/firmware/fip.bin-${TFA_PLATFORM} \
|
||||
--offset 33 \
|
||||
--out ${D}/firmware/spitoc.bin
|
||||
}
|
||||
|
||||
FILES_${PN} = "/firmware"
|
||||
SYSROOT_DIRS += "/firmware"
|
||||
# Skip QA check for relocations in .text of elf binaries
|
||||
INSANE_SKIP_${PN} = "textrel"
|
||||
|
||||
do_deploy() {
|
||||
# Copy the images to deploy directory
|
||||
cp -rf ${D}/firmware/* ${DEPLOYDIR}/
|
||||
}
|
||||
addtask deploy after do_install
|
||||
-256
@@ -1,256 +0,0 @@
|
||||
From 7a8b0d634b23e77bb6c84f1b34c5cc031aa8c105 Mon Sep 17 00:00:00 2001
|
||||
From: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
Date: Mon, 12 Apr 2021 10:08:29 +0100
|
||||
Subject: [PATCH 1/3] Revert "FFA: Set and verify allocator of memory handle"
|
||||
|
||||
This reverts commit 917d2f2dc46b20625156e9067329e04c7fec587d.
|
||||
Reverting this commit enables memory sharing between SPs
|
||||
|
||||
Upstream-Status: Inappropriate [will not be submitted as its only required for ACK 5.4]
|
||||
---
|
||||
inc/hf/arch/ffa_memory_handle.h | 25 ----------------
|
||||
inc/vmapi/hf/ffa.h | 14 ++++-----
|
||||
src/api.c | 4 +--
|
||||
src/arch/aarch64/hypervisor/BUILD.gn | 1 -
|
||||
.../aarch64/hypervisor/ffa_memory_handle.c | 29 -------------------
|
||||
src/arch/fake/hypervisor/BUILD.gn | 1 -
|
||||
src/arch/fake/hypervisor/ffa_memory_handle.c | 20 -------------
|
||||
src/ffa_memory.c | 19 ++++--------
|
||||
8 files changed, 14 insertions(+), 99 deletions(-)
|
||||
delete mode 100644 inc/hf/arch/ffa_memory_handle.h
|
||||
delete mode 100644 src/arch/aarch64/hypervisor/ffa_memory_handle.c
|
||||
delete mode 100644 src/arch/fake/hypervisor/ffa_memory_handle.c
|
||||
|
||||
diff --git a/inc/hf/arch/ffa_memory_handle.h b/inc/hf/arch/ffa_memory_handle.h
|
||||
deleted file mode 100644
|
||||
index 9eba5d4..0000000
|
||||
--- a/inc/hf/arch/ffa_memory_handle.h
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-/*
|
||||
- * Copyright 2021 The Hafnium Authors.
|
||||
- *
|
||||
- * Use of this source code is governed by a BSD-style
|
||||
- * license that can be found in the LICENSE file or at
|
||||
- * https://opensource.org/licenses/BSD-3-Clause.
|
||||
- */
|
||||
-
|
||||
-#ifndef FFA_MEMORY_HANDLE_H
|
||||
-#define FFA_MEMORY_HANDLE_H
|
||||
-
|
||||
-#include "hf/ffa.h"
|
||||
-
|
||||
-/**
|
||||
- * Encodes memory handle according to section 5.10.2 of the FF-A v1.0 spec.
|
||||
- */
|
||||
-ffa_memory_handle_t ffa_memory_handle_make(uint64_t index);
|
||||
-
|
||||
-/**
|
||||
- * Checks whether given handle was allocated by current world, according to
|
||||
- * handle encoding rules.
|
||||
- */
|
||||
-bool ffa_memory_handle_allocated_by_current_world(ffa_memory_handle_t handle);
|
||||
-
|
||||
-#endif
|
||||
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
|
||||
index a79f2eb..a948930 100644
|
||||
--- a/inc/vmapi/hf/ffa.h
|
||||
+++ b/inc/vmapi/hf/ffa.h
|
||||
@@ -189,23 +189,21 @@ ATTR_FUNCTION_SET(memory_shareability, ffa_memory_attributes_t,
|
||||
ATTR_FUNCTION_GET(memory_shareability, ffa_memory_attributes_t,
|
||||
FFA_MEMORY_SHAREABILITY_OFFSET, FFA_MEMORY_SHAREABILITY_MASK)
|
||||
|
||||
-/**
|
||||
- * A globally-unique ID assigned by the hypervisor for a region of memory being
|
||||
- * sent between VMs.
|
||||
- */
|
||||
-typedef uint64_t ffa_memory_handle_t;
|
||||
-
|
||||
#define FFA_MEMORY_HANDLE_ALLOCATOR_MASK \
|
||||
((ffa_memory_handle_t)(UINT64_C(1) << 63))
|
||||
#define FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR \
|
||||
((ffa_memory_handle_t)(UINT64_C(1) << 63))
|
||||
-
|
||||
-#define FFA_MEMORY_HANDLE_ALLOCATOR_SPMC (UINT64_C(0) << 63)
|
||||
#define FFA_MEMORY_HANDLE_INVALID (~UINT64_C(0))
|
||||
|
||||
/** The ID of a VM. These are assigned sequentially starting with an offset. */
|
||||
typedef uint16_t ffa_vm_id_t;
|
||||
|
||||
+/**
|
||||
+ * A globally-unique ID assigned by the hypervisor for a region of memory being
|
||||
+ * sent between VMs.
|
||||
+ */
|
||||
+typedef uint64_t ffa_memory_handle_t;
|
||||
+
|
||||
/**
|
||||
* A count of VMs. This has the same range as the VM IDs but we give it a
|
||||
* different name to make the different semantics clear.
|
||||
diff --git a/src/api.c b/src/api.c
|
||||
index fa5c9b7..16626b6 100644
|
||||
--- a/src/api.c
|
||||
+++ b/src/api.c
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "hf/api.h"
|
||||
|
||||
#include "hf/arch/cpu.h"
|
||||
-#include "hf/arch/ffa_memory_handle.h"
|
||||
#include "hf/arch/mm.h"
|
||||
#include "hf/arch/other_world.h"
|
||||
#include "hf/arch/timer.h"
|
||||
@@ -2158,7 +2157,8 @@ struct ffa_value api_ffa_mem_reclaim(ffa_memory_handle_t handle,
|
||||
struct vm *to = current->vm;
|
||||
struct ffa_value ret;
|
||||
|
||||
- if (ffa_memory_handle_allocated_by_current_world(handle)) {
|
||||
+ if ((handle & FFA_MEMORY_HANDLE_ALLOCATOR_MASK) ==
|
||||
+ FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR) {
|
||||
struct vm_locked to_locked = vm_lock(to);
|
||||
|
||||
ret = ffa_memory_reclaim(to_locked, handle, flags,
|
||||
diff --git a/src/arch/aarch64/hypervisor/BUILD.gn b/src/arch/aarch64/hypervisor/BUILD.gn
|
||||
index 8f57598..0f9c15e 100644
|
||||
--- a/src/arch/aarch64/hypervisor/BUILD.gn
|
||||
+++ b/src/arch/aarch64/hypervisor/BUILD.gn
|
||||
@@ -17,7 +17,6 @@ offset_size_header("offsets") {
|
||||
source_set("other_world") {
|
||||
public_configs = [ "//src/arch/aarch64:config" ]
|
||||
sources = [
|
||||
- "ffa_memory_handle.c",
|
||||
"other_world.c",
|
||||
]
|
||||
deps = [
|
||||
diff --git a/src/arch/aarch64/hypervisor/ffa_memory_handle.c b/src/arch/aarch64/hypervisor/ffa_memory_handle.c
|
||||
deleted file mode 100644
|
||||
index 647186d..0000000
|
||||
--- a/src/arch/aarch64/hypervisor/ffa_memory_handle.c
|
||||
+++ /dev/null
|
||||
@@ -1,29 +0,0 @@
|
||||
-/*
|
||||
- * Copyright 2021 The Hafnium Authors.
|
||||
- *
|
||||
- * Use of this source code is governed by a BSD-style
|
||||
- * license that can be found in the LICENSE file or at
|
||||
- * https://opensource.org/licenses/BSD-3-Clause.
|
||||
- */
|
||||
-
|
||||
-#include "hf/arch/ffa_memory_handle.h"
|
||||
-
|
||||
-ffa_memory_handle_t ffa_memory_handle_make(uint64_t index)
|
||||
-{
|
||||
-#if SECURE_WORLD == 1
|
||||
- return (index & ~FFA_MEMORY_HANDLE_ALLOCATOR_MASK) |
|
||||
- FFA_MEMORY_HANDLE_ALLOCATOR_SPMC;
|
||||
-#else
|
||||
- return index | FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR;
|
||||
-#endif
|
||||
-}
|
||||
-
|
||||
-bool ffa_memory_handle_allocated_by_current_world(ffa_memory_handle_t handle)
|
||||
-{
|
||||
- return (handle & FFA_MEMORY_HANDLE_ALLOCATOR_MASK) ==
|
||||
-#if SECURE_WORLD == 1
|
||||
- FFA_MEMORY_HANDLE_ALLOCATOR_SPMC;
|
||||
-#else
|
||||
- FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR;
|
||||
-#endif
|
||||
-}
|
||||
diff --git a/src/arch/fake/hypervisor/BUILD.gn b/src/arch/fake/hypervisor/BUILD.gn
|
||||
index 8f28802..97a82f6 100644
|
||||
--- a/src/arch/fake/hypervisor/BUILD.gn
|
||||
+++ b/src/arch/fake/hypervisor/BUILD.gn
|
||||
@@ -16,7 +16,6 @@ source_set("hypervisor") {
|
||||
|
||||
source_set("other_world") {
|
||||
sources = [
|
||||
- "ffa_memory_handle.c",
|
||||
"other_world.c",
|
||||
]
|
||||
}
|
||||
diff --git a/src/arch/fake/hypervisor/ffa_memory_handle.c b/src/arch/fake/hypervisor/ffa_memory_handle.c
|
||||
deleted file mode 100644
|
||||
index 9091295..0000000
|
||||
--- a/src/arch/fake/hypervisor/ffa_memory_handle.c
|
||||
+++ /dev/null
|
||||
@@ -1,20 +0,0 @@
|
||||
-/*
|
||||
- * Copyright 2021 The Hafnium Authors.
|
||||
- *
|
||||
- * Use of this source code is governed by a BSD-style
|
||||
- * license that can be found in the LICENSE file or at
|
||||
- * https://opensource.org/licenses/BSD-3-Clause.
|
||||
- */
|
||||
-
|
||||
-#include "hf/arch/ffa_memory_handle.h"
|
||||
-
|
||||
-ffa_memory_handle_t ffa_memory_handle_make(uint64_t index)
|
||||
-{
|
||||
- return index;
|
||||
-}
|
||||
-
|
||||
-bool ffa_memory_handle_allocated_by_current_world(ffa_memory_handle_t handle)
|
||||
-{
|
||||
- (void)handle;
|
||||
- return true;
|
||||
-}
|
||||
diff --git a/src/ffa_memory.c b/src/ffa_memory.c
|
||||
index 8b28191..00ec68c 100644
|
||||
--- a/src/ffa_memory.c
|
||||
+++ b/src/ffa_memory.c
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "hf/ffa_memory.h"
|
||||
|
||||
-#include "hf/arch/ffa_memory_handle.h"
|
||||
#include "hf/arch/other_world.h"
|
||||
|
||||
#include "hf/api.h"
|
||||
@@ -121,14 +120,6 @@ static struct ffa_memory_share_state share_states[MAX_MEM_SHARES];
|
||||
alignas(PAGE_SIZE) static uint8_t
|
||||
tee_retrieve_buffer[HF_MAILBOX_SIZE * MAX_FRAGMENTS];
|
||||
|
||||
-/**
|
||||
- * Extracts the index from a memory handle allocated by Hafnium's current world.
|
||||
- */
|
||||
-uint64_t ffa_memory_handle_get_index(ffa_memory_handle_t handle)
|
||||
-{
|
||||
- return handle & ~FFA_MEMORY_HANDLE_ALLOCATOR_MASK;
|
||||
-}
|
||||
-
|
||||
/**
|
||||
* Initialises the next available `struct ffa_memory_share_state` and sets
|
||||
* `share_state_ret` to a pointer to it. If `handle` is
|
||||
@@ -159,7 +150,8 @@ static bool allocate_share_state(
|
||||
|
||||
if (handle == FFA_MEMORY_HANDLE_INVALID) {
|
||||
memory_region->handle =
|
||||
- ffa_memory_handle_make(i);
|
||||
+ i |
|
||||
+ FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR;
|
||||
} else {
|
||||
memory_region->handle = handle;
|
||||
}
|
||||
@@ -213,7 +205,7 @@ static bool get_share_state(struct share_states_locked share_states,
|
||||
struct ffa_memory_share_state **share_state_ret)
|
||||
{
|
||||
struct ffa_memory_share_state *share_state;
|
||||
- uint64_t index;
|
||||
+ uint32_t index;
|
||||
|
||||
CHECK(share_states.share_states != NULL);
|
||||
CHECK(share_state_ret != NULL);
|
||||
@@ -222,8 +214,9 @@ static bool get_share_state(struct share_states_locked share_states,
|
||||
* First look for a share_state allocated by us, in which case the
|
||||
* handle is based on the index.
|
||||
*/
|
||||
- if (ffa_memory_handle_allocated_by_current_world(handle)) {
|
||||
- index = ffa_memory_handle_get_index(handle);
|
||||
+ if ((handle & FFA_MEMORY_HANDLE_ALLOCATOR_MASK) ==
|
||||
+ FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR) {
|
||||
+ index = handle & ~FFA_MEMORY_HANDLE_ALLOCATOR_MASK;
|
||||
if (index < MAX_MEM_SHARES) {
|
||||
share_state = &share_states.share_states[index];
|
||||
if (share_state->share_func != 0) {
|
||||
--
|
||||
2.29.2
|
||||
|
||||
-99
@@ -1,99 +0,0 @@
|
||||
From f080a6ae839b48188131648363c9e050f496f205 Mon Sep 17 00:00:00 2001
|
||||
From: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
Date: Mon, 12 Apr 2021 10:22:26 +0100
|
||||
Subject: [PATCH 3/3] FF-A: Fix to fetch proper vCPU index for UP SP
|
||||
|
||||
When switching the context between SPs, fetch the vCPU index using
|
||||
api_vm_get_vcpu() helper routine. This routine gets the vCPU at index 0
|
||||
for UP SP.
|
||||
|
||||
Rename function api_ffa_msg_send_direct_get_receiver_vcpu() to
|
||||
api_vm_get_vcpu() as it is used both in direct message request
|
||||
and response.
|
||||
|
||||
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
Change-Id: I45a60427f8c2d1b5058443536d972495728ee0c2
|
||||
Upstream-Status: Pending [Not submitted to upstream yet]
|
||||
---
|
||||
src/api.c | 44 +++++++++++++++++++++-----------------------
|
||||
1 file changed, 21 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/src/api.c b/src/api.c
|
||||
index 16626b6..4c8034e 100644
|
||||
--- a/src/api.c
|
||||
+++ b/src/api.c
|
||||
@@ -63,6 +63,25 @@ void api_init(struct mpool *ppool)
|
||||
mpool_init_from(&api_page_pool, ppool);
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * Get target VM vCPU.
|
||||
+ * If VM is UP then return first vCPU.
|
||||
+ * If VM is MP then return vCPU whose index matches current CPU index.
|
||||
+ */
|
||||
+static struct vcpu *api_vm_get_vcpu(struct vm *vm, struct vcpu *current)
|
||||
+{
|
||||
+ ffa_vcpu_index_t current_cpu_index = cpu_index(current->cpu);
|
||||
+ struct vcpu *vcpu = NULL;
|
||||
+
|
||||
+ if (vm->vcpu_count == 1) {
|
||||
+ vcpu = vm_get_vcpu(vm, 0);
|
||||
+ } else if (current_cpu_index < vm->vcpu_count) {
|
||||
+ vcpu = vm_get_vcpu(vm, current_cpu_index);
|
||||
+ }
|
||||
+
|
||||
+ return vcpu;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* Switches the physical CPU back to the corresponding vCPU of the VM whose ID
|
||||
* is given as argument of the function.
|
||||
@@ -80,7 +99,7 @@ static struct vcpu *api_switch_to_vm(struct vcpu *current,
|
||||
ffa_vm_id_t to_id)
|
||||
{
|
||||
struct vm *to_vm = vm_find(to_id);
|
||||
- struct vcpu *next = vm_get_vcpu(to_vm, cpu_index(current->cpu));
|
||||
+ struct vcpu *next = api_vm_get_vcpu(to_vm, current);
|
||||
|
||||
CHECK(next != NULL);
|
||||
|
||||
@@ -1630,26 +1649,6 @@ struct ffa_value api_ffa_features(uint32_t function_id)
|
||||
}
|
||||
}
|
||||
|
||||
-/**
|
||||
- * Get target VM vCPU for direct messaging request.
|
||||
- * If VM is UP then return first vCPU.
|
||||
- * If VM is MP then return vCPU whose index matches current CPU index.
|
||||
- */
|
||||
-static struct vcpu *api_ffa_msg_send_direct_get_receiver_vcpu(
|
||||
- struct vm *vm, struct vcpu *current)
|
||||
-{
|
||||
- ffa_vcpu_index_t current_cpu_index = cpu_index(current->cpu);
|
||||
- struct vcpu *vcpu = NULL;
|
||||
-
|
||||
- if (vm->vcpu_count == 1) {
|
||||
- vcpu = vm_get_vcpu(vm, 0);
|
||||
- } else if (current_cpu_index < vm->vcpu_count) {
|
||||
- vcpu = vm_get_vcpu(vm, current_cpu_index);
|
||||
- }
|
||||
-
|
||||
- return vcpu;
|
||||
-}
|
||||
-
|
||||
/**
|
||||
* FF-A specification states that x2/w2 Must Be Zero for direct messaging
|
||||
* interfaces.
|
||||
@@ -1733,8 +1732,7 @@ struct ffa_value api_ffa_msg_send_direct_req(ffa_vm_id_t sender_vm_id,
|
||||
* number of PEs in the system. It further states that MP partitions
|
||||
* accepting direct request messages cannot migrate.
|
||||
*/
|
||||
- receiver_vcpu =
|
||||
- api_ffa_msg_send_direct_get_receiver_vcpu(receiver_vm, current);
|
||||
+ receiver_vcpu = api_vm_get_vcpu(receiver_vm, current);
|
||||
if (receiver_vcpu == NULL) {
|
||||
return ffa_error(FFA_INVALID_PARAMETERS);
|
||||
}
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
From fd177558a1da73fa7e10f8b2997864bb76d66dc8 Mon Sep 17 00:00:00 2001
|
||||
From: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
Date: Thu, 15 Apr 2021 10:46:33 +0100
|
||||
Subject: [PATCH] tc0: Add Theodul DSU support and GICR changes
|
||||
|
||||
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
Change-Id: I4a9b7e4350410fdacccd8c12ff03a61b7e64e98b
|
||||
Upstream-Status: Pending [Not submitted to upstream yet]
|
||||
---
|
||||
project/reference/BUILD.gn | 4 ++--
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/project/reference/BUILD.gn b/project/reference/BUILD.gn
|
||||
index 5596009..ffcaab7 100644
|
||||
--- a/project/reference/BUILD.gn
|
||||
+++ b/project/reference/BUILD.gn
|
||||
@@ -160,9 +160,9 @@ aarch64_toolchains("secure_tc0") {
|
||||
iommu = "//src/iommu:absent"
|
||||
gic_version = 3
|
||||
gicd_base_address = "0x30000000"
|
||||
- gicr_base_address = "0x30140000"
|
||||
- heap_pages = 60
|
||||
- max_cpus = 4
|
||||
+ gicr_base_address = "0x30080000"
|
||||
+ heap_pages = 80
|
||||
+ max_cpus = 8
|
||||
max_vms = 16
|
||||
toolchain_args = {
|
||||
plat_psci = "//src/arch/aarch64/plat/psci:spmc"
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
# TC0 specific configuration
|
||||
|
||||
# Intermediate SHA with 2.4 baseline version, required for OP-TEE SEL1 support
|
||||
SRCREV = "2904b2c5361f06d35c324f37d2e71e3278d351a7"
|
||||
PV = "2.4+git${SRCPV}"
|
||||
|
||||
FILESEXTRAPATHS_prepend_tc0 := "${THISDIR}/files/tc0:"
|
||||
|
||||
SRC_URI_append = " \
|
||||
file://0001-Revert-FFA-Set-and-verify-allocator-of-memory-handle.patch \
|
||||
file://0002-FF-A-Fix-to-fetch-proper-vCPU-index-for-UP-SP.patch \
|
||||
file://0003-tc0-Theodul-GICR-changes.patch \
|
||||
"
|
||||
|
||||
COMPATIBLE_MACHINE = "tc0"
|
||||
|
||||
HAFNIUM_PROJECT = "reference"
|
||||
HAFNIUM_PLATFORM = "secure_tc0"
|
||||
HAFNIUM_INSTALL_TARGET = "hafnium"
|
||||
@@ -1,6 +0,0 @@
|
||||
# Machine specific configurations
|
||||
|
||||
MACHINE_HAFNIUM_REQUIRE ?= ""
|
||||
MACHINE_HAFNIUM_REQUIRE_tc0 = "hafnium-tc0.inc"
|
||||
|
||||
require ${MACHINE_HAFNIUM_REQUIRE}
|
||||
@@ -62,7 +62,7 @@ do_deploy() {
|
||||
done
|
||||
|
||||
if [ "${INITRAMFS_IMAGE_BUNDLE}" -eq 1 ]; then
|
||||
cp -L -f ${DEPLOY_DIR_IMAGE}/Image-initramfs-juno.bin \
|
||||
cp -L -f ${DEPLOY_DIR_IMAGE}/Image.gz-initramfs-juno.bin \
|
||||
${D}/${UNPACK_DIR}/SOFTWARE/Image
|
||||
else
|
||||
cp -L -f ${DEPLOY_DIR_IMAGE}/Image ${D}/${UNPACK_DIR}/SOFTWARE/
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2020 Arm Limited
|
||||
#
|
||||
SUMMARY = "Total Compute Images"
|
||||
DESCRIPTION = "Build all the images required for Total Compute platform"
|
||||
LICENSE = "Apache-2.0"
|
||||
|
||||
inherit nopackages
|
||||
|
||||
# The last image to be built is trusted-firmware-a
|
||||
DEPENDS += " trusted-firmware-a"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user