1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-07-18 16:37:08 +00:00

Compare commits

..

159 Commits

Author SHA1 Message Date
Hugo L'Hostis 71686ac05c arm-bsp/n1sdp: remove debug and verbose kernel cmd line parameters from grub cfg
By removing the verbose and debug kernel command line parameters from the grub
menu entries we prevent the console printing unnecessary messages and slowing
down the boot process.

Issue-Id: SCM-3027
Signed-off-by: Hugo L'Hostis <hugo.lhostis@arm.com>
Change-Id: Ieb68c606b7ed5b20191f6989aea84963b8cda778
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-09-21 11:53:18 -04:00
Ross Burton e9d695f132 arm/generic-arm64: recommend kernel modules and firmware
The generic-arm64 machine is meant to be generic, so pull in all the
kernel modules and firmware we have to increase the chances of hardware
working out of the box.

Change-Id: I51f500f6a6f821fa8df5bee062a52077dcf8e564
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-09-16 09:12:38 -04:00
Ross Burton f86bf75a6e arm/generic-arm64: set machine features
Set a slew of generic machine features that other parts of oe-core will
respect.

Change-Id: I47ea187128c7e3a9f8b711b74467b20b9cb4fcee
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-09-16 09:12:38 -04:00
Ross Burton 2d7af5f9d7 arm/generic-arm64: use a custom EFI wic file
Instead of using the pre-canned Wic kickstart file, provide our own.
This lets us specify that UUIDs should be used in the fstab, meaning
that the image is agnostic to the device type.

Change-Id: If9c0083c16f8bd2ad7d573a0d356383553aa8936
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-09-16 09:12:38 -04:00
Ross Burton ee1b109e36 arm/generic-arm64: don't set SERIAL_CONSOLES
This machine expects something approximating SystemReady, which means
the firmware should be capable of telling the kernel where the console
is.

Remove SERIAL_CONSOLES so the kernel does what the firmware is told, and
doesn't try to use serial consoles that don't exist.

Change-Id: Ib0b008fececf4c046112bdede9d0d3ebf9dc332b
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-09-16 09:12:38 -04:00
Ross Burton ba82ea920a arm-bsp/linux-yocto: drop upstreamed N1SDP patch
This patch was upstreamed in 5.10.54.

Change-Id: Iacf6345c4d4ffa8e512e2f812876fdd50a057f96
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-08-29 10:42:07 -04:00
Jon Mason e82b83c92e juno: temporarily pin 5.4 kernel version
Recent changes in the 5.4 kernel are preventing the juno patches from
applying.  Temporarily pin the kernel to the version prior to this until
the patches can be rebased.

Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-08-09 16:14:53 -04:00
Jon Mason 30077d988f CI: add ssh tests
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-08-09 16:14:53 -04:00
Jon Mason 85f2a93c0a CI: merge testimage into the build stage
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-08-09 16:14:53 -04:00
Anastasios Kavoukis e4520e2a63 CI: enable debug-tweaks IMAGE_FEATURE
This makes the images suitable for development and test,
debug-tweaks includes settings like empty root password.

All CI image builds inheriting from base.yml will
have this include this setting.

Signed-off-by: Anastasios Kavoukis <anastasios.kavoukis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-08-09 16:14:53 -04:00
Hugo L'Hostis 328c85778b arm-autonomy/fvp-base: Add support for runfvp for arm-autonomy-host
Expand the FVP_DATA variable used by the fvpboot.bbclass to load both Xen
and its device tree when building arm-autonomy-host image for fvp-base.

Issue-Id: SCM-2718
Signed-off-by: Hugo L'Hostis <hugo.lhostis@arm.com>
Change-Id: Ia6e2f6a13e84c8e762d297ac34ccbe5417a7793b
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-07-27 14:23:18 -04:00
Ross Burton 4e14a1c5ee CI: set interruptible on all jobs
The previous attempt at setting interruptible didn't work as it needs to
happen on all tasks, as once a single uninterruptible job has executed
the pipeline cannot be cancelled.  Unfortunately the setup jobs were
not interruptible, so the pipeline could never be cancelled.

Change-Id: I5416bc3f9a883ace24c12607b2ebc24bc428b50b
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-07-22 12:26:47 +01:00
Ross Burton 3d9cf26be1 ci/check-warnings: ignore warnings that we're using the mirror
SourceForge in particular doesn't like multiple connections from the
same IP, but when a source mirror is being populated for the first time
this will happen. Our fetch falls back to the Yocto mirror so it doesn't
cause a failure, but there is a warning logged which our CI then fails
because of.

As we don't care about these warnings, filter them out of the log before
checking if there were any errors.

Change-Id: I36c97c5d9923f1c4d14c4588f3780211cccb57b2
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2021-07-22 12:26:00 +01:00
Sumit Garg afd9bf7ee6 arm/qemuarm64-secureboot: Enable kernel TEE drivers
Add a config fragment to enable kernel TEE drivers.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-07-20 08:54:26 -04:00
Timothy Mertz e82d9fdd49 external-arm-sdk-toolchain: Fix parsing error with INCOMPATIBLE_LICENSE
This change fixes parsing error that occurs when INCOMPATIBLE_LICENSE =
"GPLv3" by defining EAT_BFD_LICENSE, EAT_GDB_LICENSE and EAT_RLE_LICENSE
in license.inc and requiring it in external-arm-sdk-toolchain.bb

Definitions in external-arm-toolchain-versions.inc are made redundant so
they are removed.

Signed-off-by: Timothy Mertz <timothy.mertz@garmin.com>
Signed-off-by: Joshua Watt <Joshua.Watt@garmin.com>
Reviewed-by: Denys Dmytriyenko <denis@denix.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-07-02 10:54:52 -04:00
Diego Sueiro eec8640c16 arm-bsp/u-boot/fvp-base: Make usage of config fragments to set CONFIG_BOOTARGS
Since u-boot recipe supports using config fragments let's use it instead of
patching the vexpress_aemv8a_semi_defconfig file.

Issue-Id: SCM-2329
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Change-Id: I7feba5d23a6eab501cade38c188cb8414d0b86bd
(cherry picked from commit 1a46824760)
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-29 13:45:40 -04:00
Jon Mason 4e3f2de11d CI: add testing and testimage
Add a testing task to the gitlab CI and run testimage in that job.
Currently, it only runs against some of the qemu based machines.
Using slirp, there is no need for a privileged container or tun/tap
devices.

Change-Id: Ia85a3d0089f7d4dc7595c3a45d328c79d8e675f1
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-29 11:14:23 -04:00
Jon Mason 04d9436f9d arm/linux: temporarily use 5.10.21 kernel for qemuarm64-secureboot
Patches for ZONE_DMA continue to be added to the 5.10.x kernel, causing
the removal patch to constantly break.  While working on a better fix,
regress the kernel to 5.10.21 (last version before ZONE_DMA was added)
to keep the CI working.

Change-Id: I537dd061ae0c6d2adce6649d03bd63a3d5dfffe9
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-23 09:41:11 -04:00
Ross Burton b8e69c8bb3 ci: add yocto-check-layers step
Add a job to run yocto-check-layers to validate a selection of layers
are Yocto Project Compatible.

Right now we validate:
- meta-arm
- meta-arm-bsp
- meta-arm-toolchain
- meta-gem5

meta-atp and meta-arm-autonomy are currently skipped: meta-atp fails and
meta-arm-autonomy has a larger set of dependant layers and will be added
later.

Change-Id: Ia0c8c16e4228eeb461bd213b30703e950ede656f
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-23 09:41:11 -04:00
Ross Burton 1de9c1ffb8 arm-bsp/linux: guard FILESEXTRAPATHS changes in overrides
Because of how the kernel class searches for files any changes to
FILESEXTRAPATHS should be done in an override so it doesn't potentially
impact unrelated builds.

Issue spotted by running yocto-check-layer.

Change-Id: Id3b741d184a024d0cc6d2d5031e150a8f0ae4b0d
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-23 09:41:11 -04:00
Ross Burton ae5fed3951 arm-bsp/tc0-artifacts-image: restrict to TC0
This recipe is for TC0, so set COMPATIBLE_MACHINE appropriately.

This is both logically correct, and fixes a Yocto Compatible test failure
where tc0-artifacts-image isn't buildable for arbitrary machines.

Change-Id: I6381fc08076d4ddea254f7efc84f90c4a7f65d26
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-23 09:41:11 -04:00
Diego Sueiro e0c855cc24 arm-autonomy/fvp-base: Make usage of wic images
In meta-arm-bsp fvp-base switched to wic images. Hence, make the appropriate
changes to also use wic images in meta-arm-autonomy.

Change-Id: I34d68fee11ea339fb52a97d7593e373aa69faa1c
Issue-Id: SCM-2329
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
(cherry picked from commit b2031ed7ca)
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-21 14:53:01 -04:00
Kamil Dziezyk 8f2dcc25f0 arm-bsp/fvp-base*: Introduce WIC support for fvp-base* machines
Add wks script that contains two partitions.
Rootfs is populated to second partition, because the first one is empty,
to keep compatibility with image_types_disk_img.bbclass
and use the same root device set in u-boot bootargs parameter.

Both wic and disk.img files are built by default.

Issue-Id: SCM-2698
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Change-Id: Ib5b5c3a7aa6e8fe9fa90a2955ae1e461caa01356
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-21 14:53:01 -04:00
Ross Burton 646239278a arm-bsp/fvp-base: set FVP_ variables
So that a fvp-base image can be tested easily, set the relevant FVP_*
variables.

After setting IMAGE_CLASSES += "fvpboot" in local.conf, this will show
the firmware start and Linux boot:

$ MACHINE=fvp-base bitbake core-image-base
$ runfvp fvp-base --console

Change-Id: Id1bd6cea57958117103e53ab9f78a58ce92b6a2e
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-17 11:35:10 -04:00
Ross Burton 6873363ede runfvp: drop --parameter, users can use -- --parameter
Now that arbitrary parameters can be passed to the FVP binary, runfvp
doesn't need to handle --parameter itself.

Anyone using runfvp --parameter should simply use runfvp -- --parameter.

Change-Id: I8a79200fe927c253308731e7e0cb228e53cd989a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-17 11:35:10 -04:00
Ross Burton b36052691e runfvp: pass arbitrary options after -- to the FVP binary
To allow passing arbitrary options to the FVP binary, split the passed
options on --.  Anything before the separator is handled by runfvp,
anything afterwards is passed as-is to the FVP binary.

Change-Id: I686b2fb79d217e26988753be7bd067c638d69eac
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-17 11:35:10 -04:00
Ross Burton 8fe982f8d0 runfvp: exit with the return code of the FVP binary
Change-Id: If79e31e61110161c9a13dd512b0146d1d515d77a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-17 11:35:10 -04:00
Ross Burton 77f4023c82 scripts: add runfvp
runfvp is a script that reads existing .fvpconf files (as written by
fvpboot.bbclass) and executes the FVP binary appropriately.

By default the behaviour is the same as running a FVP by hand, but by
passing --console the first serial port is connected to stdin/stdout.

Change-Id: Ibd26867c09e8692be4c02a7ea13571dcfe36db9b
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-17 11:35:10 -04:00
Ross Burton c5ebdb44d2 arm/fvpboot: add class to write FVP boot configuration
The fvpboot class is used to write a machine-readable file that describes
how to boot a given machine image inside a FVP, similar to how qemuboot
writes files for runqemu.

BSPs should set the FVP_* variables as appropriate in their machine
configuration, but let the user opt-in to adding fvpboot to IMAGE_CLASSES.

Change-Id: I2d1cd86ec4affc1d688a293987890d6a89124d94
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-17 11:35:10 -04:00
Ross Burton 6c622ca3da arm/fvp-library: add recipe for the FVP Library
Add a recipe for the FVP Library:

https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms

This is free to download but is behind a login-wall, and the FVPs are
license managed.

Change-Id: Ia0e7b1bfac54e06faf9d517d5b769acf9670724a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-17 11:35:10 -04:00
Ross Burton de18bcf3d2 arm/fvp-base-a-aem: add Architecture Envelope Model FVP for Arm v8-A
Add a recipe for the general purpose Armv-A Base RevC AEM FVP.

This FVP is behind a login-wall so the user has to download it themselves,
but the FVP is free to use.

Change-Id: I14d7b965a05ff9f405a2a12d4da2afd3dd2ecb87
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-17 11:35:10 -04:00
Ross Burton c9eda152b0 arm/fvp: add recipes for Ecosystem FVPs
Add recipes for the SGI-575 and N1-Edge reference designs from the
Ecosystem FVP collection:

https://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps

These FVPs are free to download and use.

Change-Id: Ia645e4a7264f73ec42ee61ab2907a9bfdbe7c25d
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-17 11:35:10 -04:00
Hugo L'Hostis 9851e5714a arm-autonomy/xenguest-network: add "none" network type to xenguests
This patch adds a new "none" network type that can be set for xenguests
using XENGUEST_IMAGE_NETWORK_TYPE in their configuration.

Issue-Id: SCM-2338
Signed-off-by: Hugo L'Hostis <hugo.lhostis@arm.com>
Change-Id: If4f6de282b0048e5c68d293a3db5b56cd5adce66
Signed-off-by: Ross Burton <ross.burton@arm.com>
2021-06-14 10:35:36 -04:00
Hugo L'Hostis 318b47ae05 arm-autonomy/n1sdp: add kernel modules to mount FAT filesystem
This patch adds kernel modules necessary for n1sdp to mount the FAT filesystem
codepage 437 and NLS ISO 8859-1.

Issue-Id: SCM-2682
Signed-off-by: Hugo L'Hostis <hugo.lhostis@arm.com>
Change-Id: I2d4fede311544917050326564b2b0a7d0123cb21
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-14 10:35:36 -04:00
Jon Mason 4482136c29 ci: clean regularly to reduce size
The Gitlab CI executors do not clean-up after each run, which will
result in a ballooning size over time. Remove all files in the work
tree, removing the problem.  SSTATE should prevent this from causing
any performance by not having the files there.

Change-Id: I57df3cf470c519286fe194739a0a7722794f3b25
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-08 11:29:33 -04:00
Hugo L'Hostis 65d41185b0 arm-autonomy/xenguest-manager: fix xenguest initscript stop sequence
This patch fixes an issue where xenguest initscript stop sequence was not
properly identifying the running guests.

Issue-Id: SCM-2772
Signed-off-by: Hugo L'Hostis <hugo.lhostis@arm.com>
Change-Id: I3ad88e00f48fab07f99936a10c0d1deb7459e83b
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-08 10:20:29 -04:00
Hugo L'Hostis 10e5981995 arm-bsp/docs: documentation improvements for fvp-baser-aemv8r64
This patch updates the documentation for fvp-baser-aemv8r64 :

- Update link to the yocto documentation.
- Add details about what Host OS version are supported. Add Ubuntu
20.04 specific instructions.
- Warn user about disk space.

Issue-Id: SCM-2665
Signed-off-by: Hugo L'Hostis <hugo.lhostis@arm.com>
Change-Id: I37e6bd3ae0a04258743a5bf1dfc80e515078d524
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-01 11:00:03 -04:00
Filipe Rinaldi 48ffd24725 arm-bsp/docs: Updated documentation fvp-baser-aemv8r64 MACHINE
This update has mainly format related changes (no functional changes) to
improve readability when reading the non-rendered version of it.
- Use underlined style for headers level 1 and 2
- Use indentation to create blocks
- Use double space at the end of each section
- Add indentation to the FVP parameters
- Add pip command to install the kas tool

Issue-Id: SCM-2665
Signed-off-by: Filipe Rinaldi <filipe.rinaldi@arm.com>
Change-Id: I9d4b4dbcef6dc13638b62563ebdf90b6b9d5b686
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-01 11:00:03 -04:00
luca fancellu a727cfe74b arm-autonomy: fix building for xen-tools >=4.15
The 0001-vif-nat-fix-hostname.patch is merged in xen-tools
4.15, so fix the layer to apply the patch only for 4.14.

Issue-Id: SCM-2608
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
Change-Id: I1306955ab0b1ee435a8da42e953e142270c4b2d3
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-01 11:00:03 -04:00
Ross Burton 12af38f31b ci/base: don't try to make warnings fatal
The generated local.conf has ERROR_QA=${WARN_QA} in an attempt to make
warnings fatal, but this appears to be just disabling some warnings and
error instead.

As we already have warning detection in the GitLab CI script, this is
redundant and can be removed.

Change-Id: I393874edbae148ee338a7069bbf800603c028242
Signed-off-by: Ross Burton <ross.burton@arm.com>
2021-05-25 12:12:44 +01:00
Ross Burton 7ca13b4f15 arm/linux-yocto: add missing LINUX_VERSION to qemuarm64-sbsa
As the SRCREV is pinned to a specific SHA we should also set LINUX_VERSION, as future kernel
upgrades in oe-core master will change both SRCREV and LINUX_VERSION.

Change-Id: Iafababe83ff54625112d2fae859d8a3938001cd5
Signed-off-by: Ross Burton <ross.burton@arm.com>
2021-05-11 16:01:14 +01:00
Peter Hoyes 33e88e8a3a arm-autonomy/linux-arm-autonomy: Remove Xen irq lock patch
The following patch has been backported to kernel 5.10.30:
    0001-xen-evtchn-Change-irq_info-lock-to-raw_spinlock_t.patch

Issue-Id: SCM-2307
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I9cef017b60891780176dff944e3eca5986746d8a
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-05-04 10:54:59 -04:00
Jon Mason 301bf3b5fd arm/kernel: fix previous patch
The previous patch broke for qemuarm64-sbsa, ebcause they share the same
defconfig patch but now the upstream kernel SHAs are different.  Change
them to have the same SHAs.

Also, the previous patch lost the patch header.  So re-add that.

Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-05-02 11:13:02 -04:00
Ross Burton f3227b7a8e arm/linux: guard FILESEXTRAPATHS changes in overrides
Because of how the kernel class searches for files any changes to
FILESEXTRAPATHS should be done in an override so it doesn't potentially
impact unrelated builds.

Issue spotted by running yocto-check-layer.

Change-Id: I3e915a0cafc850d4b2594b655a849977d389465a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-05-02 11:12:58 -04:00
Jon Mason bd2e25959f arm: combine linux-yocto bbappend files
Combining linux-yocto bbappend into a single file.

Change-Id: Ica4fc2d0edc9939451c572e5eb65f34e4002c26f
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-05-02 11:12:58 -04:00
Jon Mason 6c08dd6c76 arm/kernel: fix broken defconfig patch
Upstream kernel is now being patched, which prevents the patch being
fixed here from applying cleanly.  Rebase it on top of the existing one
to resolve the issue.

Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-05-01 18:39:42 -04:00
Jon Mason a637fa88f2 CI: enable non-arm64 builders
Abstract away all of the things preventing the current setup from
working on only internal, arm64 build hardware.

Change-Id: Ib8d0e8e76602d4553e044520a91349015b1aa19b
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-30 13:24:48 -04:00
Jon Mason ef9b9c8e70 CI: use public KAS image
Use the KAS docker image provided by the KAs project for Gitlab CI.
This allows for the external (non-Arm Corp) users/developers to run
Gitlab CI.

Change-Id: I9fee9a0d571e3fd60862d4ccd36176f9e583fc91
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-30 13:24:48 -04:00
Jon Mason 235f2a8ca7 CI: Reorder manual tasks to be alphabetical
Change-Id: I2e5bfdf5794c99da530bc2645fb56a5444444be3
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-30 13:24:48 -04:00
Adrian Herrera cec4d317e9 CI: add kas file and job for gem5-atp-arm64
Change-Id: Iee0d27c15fe00a4363ed832c06cb502c54299cd5
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-22 12:33:06 -04:00
Adrian Herrera bcbd365cfe atp: initial layer
meta-atp layer provides support for building AMBA Adaptive Traffic
Profiles (ATP) Engine. It provides the following recipes:

- ATP Engine native standalone build.
- ATP Engine with gem5 as host platform.
- ATP Linux kernel modules.
- ATP Linux user API.
- ATP Linux tests.

The layer provides a "gem5-atp-arm64" machine with ATP device and
adapter support.

Change-Id: Ib86c7502d62d5707d0d4bbdd7d179f231cf96f57
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-22 09:48:22 -04:00
Ross Burton f723b6b593 layer.conf: don't claim compatibility with Gatesgarth
We don't test this, and don't expect it to work, so don't claim it does.

Change-Id: I045930e690edba5a5b0b8cb810130c8c6733623f
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-21 22:23:55 -04:00
Peter Hoyes 696773771f arm-autonomy/docs: Change quickstart instructions to hardknott
Issue-Id: SCM-2307
Change-Id: Ieb7a6d3280a7eba573a57b4e52e275adb0a208df
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-21 22:23:55 -04:00
Jon Mason 5c5cd66675 CI: Add repo dir to disk usage and ability to purge everything
Add the newly added repo dir to the disk usage calculation and add the
ability to remove each of the persistent directories.

Change-Id: Ib922ad42c62efdeccf01851ac751742ed67748ae
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-20 13:57:39 -04:00
Diego Sueiro 65382e51b7 arm-bsp/docs: Updated documentation fvp-baser-aemv8r64 MACHINE
Added quickstart instructions on how to build a BSP evaluation image using kas.
Updated FVP naming convention as well as information about where to download
and how to run the FVP.

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: Ia6056194ed23d6e38769a3e300eadf77fc41beb2
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-20 13:57:39 -04:00
Diego Sueiro b43c30089c kas: Add fvp-baser-aemv8r64 BSP evaluation build
The kas/fvp-baser-aemv8r64-bsp.yml is intended to be used as an evaluation
build for the BSP components.

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: Idce501224f4c8fbd6c53dc318db73dcd3100b57b
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-20 13:57:39 -04:00
Diego Sueiro 8baef3984a arm-autonomy/arm-autonomy-host: Set Xen to 4.14+stable version
Since meta-virtualization master branch bumped to 4.15+stable we need to force
the 4.14+stable until we validate the new version.

Issue-Id: SSCM-2307
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: Id204314af9c87615d88dfc60702867380225b491
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-20 13:57:39 -04:00
Jon Mason 70e9b1ffde arm: workaround qemuarm64-secureboot ZONE_DMA issues
Upstream stable patches for ZONE_DMA size and dma-ranges are causing:

Segmentation fault
[    3.156012] Internal error: synchronous external abort: 96000050 [#15] PREEMPT SMP
[    3.156172] Modules linked in:
[    3.156247] CPU: 0 PID: 139 Comm: rc Tainted: G      D           5.10.21-yocto-standard #1
[    3.156391] Hardware name: linux,dummy-virt (DT)
[    3.156490] pstate: 00000005 (nzcv daif -PAN -UAO -TCO BTYPE=--)
[    3.156619] pc : copy_page+0x40/0xc0
[    3.156691] lr : copy_highpage+0x58/0xe0
[    3.156786] sp : ffffffc01192bc10
[    3.156855] x29: ffffffc01192bc10 x28: ffffff804036a880
[    3.156958] x27: 0000000000000000 x26: ffffff80432e56f0
[    3.157063] x25: ffffff8043955c38 x24: 000000557a600000
[    3.157167] x23: ffffff80432e5680 x22: ffffffff00e4e940
[    3.157268] x21: ffffffff00180600 x20: ffffff800e018000
[    3.157378] x19: ffffff80413a5000 x18: 0000000000000000
[    3.157495] x17: 0000000000000000 x16: 000000557a5ffc48
[    3.157611] x15: 0000000000000001 x14: 0000000000000000
[    3.157715] x13: 000000557a60ae08 x12: 0000000000000000
[    3.157832] x11: 0000000000000000 x10: 0000000000000000
[    3.157920] x9 : 000000557a5fd010 x8 : 000000000557a600
[    3.158033] x7 : 0000000000000161 x6 : 0000000000000000
[    3.158140] x5 : 0000000000000000 x4 : 00005b0000000002
[    3.158238] x3 : 000000557a5fa550 x2 : 0000000000000000
[    3.158348] x1 : ffffff80413a5080 x0 : ffffff800e018100
[    3.158451] Call trace:
[    3.158501]  copy_page+0x40/0xc0
[    3.158572]  copy_user_highpage+0x24/0x40
[    3.158654]  wp_page_copy+0x90/0x790
[    3.158723]  do_wp_page+0xa4/0x490
[    3.158786]  handle_mm_fault+0x7b8/0xc30
[    3.158867]  do_page_fault+0x15c/0x400
[    3.158937]  do_mem_abort+0x4c/0xac
[    3.159004]  el0_da+0x3c/0x50
[    3.159070]  el0_sync_handler+0x168/0x1b0
[    3.159153]  el0_sync+0x174/0x180
[    3.159224] Code: 91040000 91020021 f2402c1f d503201f (a8300c02)
[    3.159343] ---[ end trace 06748391c33610de ]---

Temporarily revert these patches to allow for qemuarm64-secureboot to
continue working while the root cause is being investigated.  The
patches in question are:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=35ec3d09ff6a49ee90e1bfd09166596f017eb5bb
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8eaef922e9381af7b923c4e3c57a632a87101acb

Change-Id: I3cdea9469d940f6458d0ef65460f945c55eef3e3
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-20 11:32:28 -04:00
Yann Dirson 2354c9e06e arm/optee-os: deploy tee.elf for u-boot
Integration of OP-TEE in the u-boot image is done with `TEE=tee.elf`,
so this build artifact must be exported.

U-boot integration can now be done in a BSP layer with something like
this in `u-boot_%.bbappend`:

 # OP-TEE, dependent on "optee" DISTRO_FEATURES

 OPTEE_OEMAKE ?= " TEE=${DEPLOY_DIR_IMAGE}/optee/tee.elf"

 EXTRA_OEMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
 PACKAGECONFIG[optee] = "${OPTEE_OEMAKE},,optee-os"
 PACKAGECONFIG_append = " ${@bb.utils.filter('DISTRO_FEATURES', 'optee', d)}"

Signed-off-by: Yann Dirson <yann@blade-group.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-20 08:07:15 -04:00
Jon Mason 587b8ab87d Revert "arm/optee-os: deploy tee.elf for u-boot"
This reverts commit 4b3343b4a9.
2021-04-19 22:26:23 -04:00
Ross Burton 850c324189 CI: track hardknott branch, not master
Hardknott has released and upstream oe-core master has diverged. We will
also be releasing shortly so track hardknott not master for the CI.

Change-Id: I68f8b1c4cc5ac0686c3db9259b44d16f367d82d6
Signed-off-by: Ross Burton <ross.burton@arm.com>
2021-04-19 13:17:30 +01:00
Ross Burton e3bfb5d746 Rename top-level kas/ to ci/
The files in kas/ are not generic Kas files, but instead designed
specifically and solely around the CI system.

Change-Id: I30082392ad2231a4c1c41e54a292595adf81715b
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-19 08:12:27 -04:00
Ross Burton f88a69768a CI: don't disable uninative
We previously disabled uninative[1] because it broke builds in the
Docker containers. This has now been fixed in oe-core with uninative 3.0
so this workaround can be removed.

[1] e5523d626f

Change-Id: I40975eb46737e66dab9f9b8cc63a9283d79918fb
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-19 08:12:27 -04:00
Ross Burton 1c151dba07 CI: make update-repos a bit more verbose
Change-Id: Ibb7b652b13b6d036c36fce076e7c1807f2ff37d7
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-19 08:12:27 -04:00
Ross Burton 0519634f2d kas/base.yml: rename ptest fragment to noptest
Change-Id: Ib670ba8715ff128345e631652d4cae8d76ba0812
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-19 08:12:27 -04:00
Yann Dirson 31e1428ea5 optee-os: don't override upstream TA_LOG_LEVEL setting
Aside from diverging from upstream, appending such a change it at the end of
oe_runmake makes it hard to override it in a bbappend.

This value does not seem to be inherited in TA builds, and
eg. optee-examples do use the the values set in their individual
Makefiles.  Setting this to 0 however seems to cause the TA traces not
to be relayed to the console, so the examples end up less
self-illustrative than they should.

This patch restores the upstream choice, while allowing downstream layers to
choose to set it to zero if they wish to do so.

Signed-off-by: Yann Dirson <yann@blade-group.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-16 10:28:39 -04:00
Yann Dirson 0f29c11d2a optee-client: use /var/lib/tee instead of /data/tee for persistent storage
This is more FHS-conformant, and allows tee-supplicant to work on a
readonly rootfs setup (although then it uses volatile storage by
default, and it is still a matter of distro policy how to arrange for
that storage to be persistent in a readonly setup).

Signed-off-by: Yann Dirson <yann@blade-group.com>
Suggested-by: Ricardo Salveti <ricardo@foundries.io>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-16 10:28:39 -04:00
Yann Dirson 4b3343b4a9 arm/optee-os: deploy tee.elf for u-boot
Integration of OP-TEE in the u-boot image is done with `TEE=tee.elf`,
so this build artifact must be exported.

U-boot integration can now be done in a BSP layer with something like
this in `u-boot_%.bbappend`:

 # OP-TEE, dependent on "optee" DISTRO_FEATURES

 OPTEE_OEMAKE ?= " TEE=${DEPLOY_DIR_IMAGE}/optee/tee.elf"

 EXTRA_OEMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
 PACKAGECONFIG[optee] = "${OPTEE_OEMAKE},,optee-os"
 PACKAGECONFIG_append = " ${@bb.utils.filter('DISTRO_FEATURES', 'optee', d)}"

Signed-off-by: Yann Dirson <yann@blade-group.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-16 10:28:39 -04:00
Yann Dirson 976cebdf6e arm/optee-os: mark LDFLAGS patch as submitted
Signed-off-by: Yann Dirson <yann@blade-group.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-16 10:28:39 -04:00
Yann Dirson d45c837137 arm/optee: use pycryptodome rather pycryptodomex
Recent versions of OP-TEE perfectly build with pycryptodome, no need for
the pycryptodomex transition package any more.

Signed-off-by: Yann Dirson <yann@blade-group.com>
Reviewed-by: Denys Dmytriyenko <denis@denix.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-16 10:28:39 -04:00
Ross Burton cbf547e222 arm/sbsa-acs: update patch status
Change-Id: I75d7c6c098edaa30b009c9586ed7ce23994b0f2a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-16 10:28:39 -04:00
Richard Neill c1123c3d63 arm-autonomy/linux-arm-autonomy: Do not apply xen IRQ patch for 5.12+ kernels
As the xen event channel kernel patch is mainlined in 5.12, this patch ensures
it is only applied to the applicable versions earlier than 5.12.

Signed-off-by: Richard Neill <richard.neill@arm.com>
Change-Id: I03a3dc51281fdc94cd7e9a9da2540b34668a6ad1
2021-04-16 10:34:51 +01:00
Khem Raj 738c20d752 sbsa-acs: Always use BFD linker
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-07 08:59:48 -04:00
Khem Raj 43203a464d sbsa-acs: Fix build with clang 12
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-07 08:59:48 -04:00
Khasim Syed Mohammed 219fd34b76 arm-bsp/edk2-firmware: remove references to 201911 tag
edk2-firmware for n1sdp is ported and upgraded to 202102 version and since
no other platform is using 201911 version of edk2 firmware. This patch removes
the corresponding bb files.

Change-Id: I91b0e98a3df499fa86c5ea836c96de193f18990e
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
2021-04-06 10:23:06 -04:00
Khasim Syed Mohammed 2f2258d1d2 arm-bsp/edk2-firmware: upgrade n1sdp to 202102
edk2-firmware for n1sdp is ported and upgraded to 202102 version.

Change-Id: I08dcc7d1442ec9a9121ce648e68872d63169346a
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
2021-04-06 10:14:28 -04:00
Ross Burton a7f4f7d2bd CI: build sbsa-acs in the qemuarm64-sbsa job
Change-Id: I10dcd2b6332db281f969981a44edc22d0750a79b
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-06 10:12:43 -04:00
Ross Burton 2261d39412 arm/sbsa-acs: add COMPATIBLE_HOST
This recipe is only valid on aarch64 targets, so set COMPATIBLE_HOST.

Change-Id: I15595d307d1dab18b315b397a0751eaf4e109e68
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-06 10:12:34 -04:00
Ross Burton 77ac287518 arm/sbsa-acs: add SBSA Architecture Compliance Suite
Add a recipe for SBSA Architecture Compliance Suite, a test suite for
SBSA.

As this is implemented as a module for the EDK2 Shell application, this
can include the edk2-firmware recipe to do the heavy lifting.

Change-Id: I890ea41d7d1068d74a541c06411aad894728f44d
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-01 15:52:34 -04:00
Diego Sueiro 8b123ffe85 kas: Add fvp-baser-aemv8r64 build
Issue-Id: SCM-2121
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: I983b0a433be9087663006cce366631815759febe
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-31 08:53:44 -04:00
Diego Sueiro 885415312b arm-bsp/machine: Introduce fvp-baser-aemv8r64 machine and its BSP
This patch adds the fvp-baser-aemv8r64.conf machine definition for the
FVP BaseR AEMv8r64 Platform alongside the following BSP components:

* boot-wrapper-aarch64
* Kernel: linux-yocto-5.10
* Devicetree for bootstrapping
* wic image

Issue-Id: SCM-2121
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: Ia9e400db8c78e5e57a6fa2241b81fdd42a00dd53
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-31 08:53:44 -04:00
Diego Sueiro 16b93fa033 arm-bsp/linux: Introduce FVP common config fragment
Issue-Id: SCM-2121
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: Ic829801d2d32d6702f49adcd79f0f24a4595bbe1
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-31 08:53:44 -04:00
Diego Sueiro 3032b80ed3 arm-bsp/linux: Introduce arm64 generic config fragment
Issue-Id: SCM-2121
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: I6bead3d86747874af5db3a4d6ae57b74abf4f796
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-31 08:53:44 -04:00
Diego Sueiro d1cb358f52 arm-bsp/arch: Introduce support for armv8r64 arch
We are temporarily using armv8-4a until GCC 11 is released and supported by
oe-core.

Issue-Id: SCM-2121
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: I7e41105a1e99f5a71ea927d1b84c9a9fa9762aaf
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-31 08:53:44 -04:00
Diego Sueiro 7b0e704dfd arm-bsp/arch: Introduce support for armv8-4a arch
Issue-Id: SCM-2121
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: Ieaf6b41fddb819e32a40c641ab3f6231fb1de9e6
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-31 08:53:44 -04:00
Nathan Dunne f65c5c4217 autonomy/docs: Documentation updates and fixes
Issue-Id: SCM-2038
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Ida94958b63c78097be6402be019d65a80260f297
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-31 08:53:44 -04:00
Ross Burton a52d805faf CI: move utility tasks to prep so they don't cause a fetch
Re-order the tasks so that the utility tasks don't cause update-repos to
run.

Change-Id: I86a528c98fe32e20428f9efbd5fb82c374aefc8a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-30 15:45:38 -04:00
Ross Burton d2f8a13d3c CI: maintain centralised repositories to speed fetching
Kas supports 'reference repositories' which are used as a local source
of git objects to speed up fetches.  At the beginning of the CI run we
can update these repositories once to speed up later fetches.

Change-Id: I138051fd3cf9b5675e0fa5007cd8088abd17db4e
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-30 15:45:38 -04:00
Ross Burton e5ed951abe arm/edk2-firmware: upgrade to 202102
The edk2 SRCREV is the tag, has edk2-platforms doesn't tag releases the
SRCREV is approximately the same date.

Also remove the PREFERRED_VERSION from SGI575 so it doesn't need to be
updated in the future.

Change-Id: I5ac544e70b404081bf0638a54514a412d87fb3d3
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-30 15:45:38 -04:00
Ross Burton 95087cf374 arm-bsp/scp-firmware: correct PV
These are git snapshots after 2.7.0, not 2.7.

Change-Id: I6371dd12f5d17f432839b3673331b3153c1c4b6a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-30 15:45:38 -04:00
Jack Davison e45cfb9e8f arm: Enable ptest for optee xtest
Provides a run-ptest script for running xtest under ptest-runner. This
script parses the output of xtest and converts it to Automake's test
format.

Change-Id: I7c981422034b39701ddd74e176f2f5134ae607e6
Signed-off-by: Jack Davison <jack.davison@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-30 09:08:38 -04:00
Peter Hoyes de5dc9be14 arm-autonomy/linux: Remove patches for booting Dom0 with preempt_rt
With the linux-yocto version update to 5.10.25, the following
backport patches are being removed:
0001-xen-events-reset-affinity-of-2-level-event-when-tear.patch
0002-xen-events-don-t-unmask-an-event-channel-when-an-eoi.patch
0003-xen-events-avoid-handling-the-same-event-on-two-cpus.patch

Issue-Id: SCM-2064
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Iaf313440f85ab18211cc1a786d84c1f83950699f
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-30 09:08:31 -04:00
Jon Mason 682c330600 CI: fix order
Machine order should be alphabetical

Change-Id: I83b1f1802d4db62cda7e49a591c7f26c4d22dd9a
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-30 00:02:05 -04:00
Jon Mason d6e18c885d arm/machine: add zephyr machine confs for a53
Zephyr supports QEMU based machine for Cortex a53.  Add machine confs
for this.  This enables us to verify a53 tunings.

Change-Id: I398bc5b3e8bd77b7269bba056a0f75229f04c7a7
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-26 11:15:53 -04:00
Ross Burton 8855e397bc arm/trusted-firmware-a: remove unused trusted-firmware-a 2.3
Change-Id: Ifb0bed130a6db8146f37a866385727805e00cd43
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-26 11:10:16 -04:00
Ross Burton 452bc97276 arm/trusted-firmware-a: remove unused trusted-firmware-a 2.2
Change-Id: If2c92878e63614cfc91cf500a11fe39e5a82fe46
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-26 11:10:16 -04:00
Ross Burton 465471fbb9 arm/scp-firmware: remove unused 2.6 version
Change-Id: I3662f139ede7b60d8f0b929cbc40fbdb67be0d72
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-26 11:10:16 -04:00
Ross Burton e37127939b arm-bsp/trusted-firmware-a: upgrade SGI575 to trusted-firmware-a 2.4
Change-Id: I7a3e50a0f5558a135b318d70d6d75eefc570ea2f
Tested-by: Thomas Abraham <thomas.abraham@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-26 11:10:16 -04:00
Damodar Santhapuri 205e4bb760 arm-bsp/juno: move scp-firmware version from 2.6 to 2.7
Move scp-firmware version to 2.7 for juno platform

Change-Id: I7ff1132c1e6a6fee047a268da2d991f81074e672
Signed-off-by: Damodar Santhapuri <damodar.santhapuri@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-26 11:10:16 -04:00
Damodar Santhapuri e6770c2160 arm-bsp/juno: move tf-a version from 2.3 to 2.4
Move trusted-firmware-a version to 2.4 for juno

Change-Id: Ib6e6e5537a7ecb2246d3f96b4beb8893cea605dc
Signed-off-by: Damodar Santhapuri <damodar.santhapuri@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-26 11:10:16 -04:00
Luca Fancellu 92da257b83 arm-autonomy/linux-arm-autonomy: Fix Dom0 boot issue with preempt_rt kernel
To fix Dom0 with PREEMPT_RT kernels older than 5.10.24, backport the
following patches:
    0001-xen-events-reset-affinity-of-2-level-event-when-tear.patch
    0002-xen-events-don-t-unmask-an-event-channel-when-an-eoi.patch
    0003-xen-events-avoid-handling-the-same-event-on-two-cpus.patch

Also, add the following fix (waiting to be merged upstream):
    0004-xen-evtchn-Change-irq_info-lock-to-raw_spinlock_t.patch

Issue-Id: SCM-2147
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
Change-Id: I0b3a93139b0229ceb6001d87b545704b9bfc581e
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-26 11:10:01 -04:00
Peter Hoyes 66939c8f35 arm-autonomy/n1sdp: Remove support for linux-linaro-arm_5.4
* Remove linux-linaro-arm and associated patches
 * Use linux-yocto for N1SDP

Issue-Id: SCM-1506
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I6e0ebf7de42af98e7427132590fe813c1703d1c6
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-26 09:27:25 -04:00
Nathan Dunne 943dd5943a arm-autonomy/images: Introduced xenguest-extern-guests recipe
Seperated guest inclusion for image into seperate recipe, allowing
a do_install task to be used rather than directly copying from the
local path.

This allows all bitbake fetcher types to be used rather than only
local files. Alternate fetchers are enabled through parsing
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS with set_src_uri_from_var.bbclass

Issue-Id: SCM-2225
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Iff5483926a5cde8ce7519da60f1b9119946a7f4e
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-25 09:33:22 -04:00
Nathan Dunne 8195b2c953 arm-autonomy/docker: Updated fetcher to use set_src_uri_from_var.bbclass
Use new class to parser CONTAINER_IMAGE_FILES variable and add entries to
the SRC_URI, as well as to generate the manifest.

Issue-Id: SCM-2225
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Idd34f564844c725f1b38a20e1e33d9aba6195e43
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-25 09:33:22 -04:00
Nathan Dunne 5e3d09e234 arm-autonomy/classes: Introduced set_src_uri_from_var.bbclass
Introduced set_src_uri_from_var.bbclass to add entries to the
SRC_URI based on a named variable, and generate a manifest
file alongside fetched items containing a number of parameters
for each entry.

Parameters can have an optional default value, or cause an error
if omitted.

Issue-Id: SCM-2225
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Ia85b3f4bc3fa666fa7e7aec2d670979ac9348f52
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-25 09:33:22 -04:00
Nathan Dunne 1a77ae9d5f arm-autonomy/u-boot: Modified kernel_addr for fvp-base with xen
Modified the default booti command for fvp-base with xen to boot
into xen at 0x84000000, rather than requiring the user to break
into the u-boot prompt.

Issue-Id: SCM-2195
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I91f324ce77716474596a78f97e74f432969d9803
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-25 09:33:08 -04:00
Ross Burton e74b3c2f24 arm-bsp/corstone500: use trusted-firmware-a 2.4
Change-Id: Ie3014bdb07dc4f9e6ba28750fda7b5408fb7508a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-24 08:58:44 -04:00
Ross Burton 7fd85df7d7 arm-bsp/corstone700: use trusted-firmware-a 2.4
Move to the release of 2.4 instead of a snapshot between 2.3 and 2.4

Change-Id: Ie7bd5a8de310186de14bee9e8f10c1aaae6194e6
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-24 08:58:44 -04:00
Ross Burton e875122778 arm/edk2-firmware: support extra arguments passed to build
Add EDK2_EXTRA_BUILD which is passed to build, so that recipes can add
more arguments to e.g. enable modules.

Change-Id: I10d0fcb92e823be79ccb8c2bd47e40694c1bfbd9
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-24 08:58:44 -04:00
Ross Burton 79d60476bb arm/edk2-firmware: clean up build invocation
Add some comments to make it clear what variables are being passed as
what arguments to build.

The build tool is on PATH, so there's no need to use an absolute path.

Change-Id: If9229d4927205e1b9a9a0bf7f7526e33006a03fd
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-24 08:58:44 -04:00
Ross Burton 01a13b11ad arm/hafnium: refuse to build on non-x86-64 hosts
For reasons, hafnium doesn't use host binaries for stuff like GN, Ninja,
Clang, GCC, or Qemu. Instead it ships binaries that it uses during the
build, but these binaries are only available for x86-64.

Attempts to use external tools (so the recipe can just DEPENDS as usual)
were not successful (clang being the problem) so just forcible stop the
recipe building on anything but x86-64 for now.

Change-Id: I144309d15fa1265b2b105981cd2bfcd376aab7ad
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-23 09:47:18 -04:00
Jon Mason ac1dc0b894 arm: remove python3-intelhex
python3-intelhex is now upstream.  Remove this and use that one.
musca already has a dependency on meta-python.  So no need for new deps
to use the existing one.

Change-Id: I7a586db3a3a3b653656366c34c990d52c0fd4f7c
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-22 09:08:59 -04:00
Khasim Mohammed 950c68dbab arm-bsp/n1sdp/trusted-firmware-a: bump to latest master branch
The current version is 2.4, there are quite a few new features added to the master
branch of the repository and these are required for N1SDP.

Change-Id: If45402b567b786b072583c13ee9fe95bb52d27bd
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-18 09:00:34 -04:00
Khasim Mohammed 61291f6d80 arm-bsp/n1sdp/scp-firmware: bump to latest master branch
SCP firmware recipes are updated to build latest SCP firmware,
the previous release version is 2.7.0.

New features required for N1SDP are integrated in SCP firmware repository, this mandates
us to migrate to latest master.

Change-Id: I1fb44ed790ca17f713333a0e371dce10c9399424
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-18 09:00:34 -04:00
Ross Burton 4f1f77d660 layers: add hardknott to compatible release branches
Upstream oe-core is preparing to be the Hardknott release, so add
hardknott to our compatible release list.

Once hardknott is public we should remove gatesgarth.

Change-Id: Ia5c59e703910db96a3967a1ecad074ac80d03ee9
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-16 19:00:10 -04:00
Jon Mason 403de1121e arm/machine: create generic-arm64 machine
Create a generic Arm64 system for creating a SystemReady file system.
Due to it being as generic as possible, the image created
by this should run on any hardware that already has the requisite
firmware present.

Change-Id: Ie0d71f91145311e90d228bc403e653a7ef059838
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-16 08:22:58 -04:00
Jon Mason d4f7fd1788 arm/machine: Create QEMU SBSA machine
Add a QEMU machine for Server Base System Architecture (SBSA)
development.

Change-Id: Ic4e286a6583b38aee2a78ab4b53669048136f1a1
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-16 08:22:58 -04:00
Jon Mason f8d65dddc8 arm: tf-a and edk2 cleanups
Do some preparatory moving of code for add QEMU SBSA machine support.
Pulling out the qemuarm64 specific enablement from the universal inc
file into a bbappend.

Change-Id: I445132337f7851d666214f87e3250b2f0db84406
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-16 08:21:35 -04:00
Richard Neill debff92415 arm-autonomy/linux-arm-autonomy: Drop mainlined kernel patch for xenbus probe
The xenbus_probe patch to fix xen initialisation was mainlined in yocto-linux
v5.10.17. As oe-core has upgraded past this version, the patch can now be
dropped.

Issue-Id: SCM-2263
Signed-off-by: Richard Neill <richard.neill@arm.com>
Change-Id: I40e154cdc4dbabfa531a6886d724ecd400657dd9
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-15 22:59:26 -04:00
Ross Burton 67faf6c7dc CI: add qemuarm and qemuarmv5
Change-Id: Ie5e1fdf0870ed578faaf6ca2d6c6e73bad340f1e
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-12 11:37:47 -05:00
Peter Hoyes 4f8766b081 arm-bsp/linux: Add support for linux-yocto-rt for N1SDP
* Enable linux-arm-platforms.inc for N1SDP
 * Create n1sdp-preempt-rt.scc config
 * Disable KVM as incompatible with preempt-rt
 * Disable kconf audit warnings as preempt-rt.scc clashes with
   defconfig

Issue-Id: SCM-1506
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I4f9c61c7fe2400858578576aad7c5d1c958e9a2e
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-12 09:14:12 -05:00
Nathan Dunne a949ebfd06 kas: Added yaml to test xen support in meta-gem5
Created yaml file "gem5-arm64-xen.yml" to build the target xen-image-minimal
for gem5, with required DISTRO_FEATURES 'xen' and 'virtualization'.

Issue-Id: SCM-2091
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: If21d446ca36ba01657d6b48e4b3370e9d905fd1b
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-11 09:26:19 -05:00
Nathan Dunne a82ed3cfc9 arm-autonomy: Moved dynamic-layers/meta-gem5 to meta-gem5
Gem5 xen support in meta-arm-autonomy moved to meta-gem5 under
dynamic-layers/meta-virtualization. Any dependencies on 'arm-autonomy-host'
or 'arm-autonomy-guest' in DISTRO_FEATURES replaced with 'xen'.

Issue-Id: SCM-2091
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Ia2db68e2cd88c4277e8edc213aebb88d90c0cd23
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-11 09:26:19 -05:00
Nathan Dunne 255ca59858 arm-autonomy: replace xen distro feature dependencies with arm-autonomy-host
Features in meta-arm-autonomy should depend on the 'arm-autonomy-host'
DISTRO_FEATURES entry rather than 'xen'

Issue-Id: SCM-2040
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Ib39b761827dbeaf80635c748e6fc3a6d6109a1a1
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-11 09:26:19 -05:00
Nathan Dunne 2bc44548b9 arm-autonomy/host-image-minimal: use XENGUEST_MANAGER_GUEST_DIR in image recipe
Created conf/xenguest.conf which defines XENGUEST_MANAGER_GUEST_DIR for both
arm-autonomy-host-image-minimal and xenguest-manager to ensure the value is
aligned.

Issue-Id: SCM-2168
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I9cd5a351b5910bb122b275f47d542798b2df7b1f
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-11 09:26:19 -05:00
Nathan Dunne 1682eb1f44 arm-autonomy/containers: Allow multiple docker images to be included
Added docker_extern_containers bbclass that installs external docker images
that have been exported. The import-docker-image recipe has been renamed to
import-docker-containers and updated to install a new init script that imports
all of the docker containers when the image boots. The new init script now
attempts to start the docker daemon if it is not already running.

Issue-Id: SCM-1811
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Icd8222775ca9f640856a4ad4b51b18de17e5680d
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-11 09:26:19 -05:00
Nathan Dunne 7c1cb547b9 arm-autonomy/xenguest: Generate xenguest.env containing variable values
Added task "do_deploy_xenguestenv" to xenguest_image.bbclass which creates
intermediary files for each recipe that inherits xenguest_image. These files
are merged into the main xenguest.env file in DEPLOY_DIR_IMAGE by the task
"do_merge_xenguestenv" in image_types_xenguest.bbclass, which has a dependency
on all do_deploy_xenguestenv in recipes it depends on.

Variables to write to the file are listed in XENGUEST_IMAGE_VARS, and any
extra variables in child recipes should be added to XENGUEST_IMAGE_VARS_EXTRA

xenguest-image had to be renamed xenguest_image to use EXPORT, since dash is
illegal in bash function names.

Issue-Id: SCM-2035
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I6fe45b8a5db6eb7a757c6150515da0b4de8a7205
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-11 09:26:19 -05:00
Jon Mason 4865c69658 arm/qemuarm64-secureboot: removed unused -dev kernel
The change of the qemuarm64-secureboot kernel to the generic one didn't
remove the no longer necessary kernel.

Change-Id: Id6d49084e2bee0956b986958a5d990f9ec41ea5a
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-09 14:51:08 -05:00
Peter Hoyes 676caf30d0 arm-autonomy/linux: Move linaro recipes to arm-autonomy layer
The n1sdp has been upgraded to the linux-yocto 5.10 kernel in
meta-arm-bsp, but Xen + PREEMPT_RT is currently broken in 5.10, so
autonomy builds cannot upgrade.

Therefore, move the linux-linaro-arm configuration and recipes to
meta-arm-autonomy as they are now only required for autonomy
builds.

Issue-Id: SCM-2185
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Ibe918bc39ffef0d9c92c19ed0a0815c83e48a2be
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-09 14:44:17 -05:00
Peter Hoyes 5d401b9a77 arm-autonomy/n1sdp: Use anonymous function to set kernel provider
Only set PREFERRED_PROVIDER_virtual/kernel in arm-autonomy to
linux-linaro-arm if it is set to linux-yocto. Allows it to be
modifed from local.conf, e.g. for RT builds.

Issue-Id: SCM-2185
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Ied871389ccaa017437babb4f0cb48d23862eb7bd
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-09 14:44:17 -05:00
Peter Hoyes 214e3eb43a arm-bsp/linux: Include standard.scc for n1sdp builds
Follow same pattern as juno and fvp-base, by including
arm-platforms-kmeta and creating a scc file for n1sdp-standard.
Without this, warnings are being generated when including scc
fragments from other layers.

Issue-Id: SCM-2130
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Ibf7827c86bc59c728773720e510b44d02b837c1b
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-09 14:44:17 -05:00
Khem Raj aaaf3fac58 optee: Check for meta-clang for TOOLCHAIN variable
This covers the case when meta-clang is not in layers but TOOLCHAIN
variable is defined ( via config metadata e.g. local.conf ), the value
for TOOLCHAIN should be discarded in this case.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Jon Mason <jon.mason@arm.com>
Cc: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-08 09:11:52 -05:00
Richard Neill e06ae8431c arm-autonomy/xen: remove patches that have been mainlined in xen 4.14.1
Remove the 4 patches from recipes-extended/xen/xen_4.14.bbappend that
have been integrated in xen 4.14.1

Issue-Id: SCM-2133
Signed-off-by: Richard Neill <richard.neill@arm.com>
Change-Id: If38262d17699794eb600b11e131c168ed4de4391
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-08 09:11:52 -05:00
Richard Neill d0de844df6 arm-autonomy: Add meta-networking dependency to autonomy layer config
meta-arm-autonomy requires the bridge-utils package, which is provided by the
meta-openembedded/meta-networking layer. This patch adds the explicit
dependency.

Issue-Id: SCM-2166
Signed-off-by: Richard Neill <richard.neill@arm.com>
Change-Id: I3a43eb78fe1f40a9a2fb5116b5dbaf3ebfc9af7d
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-04 15:16:45 -05:00
Anders Dellien af36a66128 arm-bsp/fvp-base*: Fix the MPIDR values in the device tree
The MPIDR values are incorrect, which means that only two CPUs start.
With this patch, all 8 CPUs start.

Change-Id: I4baa8738948ec756d6902bc75d0a56edf15e23f8
Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-04 15:16:30 -05:00
Richard Neill 9b830fbd97 arm-autonomy/linux-arm-autonomy: Add Xen per-cpu address translation patch
Adds a kernel patch to avoid Xen guest initialisation failure when converting a
virtual address to a frame number when the initial address space has a
non-contiguous physical layout.

The patch is mainlined for kernel versions >= 5.9, so we only apply it for
earlier versions.

Issue-Id: SCM-1910
Signed-off-by: Richard Neill <richard.neill@arm.com>
Change-Id: I3fd2aef88f57c928400389b6c4bb0b5eb5666e48
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-03 15:09:44 -05:00
Richard Neill 856291f071 arm-autonomy/linux-arm-autonomy: Drop XenStore initialisation patch
With the linux-yocto version upgrade, the xenstore initialisation patch is no
longer necessary.

Signed-off-by: Richard Neill <richard.neill@arm.com>
Change-Id: I38d81172d5da97a87d41a76f26fe81d5c3b3f83e
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-02 09:13:58 -05:00
Peter Hoyes a915ff3931 arm-autonomy/xenguest: Fix issues raised by shellcheck
Ignore issues in xenguest-manager and xenguest-mkimage as these
will soon be rewritten.

Issue-Id: SCM-1526
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I733b4bfaaa5002f7a64c577e16548af62c425ebf
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-03-01 19:26:51 -05:00
Diego Sueiro b4659361b3 arm-bsp/fvp-base/u-boot: Set DRAM to 4G to match with kernel devicetree
Add 0001-vexpress64_fvp-Set-DRAM-to-4G-to-match-with-kernel-d.patch backport
patch for u-boot 2021.01.

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: I0c3d48fcf43ff3eab9b5a547d8d792572908e978
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-27 11:02:19 -05:00
Anders Dellien 50850e8eca arm-bsp: fvp-base-arm32: Correct load address for device tree
This commit ensures that we are using the device tree from the
Yocto build and not the one bundled within the FIP image.

Change-Id: I9592550f24867b04381e4eb962e3d942286bf480
Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-27 11:02:19 -05:00
Anders Dellien 9eeeda7169 arm-bsp/fvp-base*: move to u-boot 2021.01
Move both FVP platforms to u-boot 2021.01

Change-Id: I764ff964025bb1a0266f4c91469372ed5ffffde2
Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-27 11:02:19 -05:00
Diego Sueiro d38e10e58b arm-autonomy: Fix xenbus probe for guest kernels < 5.10.17
The arm64-autonomy-guest kernel from commit 3499ba8198ca ("xen: Fix event
channel callback via INTX/GSI") are hanging at `xen🎈 Initialising
balloon driver`.

The arm-autonomy-guest kernels older than 5.10.17 need to backport the
0001-arm-xen-Don-t-probe-xenbus-as-part-of-an-early-initc.patch in order
to be able to boot.

Issue-Id: SCM-2151
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: I74f58366f42733be4f67ab3841584efa1636abbb
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-18 22:49:51 -05:00
Diego Sueiro 0d50124e51 arm-autonomy: Fix XenStore initialisation for host kernels < 5.10.13
The arm-autonomy-host kernels older than 5.10.13 need to backport the
0001-xen-Fix-XenStore-initialisation-for-XS_LOCAL.patch in order to be able to
use the `xl block-attach` and fix this issue:
```
xl block-attach 0 "phy:/dev/vg-xen-vda3/base" xvda w
libxl: error: libxl_xshelp.c:201:libxl__xs_read_mandatory: xenstore read failed: `/libxl/0/type': No such file or directory
libxl: warning: libxl_dom.c:52:libxl__domain_type: unable to get domain type for domid=0, assuming HVM
libxl: error: libxl_disk.c:314:device_disk_add: device already exists in xenstore
libxl: error: libxl_device.c:1407:device_addrm_aocomplete: unable to add device
```

This issue is not present in linux-linaro-arm[-rt] 5.4.0 used by N1SDP, hence
we do not apply this patch for it.

Issue-Id: SCM-2151
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: I1a38e22084161fb4b6028ef12443707cc566d56e
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-18 22:49:51 -05:00
Ross Burton 78c8bfdd34 arm-bsp/musca*: update TFM_PLATFORM
trusted-firmware-m 1.2.0 uses different naming for the platforms, so
update the BSPs as appropriate.

Change-Id: I3b67b629d821a6b65f39bc89db768e791f173d93
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-18 09:36:27 -05:00
Ross Burton 977c7e6613 arm/trusted-firmware-m: upgrade to 1.2.0
Upgrade trusted-firmware-m to 1.2.0.  This has been tested by executing
the integrated regression tests inside qemu for the MPS2-AN521 platform.

How the build is configured has changed:
- The build type uses the standard CMAKE_BUILD_TYPE variable
- The compiler selection is done using PACKAGECONFIG to neaten the
  argument and dependency handling.

Add PACKAGECONFIGs to enable the regression tests which can be executed
inside a qemu for quick validation.

The configure stage will fetch external dependencies by default, so tell
it where we have placed the dependencies. TF-M also requires a patched
mbedcrypto (some patches are integrated into 2.25, but not all) so apply
the patches in a do_patch[postfunc].

No longer deploy files into a redundant directory.

The QA test whitelist for text relocations appears to have been fixed
upstream, so remove.

Change-Id: I11994fd0379da0e1f115ff5af0885926d2b3a055
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-18 09:36:27 -05:00
Ross Burton a8cb17f982 arm/python3-intelhex: add recipe for new trusted-firmware-m
Until this is integrated into meta-python (patches sent), hold a copy of
python3-intelhex in meta-arm for trusted-firmware-m 1.2.

Change-Id: I3e7b765cf44b3d6db7fe066bc24415190a33c97c
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-18 09:36:27 -05:00
Ross Burton 46bb624631 arm-bsp/musca-b1: disable qemu RNG
By default runqemu adds a virtio RNG, but the Musca platform doesn't
support this.

Change-Id: I61e486f02e106a2d3bb4a7ec9ff3dd0b06c9c369
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-18 09:36:27 -05:00
Nathan Dunne fc0bed464e arm-autonomy/documentation: Update multiconfig docs with mc name requirements
Update documentation to mention that hyphens are illegal in multiconfig
conf file names

Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I0c0c16063cc66f1d0d66b5458ee0eea5da4d2ee4
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-18 09:35:28 -05:00
Sumit Garg 2c44ddd93a arm-toolchain: Drop support for GCC 9.2 toolchain
As OE core has moved to GCC 10.2 toolchain, so remove support for
legacy Arm 9.2 toolchain.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Denys Dmytriyenko <denis@denix.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-18 09:35:28 -05:00
Jon Mason 957fefc816 arm-toolchain: Update Denys' email address
Signed-off-by: Jon Mason <jon.mason@arm.com>
Acked-by: Denys Dmytriyenko <denis@denix.org>
2021-02-18 09:35:28 -05:00
Jon Mason 2720a1b32b arm-toolchain: Fix potential runtime crash
GCCv9 tree vectorization code is faulty and can cause random crashes at
runtime (when using -O3).  Add the backported patch to address this
issue.

Change-Id: If7bb0ba0720bab42e7d34f3679d988934f657392
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-12 10:07:38 -05:00
Diego Sueiro 808115fe13 arm/boot-wrapper-aarch64: Bump to the latest SHA
Issue-Id: SCM-2080
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: I823114be82efd02ff7b14fda304668e29facd092
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-12 10:07:38 -05:00
Diego Sueiro 0cec3e584d arm/gem5/boot-wrapper-aarch64: Move main recipe to meta-arm
Move boot-wrapper-aarch64 recipe from meta-gem5 to meta-arm and merge the
contents of the .bb and .inc into a single recipe file.

Also, create a boot-wrapper-aarch64_%.bbappend for the gem5-arm64 machine.

Updated documentation for gem5-arm64 where meta-arm-toolchain and meta-arm
layers need to be included in the bblayers.conf.

Change-Id: Ia8193f4f0bf98069edcbf1661cb3e9b2105d12a3
Issue-Id: SCM-2080
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-12 10:07:38 -05:00
Jon Mason aa63e31b6e kas: microbit-v1 testing
Change-Id: I8043c7be32a1e4029e73c3c9f603ae77c78ddf3c
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-10 21:58:30 -05:00
Jon Mason fdcf7b7b3b arm/microbit-v1: Fix build break
KAS is seeing build breaks on microbit-v1.  This can be fixed by either
setting the distro to zephyr or using newlib.  Opting for the latter to
match musca machines.

Change-Id: I25f1cca3f7054f6c44974877350f8612643d55e6
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-10 21:58:30 -05:00
Jon Mason d3c35b4a0e arm-bsp: create u-boot 2020.10 to resolve warning
Poky, etc master branches updated the u-boot recipes to use 2021.1,
causing bbappends for 2020.07 to no longer function.  Create a temporary
recipe for 2020.10 until all the BSPs can update to support the latest
version.

Change-Id: I6046b420a8d0b3cc2125004444683ecd51f3499b
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-10 21:58:30 -05:00
Ross Burton e5523d626f kas: disable uninative to work around uninative-2.33 failures
For some mysterious reason the kernel build fails on Ubuntu hosts with the
latest uninative release. Until this is resolved we can just disable
uninative.

Change-Id: I3b2583106844d43e0ef14cdeda24ef8d5d1ae117
Signed-off-by: Ross Burton <ross.burton@arm.com>
2021-02-10 17:07:11 +00:00
Arunachalam Ganapathy a9644d39c5 arm-bsp/tc0: add Theodul DSU support
- Adds patches required to support Theodul DSU in optee-os, hafnium
- Updates SHA of TF-A, SCP with revision that has Theodul DSU support

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I62f0990b7de919839be9ab0e3234914624c8afde
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-09 11:12:06 -05:00
Arunachalam Ganapathy 1f872c3c83 arm-bsp/linux: add asymmetric AArch32 EL0 support for TC0
This adds patches for asymmetric AArch32 EL0 configuration support for
android11-5.4-lts kernel. And enables CONFIG_ASYMMETRIC_AARCH32 and
disables CONFIG_KVM in TC0 defconfig.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: Iab94b5c48b60aca4a71267ba1be1cb1836002d10
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-09 11:12:06 -05:00
346 changed files with 9320 additions and 25024 deletions
+102 -25
View File
@@ -1,37 +1,57 @@
# Use our custom Crops-derived image
image: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/yocto-builder:master
image: ghcr.io/siemens/kas/kas
# 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
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
# 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
#
# Prep stage, update repositories once
#
update-repos:
extends: .setup
stage: prep
script:
- flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
get-binary-toolchains:
extends: .setup
stage: prep
script:
- ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR
#
# First phase, bootstrap and machine coverage
# Bootstrap stage, bootstrap and machine coverage
#
# Build a number of native tools first to ensure the other builders don't race
@@ -43,15 +63,24 @@ 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
#
# Validate layers are Yocto Project Compatible
check-layers:
extends: .setup
coverage: '/Coverage: \d+/'
script:
- kas shell --update --force-checkout ci/base.yml:ci/meta-python.yml --command \
"$CI_PROJECT_DIR/ci/check-layers.py $CI_PROJECT_DIR/ci/check-layers.yml $CI_PROJECT_DIR $KAS_WORK_DIR"
corstone500:
extends: .build
@@ -67,18 +96,33 @@ fvp-base:
fvp-base-arm32:
extends: .build
fvp-base-arm32/external-gcc-arm32:
fvp-base-arm32/external-gccarm:
extends: .build
fvp-baser-aemv8r64:
extends: .build
gem5-arm64:
extends: .build
gem5-arm64-xen:
extends: .build
gem5-atp-arm64:
extends: .build
generic-arm64:
extends: .build
juno:
extends: .build
juno/clang:
extends: .build
microbit-v1:
extends: .build
musca-b1:
extends: .build
@@ -91,16 +135,28 @@ n1sdp:
n1sdp/armgcc:
extends: .build
qemuarm64-secureboot:
qemu-cortex-a53:
extends: .build
qemuarm64-secureboot/clang:
qemuarm/testimage:
extends: .build
qemuarm64-secureboot/clang/musl:
qemuarm64-sbsa:
extends: .build
qemuarm64-secureboot/musl:
qemuarm64-secureboot/testimage:
extends: .build
qemuarm64-secureboot/clang/testimage:
extends: .build
qemuarm64-secureboot/clang/musl/testimage:
extends: .build
qemuarm64-secureboot/musl/testimage:
extends: .build
qemuarmv5/testimage:
extends: .build
sgi575:
@@ -114,26 +170,47 @@ 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:
- find $SSTATE_DIR -type f -atime +30 -delete
# 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
View File
+4 -3
View File
@@ -5,7 +5,7 @@ distro: poky
defaults:
repos:
refspec: master
refspec: hardknott
repos:
meta-arm:
@@ -22,6 +22,7 @@ repos:
env:
BB_LOGCONFIG: ""
TOOLCHAIN_DIR: ""
local_conf_header:
base: |
@@ -29,12 +30,12 @@ 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: |
noptest: |
DISTRO_FEATURES_remove = "ptest"
machine: unset
+43
View File
@@ -0,0 +1,43 @@
#! /usr/bin/env python3
import argparse
import pathlib
import re
import subprocess
import sys
import yaml
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("config", type=argparse.FileType())
parser.add_argument("metaarm", type=pathlib.Path, help="Path to meta-arm")
parser.add_argument("others", type=pathlib.Path, help="Path to parent of dependencies")
args = parser.parse_args()
config = yaml.safe_load(args.config)
layers = config["layers"]
dependencies = config["dependencies"]
found_layers = [p for p in args.metaarm.glob("meta-*") if p.is_dir()]
print(f"Testing {len(layers)} layers: {', '.join(layers)}.")
print(f"Found {len(found_layers)} layers in meta-arm.")
print()
cli = ["yocto-check-layer-wrapper",]
cli.extend([args.metaarm / layer for layer in layers])
cli.append("--dependency")
cli.extend([args.others / layer for layer in dependencies])
passed = 0
process = subprocess.Popen(cli, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
while True:
line = process.stdout.readline()
if process.poll() is not None:
break
print(line.strip())
if re.search(r"meta-.+ PASS", line):
passed += 1
print(f"Coverage: {int(passed / len(found_layers) * 100)}%")
sys.exit(process.returncode)
+7
View File
@@ -0,0 +1,7 @@
layers:
- meta-arm
- meta-arm-bsp
- meta-arm-toolchain
- meta-gem5
dependencies:
- meta-openembedded/meta-oe
@@ -14,7 +14,7 @@ machines = metaarm.glob("meta-*/conf/machine/*.conf")
machines = set(p.stem for p in machines)
# All kas files
kas = metaarm.glob("kas/*.yml")
kas = metaarm.glob("ci/*.yml")
kas = set(p.stem for p in kas)
missing = machines - kas
+2 -1
View File
@@ -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 ==============================
View File
@@ -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 = "${TOOLCHAIN_DIR}/${TARGET_ARCH}"
+7
View File
@@ -0,0 +1,7 @@
header:
version: 9
includes:
- base.yml
machine: fvp-baser-aemv8r64
+28
View File
@@ -0,0 +1,28 @@
header:
version: 9
includes:
- base.yml
- meta-python.yml
repos:
meta-arm:
layers:
meta-gem5:
meta-openembedded:
url: https://git.openembedded.org/meta-openembedded
layers:
meta-oe:
meta-filesystems:
meta-networking:
meta-virtualization:
url: git://git.yoctoproject.org/meta-virtualization
machine: gem5-arm64
local_conf_header:
meta-virt:
DISTRO_FEATURES_append = " virtualization xen"
target:
- xen-image-minimal
+15
View File
@@ -0,0 +1,15 @@
header:
version: 9
includes:
- gem5-arm64.yml
repos:
meta-arm:
layers:
meta-atp:
machine: gem5-atp-arm64
target:
- atp-native
- core-image-minimal
+6
View File
@@ -0,0 +1,6 @@
header:
version: 9
includes:
- base.yml
machine: generic-arm64
+52
View File
@@ -0,0 +1,52 @@
#!/bin/bash
set -u
HOST_ARCH=$(uname -m)
VER="10.2-2020.11"
DOWNLOAD_DIR=$1
TOOLCHAIN_DIR=$2
# These should be already created by .bitlab-ci.yml, but do here if run outside of that env
mkdir -p $DOWNLOAD_DIR $TOOLCHAIN_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 [ ! -f $DOWNLOAD_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz ]; then
continue
fi
if [ -d $TOOLCHAIN_DIR/$i ]; then
echo "$TOOLCHAIN_DIR/$i EXISTS!"
MANIFEST=$(ls $TOOLCHAIN_DIR/$i | grep txt)
if [[ $MANIFEST != $VER-$HOST_ARCH-$i-none-linux-gnu*.txt ]]; then
echo "Removing old $MANIFEST for $VER-$HOST_ARCH-$i-*.txt toolchain"
rm -rf $TOOLCHAIN_DIR/$i
fi
fi
if [ ! -d $TOOLCHAIN_DIR/$i ]; then
tar -C $TOOLCHAIN_DIR -axvf $DOWNLOAD_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz
mv $TOOLCHAIN_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*/ $TOOLCHAIN_DIR/$i
fi
done
+2 -2
View File
@@ -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}")
View File
View File
+10
View File
@@ -0,0 +1,10 @@
header:
version: 9
includes:
- base.yml
- meta-zephyr.yml
machine: microbit-v1
target:
- zephyr-philosophers
View File
View File
+10
View File
@@ -0,0 +1,10 @@
header:
version: 9
includes:
- base.yml
- meta-zephyr.yml
machine: qemu-cortex-a53
target:
- zephyr-philosophers
+6
View File
@@ -0,0 +1,6 @@
header:
version: 9
includes:
- base.yml
machine: qemuarm
@@ -3,9 +3,9 @@ header:
includes:
- base.yml
machine: qemuarm64-secureboot
machine: qemuarm64-sbsa
target:
- core-image-base
- perf
- optee-examples
- sbsa-acs
+16
View File
@@ -0,0 +1,16 @@
header:
version: 9
includes:
- base.yml
machine: qemuarm64-secureboot
local_conf_header:
bugs: |
# Only ping until errors can be resolved
TEST_SUITES = "ping"
target:
- core-image-base
- perf
- optee-examples
+11
View File
@@ -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"
View File
View File
+17
View File
@@ -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
+43
View File
@@ -0,0 +1,43 @@
#! /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():
print("Updating %s..." % repo)
subprocess.run(["git", "-C", repodir, "fetch"], check=True)
else:
print("Cloning %s..." % repo)
subprocess.run(["git", "clone", "--bare", repo, repodir], check=True)
+32
View File
@@ -0,0 +1,32 @@
header:
version: 9
distro: poky
machine: fvp-baser-aemv8r64
defaults:
repos:
refspec: hardknott
repos:
meta-arm:
layers:
meta-arm:
meta-arm-bsp:
meta-arm-toolchain:
poky:
url: https://git.yoctoproject.org/git/poky
layers:
meta:
meta-poky:
local_conf_header:
base: |
CONF_VERSION = "1"
PACKAGE_CLASSES = "package_ipk"
PACKAGECONFIG_remove_pn-qemu-system-native = "gtk+ sdl"
EXTRA_IMAGE_FEATURES_append = " debug-tweaks"
target:
- core-image-minimal
+18 -17
View File
@@ -4,8 +4,8 @@ meta-arm-autonomy Yocto Layer
Introduction
------------
This layer provides an hypervisor based solution (currently based on Xen) for
autonomous system. It contains recipes and classes to build host and guests
systems.
autonomous system. It contains recipes and classes to build host and guest
images.
To start using this layer, please check the
[Quick Start Guide](documentation/arm-autonomy-quickstart.md).
@@ -16,13 +16,14 @@ This layer depends on several other Yocto layers:
* meta-openembedded (https://git.openembedded.org/meta-openembedded)
* poky (https://git.yoctoproject.org/poky)
* meta-virtualization (https://git.yoctoproject.org/meta-virtualization)
* meta-networking (git://git.openembedded.org/meta-openembedded)
Distribution Features
---------------------
This layer is adding the following Yocto DISTRO_FEATURES:
This layer adds the following Yocto DISTRO_FEATURES:
* arm-autonomy-host: this feature activates functionalities required to build
an autonomy host system. It is doing the following:
an autonomy host system. It has the following effects:
- add 'xen' and 'ipv4' to DISTRO_FEATURES.
- add xen backend drivers to linux kernel configuration.
- To reduce the root filesystem image size the kernel image is not installed.
@@ -43,40 +44,40 @@ its documentation.
Those documentation files should be checked for variables:
- [xen-devicetree](documentation/xen-devicetree.md)
- [xenguest-manager](documentation/xenguest-manager.md)
- [xenguest-network-bridge](documentation/xenguest-network-bridge.md)
- [xenguest-network](documentation/xenguest-network.md)
BSPs
----
This layer is adding the following machines:
This layer adds the following machine:
* arm64-autonomy-guest: this machines creates a minimal BSP suitable to be used
* arm64-autonomy-guest: This machine creates a minimal BSP suitable to be used
as an autonomy guest. It is in fact only activating ARM64 architecture and
SMP in the linux kernel and is enabling the DISTRO_FEATURE
arm-autonomy-guest.
'arm-autonomy-guest'.
Images
------
This layer is adding the following images:
* arm-autonomy-host-image-minimal: this image includes all elements required
to create a minimal arm-autonomy-host system. This includes xen and tools to
manage xen guests. This image depends on 'arm-autonomy-host' distribution
feature.
* arm-autonomy-host-image-minimal: This image includes all elements required
to create a minimal arm-autonomy-host system. This includes xen, and tools to
manage xen guests and xenguest images. This image depends on
'arm-autonomy-host' distribution feature.
Recipes and classes
-------------------
This layer is adding the following recipes and classes:
This layer adds the following recipes and classes:
* [xen-devicetree](documentation/xen-devicetree.md): this is a recipe to modify
* [xen-devicetree](documentation/xen-devicetree.md): This is a recipe to modify
a device tree blob to add information required to boot xen and a Dom0 linux.
* [xenguest-mkimage](documentation/xenguest-mkimage.md): this is a tool to
* [xenguest-mkimage](documentation/xenguest-mkimage.md): This is a tool used to
create and modify images to be used as Xen guests.
* [xenguest-manager](documentation/xenguest-manager.md): this is a tool to
* [xenguest-manager](documentation/xenguest-manager.md): This is a tool used to
create/remove/start/stop xen guest generated using xenguest-mkimage.
* [xenguest-network-bridge](documentation/xenguest-network-bridge.md): this
* [xenguest-network](documentation/xenguest-network.md): This
recipe add tools and init scripts to create a bridge connected to the
external network on the host and allow guests to be connected to it.
@@ -0,0 +1,115 @@
# Docker Extern Containers
#
# This class allows docker image tarballs to be installed in the rootfs
#
# The images can be selected using the variable CONTAINER_IMAGE_FILES which
# should contain a space seperated list of absolute paths or yocto urls for
# docker images that have been exported using docker export:
# - https://docs.docker.com/engine/reference/commandline/export/
#
# src_uri_parse_var.bbclass is used to parse CONTAINER_IMAGE_FILES
#
# There are 4 supported formats for CONTAINER_IMAGE_FILES entries:
#
# - http/https url
# - CONTAINER_IMAGE_FILES = "https://[url]:[port]/alpine.tar;md5sum=..."
#
# - file:// absolute local path from root
# - CONTAINER_IMAGE_FILES = "file:///containers/alpine2.tar"
#
# - file:// path relative to FILESEXTRAPATHS
# - CONTAINER_IMAGE_FILES = "file://foo/alpine3.tar"
# FILESEXTRAPATHS .= "/containers:"
#
# - plain absolute local path from root
# - CONTAINER_IMAGE_FILES = "/containers/foo/bar/alpine4.tar"
#
# It is not recommended to use other yocto URL types, as they may result in
# undefined behaviour.
#
# A semicolon seperated list of install arguments can follow each image path:
# - conname : the name that will be attached when the image is imported
# (default: [filename, without extension])
# - contag : the tag that will be attached when the image is imported
# (default: local)
# - conkeep : Flag for whether the exported container image file should be
# kept once the import has been completed
# (default: 0)
#
# Any other arguments, for example an md5sum, will be assumed to be fetch
# arguments, and will be kept when the path is added to the SRC_URI
#
# e.g. CONTAINER_IMAGE_FILES = "\
# https://[url]:[port]/alpine.tar;md5sum=[checksum];conkeep=1 \
# file:///containers/alpine2.tar;contag=latest;conname=docker2 \
# file://foo/alpine3.tar \
# /containers/foo/bar/alpine4.tar;contag=1.0;conkeep=1 "
#
# Resulting Manifest:
# ARCHIVE NAME TAG KEEP
# alpine.tar alpine local 1
# alpine2.tar docker2 latest 0
# alpine3.tar alpine3 local 0
# alpine4.tar alpine4 1.0 1
#
# Other configurable variables:
# CONTAINERS_INSTALL_DIR : The folder underneath ${WORKDIR} where the docker
# images will be stored
# (default: "/usr/share/docker/images")
# CONTAINERS_MANIFEST : The name of the manifest file containing image
# parameters, also stored in CONTAINERS_INSTALL_DIR
# (default: "containers.manifest")
# CONTAINERS_TAG_DEFAULT : Use this to change the value that will be used as
# contag if no value is provided
# (default: "local")
# CONTAINERS_KEEP_DEFAULT : Use this to change the value that will be used for
# conkeep if no value is provided
# (default: "0")
#
inherit features_check
REQUIRED_DISTRO_FEATURES = "docker"
RDEPENDS_${PN} = "packagegroup-docker-runtime-minimal"
CONTAINER_IMAGE_FILES ??= ""
CONTAINERS_INSTALL_DIR ??= "${datadir}/docker/images"
CONTAINERS_MANIFEST ??= "containers.manifest"
CONTAINERS_TAG_DEFAULT ??= "local"
CONTAINERS_KEEP_DEFAULT ??= "0"
inherit set_src_uri_from_var
SRC_URI_FROM_VAR_NAME = "CONTAINER_IMAGE_FILES"
# Define installation params
SRC_URI_FROM_VAR_MANIFEST_PARAMS = "conname=[basename] \
contag=${CONTAINERS_TAG_DEFAULT} conkeep=${CONTAINERS_KEEP_DEFAULT}"
SRC_URI_FROM_VAR_UNPACK_DIR = "containers"
# Read manifest and install container images
do_install() {
local archive name tag keep
if [ -f "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/manifest" ]; then
install -d "${D}${CONTAINERS_INSTALL_DIR}"
install -m 644 \
"${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/manifest" \
"${D}${CONTAINERS_INSTALL_DIR}/${CONTAINERS_MANIFEST}"
while read -r archive name tag keep _; do
[ -f "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/${archive}" ] ||
bbfatal "${archive} does not exist"
install -m 644 \
"${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/${archive}" \
"${D}${CONTAINERS_INSTALL_DIR}/${archive}"
done < "${D}${CONTAINERS_INSTALL_DIR}/${CONTAINERS_MANIFEST}"
fi
}
do_install[vardeps] += "CONTAINER_IMAGE_FILES"
FILES_${PN} += "${CONTAINERS_INSTALL_DIR}"
@@ -1,7 +1,7 @@
# Create a xenguest image with kernel and filesystem produced by Yocto
# This will create a .xenguest file that the xenguest-manager can use.
inherit xenguest-image
inherit xenguest_image
# We are creating our guest in a local subdirectory
# force the value so that we are not impacted if the user is changing it
@@ -63,6 +63,67 @@ IMAGE_TYPEDEP_xenguest ?= "tar"
IMAGE_TYPES_MASKED += "xenguest"
IMAGE_TYPES += "xenguest"
XENGUEST_IMAGE_RECIPE = "${PN}"
XENGUEST_IMAGE_VARS += "XENGUEST_IMAGE_RECIPE"
# Merge intermediate env files from all recipes into a single file
python do_merge_xenguestenv () {
import re
# Open final merged file in DEPLOY_DIR_IMAGE for writing, or create
outdir = d.getVar('DEPLOY_DIR_IMAGE')
with open(os.path.join(outdir,'xenguest.env'), 'w') as merged_file:
# Adds vars from xenguest_image to list
merged_env = []
xenguest_vars = d.getVar('XENGUEST_IMAGE_VARS')
for var in xenguest_vars.split():
value = d.getVar(var)
if value:
merged_env.append(var + "=" + " ".join(value.split()) + "\n")
# Resolve dependencies for this task to find names of intermediate
# .xenguestenv files
taskdepdata = d.getVar('BB_TASKDEPDATA')
task_mc = d.getVar('BB_CURRENT_MC')
task_file = d.getVar('FILE')
# See runqueue.py function build_taskdepdata
DEPS_INDEX = 3
depdata_key = task_file + ":do_merge_xenguestenv"
# If in a multiconfig, need to add that to the key
if task_mc != "default":
depdata_key = "mc:" + task_mc + ":" + depdata_key
# Retrieve filename using regex
get_filename = re.compile(r'/([^/]+\.bb):do_deploy_xenguestenv$')
env_dir = d.getVar('XENGUEST_ENV_STAGING_DIR')
for task_dep in taskdepdata[depdata_key][DEPS_INDEX]:
if task_dep.endswith(":do_deploy_xenguestenv"):
filename = re.search(get_filename, task_dep).group(1) + ".xenguestenv"
bb.note("Merging: " + filename)
try:
with open(env_dir + "/" + filename, 'r') as f:
# Eliminate duplicates
merged_env = list(set(merged_env + f.readlines()))
except (FileNotFoundError, IOError):
bb.note(" " + filename + " has no extra vars")
# Sort Alphabetically and write
merged_env.sort()
merged_file.write("".join(merged_env))
}
do_merge_xenguestenv[dirs] = "${DEPLOY_DIR_IMAGE}"
do_merge_xenguestenv[vardeps] += "${XENGUEST_IMAGE_VARS}"
do_merge_xenguestenv[vardepsexclude] += "BB_TASKDEPDATA"
do_merge_xenguestenv[recrdeptask] += "do_deploy_xenguestenv"
addtask merge_xenguestenv before do_populate_lic_deploy after do_image_complete
python __anonymous() {
# Do not do anything if we are not in the want FSTYPES
if bb.utils.contains_any('IMAGE_FSTYPES', 'xenguest', '1', '0', d):
@@ -3,7 +3,10 @@
# This is done using kernel-fitimage as model
# To activate this, kernel-xenguest must be added to KERNEL_CLASSES
inherit xenguest-image
# Add a variable name to XENGUEST_IMAGE_VARS_EXTRA if you want it to
# appear in xenguest.env when the image is deployed
inherit xenguest_image
# use a local copy to pack all together
XENGUEST_IMAGE_DEPLOY_DIR = "${WORKDIR}/tmp-xenguest"
@@ -24,7 +27,7 @@ do_assemble_xenguest_initramfs() {
rm -f ${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest
call_xenguest_mkimage pack ${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest
}
do_assemble_xenguest_initramfs[depends] += "${INITRAMFS_IMAGE}:do_image_complete"
do_assemble_xenguest_initramfs[depends] += "${INITRAMFS_IMAGE}:do_merge_xenguestenv"
kernel_do_deploy_append() {
if [ -f "${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest" ]; then
@@ -0,0 +1,224 @@
# Set SRC_URI from Variable
# This class parses a variable named in SRC_URI_FROM_VAR_NAME for entries that
# should be added to the SRC_URI
#
# There are 4 supported formats for entries:
#
# - http/https url
# - Note that a checksum (md5sum or sha256sum) must be provided for http(s)
#
# - file:// absolute local path from root
# - In this case the filename will be added to SRC_URI and the path from '/'
# added to FILESEXTRAPATHS
#
# - file:// path relative to FILESEXTRAPATHS
# - In this case the filename will be added to SRC_URI and the preceding path
# added to FILESOVERRIDES, so that the full path to the file will
# be available in FILESPATH when it is generated by combining
# FILESEXTRAPATHS and FILESOVERRIDES.
#
# - plain absolute local path from root
# - This will be treated the same as an file:// path from root. Plain paths
# must be absolute, and cannot be relative to FILESEXTRAPATHS
#
# It is not recommended to use other yocto URL types, as they may result in
# undefined behaviour.
#
# These entries will be added to the SRC_URI so that the yocto fetcher can
# unpack a copy into ${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}
#
#
# A list of arguments can follow each entry in the input variable, seperated
# by semi-colons (;). Arguments may be FETCH arguments or MANIFEST arguments.
#
# FETCH arguments will be appended to the entry in SRC_URI, for example
# "downloadfilename" to specify the filename used when storing a
# downloaded file.
# Each SRC_URI entry will automatically have the arguments
# "unpack=0;subdir=${SRC_URI_FROM_VAR_UNPACK_DIR}" added to them, so do not
# attempt to set these options.
#
# MANIFEST arguments are defined in the variable
# SRC_URI_FROM_VAR_MANIFEST_PARAMS which should be a space seperated list of
# names, each optionally followed by an equals sign (=) and a default value.
#
# The values provided for the manifest arguments will be written to the manifest
# file in ${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR} as columns, in the same
# order as they appear in SRC_URI_FROM_VAR_MANIFEST_PARAMS.
#
# For entries that do not provide a value for a manifest argument, the default
# value will be used if possible.
# If no default is availale, omitting the parameter on any item will cause
# an error.
#
# "[basename]" is a special case default that will set the value to
# the filename without the path or file extension.
#
# e.g.
# SRC_URI_FROM_VAR_MANIFEST_PARAMS="conname=[basename] contag=local conkeep"
#
# Any arguments that follow an entry in SRC_URI_FROM_VAR_NAME, that are not
# named in SRC_URI_FROM_VAR_MANIFEST_PARAMS are assumed to be FETCH arguments,
# so are added to the corresponding entry in the SRC_URI.
SRC_URI_FROM_VAR_NAME ??= ""
SRC_URI_FROM_VAR_MANIFEST_PARAMS ??= ""
SRC_URI_FROM_VAR_UNPACK_DIR ??= "items"
python __anonymous() {
parse_var = d.getVar('SRC_URI_FROM_VAR_NAME')
if not parse_var:
return
parse_var_items = d.getVar(parse_var)
if parse_var_items:
for item in parse_var_items.split(' '):
if not item:
continue
if item.startswith('/'):
# If not a Yocto URL, must be an absolute path
yocto_url = "file://" + item
else:
# Otherwise assume valid Yocto URL.
# Error case is caught later
yocto_url = item
fetcher = host = path = parm = None
try:
# Attempt to parse a Yocto URL
fetcher,host,path,_,_,parm = bb.fetch.decodeurl(yocto_url)
except:
# Something invalid is in the variable!
raise bb.parse.SkipRecipe(parse_var + \
" contains an invalid entry:\n'" + \
item + "'")
# This var is space seperated list of parameter names,
# with optional default value following an equals sign
# (name=default)
item_params_str = d.getVar('SRC_URI_FROM_VAR_MANIFEST_PARAMS')
# remove directories from path
filename = os.path.basename(path)
if "downloadfilename" in parm:
filename = parm["downloadfilename"]
item_manifest_args = {"filename": filename}
if item_params_str:
# required manifest arguments have been provided
# If no default is given add "=" for map parsing
item_params_list = [ arg + "=" if '=' not in arg
else arg
for arg in item_params_str.split(' ')
]
# Generate key value pairs of argument names and
# default values
item_params_map = dict( (name.strip(), val.strip())
for name, val in (arg.split('=')
for arg in item_params_list)
)
for argname in item_params_map:
# Iterate over required manifest arguments
argvalue = parm.pop(argname, None)
if argvalue:
# a value has been provided for this item
item_manifest_args[argname] = argvalue
else:
# No value provided, process default value
default = item_params_map[argname]
if default:
# A default value is provided
if default == "[basename]":
# use the filename without extension
default = os.path.splitext(filename)[0]
# store default value in dict
item_manifest_args[argname] = default
else:
# No default provided
raise bb.fatal(parse_var + \
" entry is missing a required parameter '" + \
argname + "':\n'" + item + "'")
# Write value to var flags to ensure data structure is preserved
# Each entry of parse_var will have a varflag where the value
# is a dictionary of argument names and values
d.setVarFlags(parse_var, {item: item_manifest_args})
src_uri_entry_suffix = ';'
# HTTP(S) fetcher must provide a checksum
if fetcher.startswith('http') and not \
( 'md5sum' in parm or 'sha256sum' in parm ):
# Ensure http/https fetchers get a checksum
raise bb.parse.SkipRecipe(parse_var + \
" entry is missing a checksum:\n'" + \
item + "'")
# add remaining fetch parameters including checksum
for arg in parm:
src_uri_entry_suffix += ";" + arg + "=" + parm[arg]
# Add default and extra parameters to SRC_URI entry
src_uri_entry_suffix += ';unpack=0;subdir=' + \
d.getVar('SRC_URI_FROM_VAR_UNPACK_DIR')
if fetcher == 'file':
# Prevent local fetcher from re-creating dir structure
filedir = os.path.split(path)[0]
if filedir.startswith('/'):
# Path is from the root
d.appendVar('FILESEXTRAPATHS', filedir + ':')
else:
# Path is relative to FILESEXTRAPATHS
d.appendVar('FILESOVERRIDES', ':' + filedir)
# Add filename without path to SRC_URI
d.appendVar('SRC_URI', ' file://' + \
filename + src_uri_entry_suffix)
else:
# Add full entry to SRC_URI
d.appendVar('SRC_URI', ' ' + fetcher + \
"://" + host + path + src_uri_entry_suffix)
}
python generate_manifest() {
parse_var = d.getVar('SRC_URI_FROM_VAR_NAME')
if not parse_var:
return
target_dir = os.path.join(d.getVar('WORKDIR'),
d.getVar('SRC_URI_FROM_VAR_UNPACK_DIR'))
# Write a manifest file containing the parameters so SRC_URI
# doesn't need to be parsed by do_install
with open (target_dir + "/manifest", 'w') as manifest_file:
manifest_args = d.getVarFlags(parse_var)
parse_var_items = d.getVar(parse_var)
if parse_var_items:
for item in parse_var_items.split():
manifest_file.write(" ".join(manifest_args[item].values())+"\n")
}
do_unpack[cleandirs] += "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}"
do_unpack[postfuncs] += "generate_manifest"
do_unpack[vardeps] += "${SRC_URI_FROM_VAR_NAME}"
@@ -30,7 +30,7 @@ XENGUEST_IMAGE_ROOT ??= "/dev/xvda1"
# Guest kernel command line arguments
XENGUEST_IMAGE_CMDLINE ??= "earlyprintk=xenboot console=hvc0 rw"
# Extra commands to add to xenguest-image when creating the image
# Extra commands to add to xenguest_image when creating the image
XENGUEST_IMAGE_EXTRA_CMD ??= ""
# Kernel binary
@@ -83,6 +83,18 @@ XENGUEST_IMAGE_DEPLOY_SUBDIR ?= "xenguest"
# - something in ${WORKDIR} if you need to clone and manipulate an image
XENGUEST_IMAGE_DEPLOY_DIR ??= "${DEPLOYDIR}"
# These vars are used by image_types_xenguest.bbclass to generate the
# xenguest.env file. In a recipe that inherits this class and extra variables
# that should be included in xenguest.env need to be added to
# XENGUEST_IMAGE_VARS_EXTRA
XENGUEST_IMAGE_VARS ?= "\
MACHINE DISTRO DISTRO_VERSION DISTRO_FEATURES TUNE_FEATURES TARGET_FPU \
IMAGE_FEATURES INITRAMFS_IMAGE_BUNDLE INITRAMFS_IMAGE \
XENGUEST_IMAGE_MEMORY_SIZE XENGUEST_IMAGE_NUM_VCPUS XENGUEST_IMAGE_AUTOBOOT \
XENGUEST_IMAGE_ROOT XENGUEST_IMAGE_CMDLINE XENGUEST_IMAGE_EXTRA_CMD \
XENGUEST_IMAGE_KERNEL XENGUEST_IMAGE_DISK_SIZE XENGUEST_IMAGE_DISK_DEVICE \
XENGUEST_IMAGE_DISK_PARTITIONS XENGUEST_IMAGE_NETWORK_TYPE"
#
# Wrapper to call xenguest-mkimage
# It is using XENGUEST_IMAGE_DEPLOY_DIR and XENGUEST_IMAGE_DEPLOY_SUBDIR
@@ -167,7 +179,38 @@ xenguest_image_create() {
fi
}
#
XENGUEST_ENV_STAGING_DIR ??= "${STAGING_DIR}/${MACHINE}/xenguestenv"
# Create an intermediary file containing all variables used to by a
# particular recipe that inherits this class
# File will contain the values of all variables listed in:
# XENGUEST_IMAGE_VARS_EXTRA
python do_deploy_xenguestenv () {
xenguest_vars = d.getVar('XENGUEST_IMAGE_VARS_EXTRA')
if not xenguest_vars:
return
outdir = d.getVar('XENGUEST_ENV_STAGING_DIR')
# Writes file to tmp/sysroots/${MACHINE}/xenguestenv/ by default
filename = os.path.basename(d.getVar('FILE')) + '.xenguestenv'
with open(os.path.join(outdir, filename), 'w') as envf:
for var in xenguest_vars.split():
value = d.getVar(var)
if value:
# Write value only if set
envf.write('%s="%s"\n' % (var, " ".join(value.split())))
envf.close()
}
# Since the intermediary file is deleted by do_merge_xenguestenv it
# must be re-created every time
do_deploy_xenguestenv[vardeps] += "${XENGUEST_IMAGE_VARS_EXTRA}"
do_deploy_xenguestenv[dirs] = "${XENGUEST_ENV_STAGING_DIR}"
addtask deploy_xenguestenv before do_populate_sysroot
# Clone the current xenguest from deploy to manipulate it locally
# This is required if you need to change things before packing an image
# To set the local directory where to clone you must set
@@ -181,7 +224,7 @@ xenguest_image_clone() {
fi
if [ ! -f ${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}/guest.cfg ]; then
die "xenguest-image: ${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_DEPLOY_SUBDIR} does not contain a valid guest"
die "xenguest_image: ${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_DEPLOY_SUBDIR} does not contain a valid guest"
fi
rm -rf ${XENGUEST_IMAGE_DEPLOY_DIR}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}
@@ -4,8 +4,11 @@
# The class is extending deploy function so you recipe must inherit deploy and
# have a do_deploy function (even if it is empty)
# Use standard xenguest-image
inherit xenguest-image
# Add a variable name to XENGUEST_IMAGE_VARS_EXTRA if you want it to
# appear in xenguest.env when the image is deployed
# Use standard xenguest_image
inherit xenguest_image
# Add a DTB file for the guest
# Only one file should be added, if this is set multiple times or in several
@@ -39,6 +42,12 @@ XENGUEST_EXTRA_FILES ??= ""
# dir1/file1 file in the disk content parameters).
XENGUEST_EXTRA_DISK_FILES ??= ""
# Extra vars to be written to xenguest.env
XENGUEST_IMAGE_VARS_EXTRA += "\
XENGUEST_EXTRA_DTB XENGUEST_EXTRA_RAMDISK XENGUEST_EXTRA_XENCONFIG \
XENGUEST_EXTRA_INIT_PRE XENGUEST_EXTRA_INIT XENGUEST_EXTRA_INIT_POST \
XENGUEST_EXTRA_FILES XENGUEST_EXTRA_DISK_FILES"
do_deploy_append() {
if [ -z "${XENGUEST_IMAGE_DEPLOY_DIR}" -o \
-z "${XENGUEST_IMAGE_DEPLOY_SUBDIR}" ]; then
@@ -49,14 +58,14 @@ do_deploy_append() {
if [ -n "${XENGUEST_EXTRA_DTB}" ]; then
if [ ! -f ${XENGUEST_EXTRA_DTB} ]; then
die "xenguest-image: DTB file ${XENGUEST_EXTRA_DTB} does not exist"
die "xenguest_image: DTB file ${XENGUEST_EXTRA_DTB} does not exist"
fi
call_xenguest_mkimage partial --xen-device-tree=${XENGUEST_EXTRA_DTB}
fi
if [ -n "${XENGUEST_EXTRA_RAMDISK}" ]; then
if [ ! -f ${XENGUEST_EXTRA_RAMDISK} ]; then
die "xenguest-image: DTB file ${XENGUEST_EXTRA_RAMDISK} does not exist"
die "xenguest_image: DTB file ${XENGUEST_EXTRA_RAMDISK} does not exist"
fi
call_xenguest_mkimage partial --xen-ramdisk=${XENGUEST_EXTRA_RAMDISK}
fi
@@ -64,7 +73,7 @@ do_deploy_append() {
if [ -n "${XENGUEST_EXTRA_XENCONFIG}" ]; then
for f in ${XENGUEST_EXTRA_XENCONFIG}; do
if [ ! -f $f ]; then
die "xenguest-image: Xen config $f does not exist"
die "xenguest_image: Xen config $f does not exist"
fi
call_xenguest_mkimage partial --xen-append=$f
done
@@ -72,21 +81,21 @@ do_deploy_append() {
if [ -n "${XENGUEST_EXTRA_INIT_PRE}" ]; then
if [ ! -f ${XENGUEST_EXTRA_INIT_PRE} ]; then
die "xenguest-image: Init script ${XENGUEST_EXTRA_INIT_PRE} does not exist"
die "xenguest_image: Init script ${XENGUEST_EXTRA_INIT_PRE} does not exist"
fi
call_xenguest_mkimage partial --init-pre=${XENGUEST_EXTRA_INIT_PRE}
fi
if [ -n "${XENGUEST_EXTRA_INIT}" ]; then
if [ ! -f ${XENGUEST_EXTRA_INIT} ]; then
die "xenguest-image: Init script ${XENGUEST_EXTRA_INIT} does not exist"
die "xenguest_image: Init script ${XENGUEST_EXTRA_INIT} does not exist"
fi
call_xenguest_mkimage partial --init-script=${XENGUEST_EXTRA_INIT}
fi
if [ -n "${XENGUEST_EXTRA_INIT_POST}" ]; then
if [ ! -f ${XENGUEST_EXTRA_INIT_POST} ]; then
die "xenguest-image: Init script ${XENGUEST_EXTRA_INIT_POST} does not exist"
die "xenguest_image: Init script ${XENGUEST_EXTRA_INIT_POST} does not exist"
fi
call_xenguest_mkimage partial --init-post=${XENGUEST_EXTRA_INIT_POST}
fi
@@ -94,7 +103,7 @@ do_deploy_append() {
if [ -n "${XENGUEST_EXTRA_FILES}" ]; then
for f in ${XENGUEST_EXTRA_FILES}; do
if [ ! -f $f ]; then
die "xenguest-image: Xen file $f does not exist"
die "xenguest_image: Xen file $f does not exist"
fi
call_xenguest_mkimage partial --xen-add-file=$f
done
@@ -103,12 +112,12 @@ do_deploy_append() {
if [ -n "${XENGUEST_EXTRA_DISK_FILES}" ]; then
for f in ${XENGUEST_EXTRA_DISK_FILES}; do
if [ ! -f $f ]; then
die "xenguest-image: Disk file $f does not exist"
die "xenguest_image: Disk file $f does not exist"
fi
call_xenguest_mkimage partial --disk-add-file=$f
done
fi
}
# Need to have xenguest-image tool
# Need to have xenguest_image tool
do_deploy[depends] += "xenguest-base-image:do_deploy"
@@ -4,6 +4,11 @@
DISTRO_FEATURES_append = " xen ipv4"
DISTRO_FEATURES_NATIVE_append = " arm-autonomy-host"
# Since meta-virtualization master branch bumped to 4.15+stable we need to
# force the 4.14+stable selection until we validate the new version
PREFERRED_VERSION_xen = "4.14+stable%"
PREFERRED_VERSION_xen-tools = "4.14+stable%"
# Don't include kernels in standard images when building arm-autonomy-host
# If the kernel image is needed in the rootfs the following should be set from
# a bbappend: RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-image"
+3 -2
View File
@@ -14,9 +14,10 @@ LAYERDEPENDS_meta-arm-autonomy = " \
core \
yocto \
openembedded-layer \
networking-layer \
virtualization-layer \
"
LAYERSERIES_COMPAT_meta-arm-autonomy = "gatesgarth"
LAYERSERIES_COMPAT_meta-arm-autonomy = "hardknott"
# We don't activate virtualization feature from meta-virtualization as it
# brings in lots of stuff we don't need. We need to disable the sanity check
@@ -32,7 +33,7 @@ USER_CLASSES_append = " arm-autonomy-features"
BBFILES_DYNAMIC += " \
meta-arm-bsp:${LAYERDIR}/dynamic-layers/meta-arm-bsp/*/*/*.bbappend \
meta-gem5:${LAYERDIR}/dynamic-layers/meta-gem5/*/*/*.bbappend \
meta-arm-bsp:${LAYERDIR}/dynamic-layers/meta-arm-bsp/*/*/*.bb \
"
# Root directory for the meta-arm-autonomy/dynamic-layers/meta-arm-bsp
ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR = "${ARM_AUTONOMY_LAYERDIR}/dynamic-layers/meta-arm-bsp"
+5
View File
@@ -0,0 +1,5 @@
# This file will be required by different xenguest recipes to provide
# common variables, which can be configured in local.conf
# Xenguest image file install location
XENGUEST_MANAGER_GUEST_DIR ?= "${datadir}/guests/"
@@ -32,16 +32,16 @@ Ensure it has all the required layers in bblayers.conf as listed in
Add multiconfig
----------------
Here are the steps required to make the project build both the host and any
number of guests as required.
The steps required to make the project build both the host and any
number of guests as required are:
1. Create a new directory under `conf/` named `multiconfig/`
2. Create two new files in this directory:
`multiconfig/host.conf`
`multiconfig/guest.conf`
These files will contain any configurations that a specific to either the
host or the guest
These files will contain any configurations that are specific to either the
host or the guest. The resulting directory tree should be:
```
-- conf
@@ -73,12 +73,12 @@ MC_GUEST_INITRAMFS_IMAGE ?= ""
#MC_GUEST_INITRAMFS_IMAGE_BUNDLE = "1"
#MC_GUEST_INITRAMFS_IMAGE = "${MC_GUEST_IMAGERECIPE}"
# These variables are set automatically, don't edit them!
# These variables are set automatically, don't override them!
MC_GUEST_FILENAME_PREFIX = "${@ 'Image-initramfs' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}' }"
MC_GUEST_FILENAME = "${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.xenguest"
MC_GUEST_DEP = "${@ 'virtual/kernel:do_deploy' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}:do_image_complete'}"
MC_GUEST_DEP = "${@ 'virtual/kernel:do_deploy' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}:do_merge_xenguestenv'}"
MC_DOIMAGE_MCDEPENDS += "mc:${MC_HOST}:${MC_GUEST}:${MC_GUEST_DEP} "
@@ -114,9 +114,10 @@ IMAGE_FSTYPES += "${@ 'cpio' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) el
# ANY OTHER GUEST CONFIG
```
This contents shouldn't be changed directly, rather change the equivalent
config in local.conf. You can append any other config desired for the
guest at this point, for example `XENGUEST_IMAGE_DISK_SIZE`
To modify the MACHINE or INITRAMFS variables change the equivalent
config in local.conf rather than modifying this file directly. You can also
append any other config desired for the guest after "ANY OTHER GUEST CONFIG",
for example `XENGUEST_IMAGE_DISK_SIZE`.
Make sure not to change `${DEPLOY_DIR_IMAGE}` to anything other than
`${TMPDIR}/deploy/images`, as this is assumed by local.conf.
@@ -127,6 +128,8 @@ Make sure not to change `${DEPLOY_DIR_IMAGE}` to anything other than
TMPDIR = "${TOPDIR}/${MC_HOST}"
DISTRO_FEATURES += " arm-autonomy-host"
# ANY OTHER HOST CONFIG
```
Building the image
@@ -137,29 +140,56 @@ To build the multiconfig image the command is:
bitbake mc:host:arm-autonomy-host-image-minimal
```
You should see that this triggers guest tasks to be built in
parallel. Once the build completes the guest will already be in the
rootfs of the host thanks to `ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUEST`
The first time this is run you may see a warning related to the SRC_URI:
```
Unable to get checksum for xenguest-extern-guests SRC_URI entry foo.xenguest: file could not be found
```
The deployed image including the guest will be in `host/deploy/images/`
This is expected, and only indicates that the guest image has not yet been
generated when the host parses the SRC_URI. By the time it is needed by the
host recipe fetch task it will be present.
During the build you should see that guest tasks are also being executed in
parallel. Once the build completes the guest will already be in the rootfs of
the host thanks to `ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUEST`
The final host image including the guests will be deployed in
`host/deploy/images/`
Multiple Guests
----------------
To have multiple guests with the same config the line which appends to
`ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUEST` just needs to be duplicated with
a different guestname.
`ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS` just needs to pass the argument
'guestcount=#' to install symlink copies of the xenguest file on the host.
Documentation for the guestcount parameter can be found in
documentation/arm-autonomy-quickstart.md in the section titled
'Include guests directly in the host image'. This will ensure that the guest
is still only built once, despite resulting in multiple copies on the target.
To have different config for each guest, each will need its own config
file similar to guest.conf, ensuring TMPDIR is set to a different path,
and everything between `---Guest Config Start---` and
`---Guest Config End---` will need to be duplicated.
If guests are required to have different configurations, each will need its own
config file, e.g. 'netguest.conf'. Ensure that the name of the conf file does
not contain any hyphens, as this will create errors when it becomes part of a
function name. In this file the values of TMPDIR, MACHINE, DISTRO_FEATURES etc.
should be the same as above, but with the prefix "MC_GUEST_*" modified to
something different to avoid collisions (e.g. MC_GUEST_2_*).
Any copies of variables that start `MC_GUEST` must be altered to avoid
collisions (e.g. `MC_GUEST_2_*`), and the name of the conf file must also
be added to BBMULTICONFIG.
As before, your additional config for the guest type should
follow "ANY OTHER GUEST CONFIG"
In your local.conf, everything between `---Guest Config Start---` and
`---Guest Config End---` will need to be duplicated for each desired guest type.
All copies of variables that start `MC_GUEST` must be modified with the same
prefix as in the new guest config file (e.g. `MC_GUEST_2_*`).
Each chunk of guest config in local.conf has automatic guest variables
(found after the line "These variables are set automatically...").
These should all use the same prefix as their chunk in their values,
for example:
```
MC_GUEST_2_FILENAME_PREFIX = "${@ 'Image-initramfs' if d.getVar('MC_GUEST_2_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_2_IMAGERECIPE}' }"
```
Guest with provisioned disk
----------------
@@ -172,11 +202,12 @@ AUTONOMY_HOST_EXTRA_PARTITION = "part --label provisioned-guest --source rawcopy
--sourceparams=file=${TOPDIR}/${MC_GUEST}/deploy/images/${MC_GUEST_MACHINE}/${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.ext4"
```
inside host.conf file.
inside your host.conf file.
The rest of the configuration has to be appended to guest.conf file:
```
# ANY OTHER GUEST CONFIG
XENGUEST_IMAGE_DISK_SIZE = "0"
XENGUEST_IMAGE_SRC_URI_XEN_CONFIG = "file://\${TOPDIR}/path/to/rootdisk.cfg"
XENGUEST_IMAGE_DISK_DEVICE = "_GUEST_DISK_DEVICE_"
@@ -185,7 +216,7 @@ IMAGE_ROOTFS_SIZE = "102400"
IMAGE_FSTYPES = "ext4"
```
content of rootdisk.cfg"
Example content of rootdisk.cfg:
```
disk = ["phy:_GUEST_DISK_DEVICE_,xvda,w"]
@@ -1,9 +1,9 @@
arm-autonomy Quick Start
==================
This documentation is explaining how to quickly start with arm-autonomy layer
This documentation explains how to quickly start with the arm-autonomy layer,
and the main features provided.
You will find in the documentation directory some more detailed documentation
In the documentation directory you will find some more detailed documentation
for each of the functionalites provided by this layer.
What to use this layer for?
@@ -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 hardknott using `git checkout hardknott`).
Please follow [Yocto documentation](https://www.yoctoproject.org/docs/latest/brief-yoctoprojectqs/brief-yoctoprojectqs.html)
in order to have the required dependencies.
@@ -110,7 +110,8 @@ The project will generate a Linux kernel, a root filesystem, a Xen binary and
a DTB modified to include the required entries to boot Xen and Linux as Dom0
(this DTB has the extension `-xen.dtb`).
To boot the system using an u-boot base board you will need to:
To boot the system using a u-boot base board for machines other than FVP-Base
you will need to:
- Load the kernel (by default at 0x80080000 unless you modify
XEN_DEVICETREE_DOM0_ADDR value)
- Load the xen device tree (for example at 0x83000000)
@@ -119,49 +120,88 @@ 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
in meta-arm-autonomy to include only the Linux configuration required to run
a xen guest.
The guest projects are not target specific and will instead use a Yocto MACHINE
defined in meta-arm-autonomy to include only the Linux configuration required to
run a xen guest.
To create a guest project:
1. Follow the steps of "Create a project"
2. Optionaly add layers required to build the image and features you need.
2. Optionally add layers required to build the guest image, and any features you
need.
3. edit conf/local.conf to add `arm-autonomy-guest` to the DISTRO_FEATURES and
3. Edit conf/local.conf to add `arm-autonomy-guest` to the DISTRO_FEATURES and
set MACHINE to `arm64-autonomy-guest`:
```
MACHINE = "arm64-autonomy-guest"
DISTRO_FEATURES += "arm-autonomy-guest"
```
4. build the image you want.
4. Build the image you want.
For example `bitbake core-image-minimal`
The build will create a ".xenguest" image that can be use on an host project
with the xenguest-manager.
with the xenguest-manager, as well as a file "xenguest.env" containing the
variables used to configure and generate the guest image.
The guest can also be built as a 'multiconfig' sub project of the host, see
`meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md` for more information
`meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md` for more
information
Include guests directly in the host image
-----------------------------------------
The layer provides a way to directly include in the host project one or several
images generated by guest projects.
The layer provides a way to directly include one or more images generated by
guest projects in the host project.
To use this feature, you must edit your host project `local.conf` file and
add set ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS to the list of xenguest images
you want to include in your host. Each xenguest image must be given using a
full path to it.
add set the value of 'ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS' to the list of
paths to xenguest images you want to include in your host.
There are 4 supported formats for ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS
entries:
- http/https url
- "https://[url]:[port]/foo.xenguest;md5sum=..."
- file:// absolute local path from root
- "file:///xenguests/bar.xenguest"
- file:// path relative to FILESEXTRAPATHS
- "file://relative/baz.xenguest"
- plain absolute local path from root
- "/xenguests/absolute/xyzzy.xenguest"
It is not recommended to use other bitbake URL types, as they may result in
undefined behaviour.
A semicolon seperated list of install arguments can follow each image path:
- guestname : the name that will be attached when the image is imported
(default: [filename, without extension])
- guestcount : the number of copies of the guest to install, with
incrementing numbers appended to the name
(default: 1)
Any other arguments, for example an md5sum, will be assumed to be fetch
arguments, and will be appended to the path in the SRC_URI.
For example:
```
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS = "/home/user/guest-project/tmp/deploy/images/arm64-autonomy-guest/core-image-minimal-arm64-autonomy-guest.xenguest;guestname=myguest"
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS = "\
https://[url]:[port]/base.xenguest;md5sum=[checksum];guestname=http \
file:///guests/base.xenguest;guestname=file_abs \
file://foo/base.xenguest;guestname=file_rel;guestcount=2 \
/guests/foo/bar/base.xenguest;guestname=no_fetcher \ "
```
This will add the guest and name it `myguest` on the host project image and
the xenguest-manager will automatically boot it during startup.
Documentation for setting up a multiconfig build can be found in:
meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
Add support for your board
--------------------------
@@ -182,7 +222,7 @@ started). You can find the complete list of the kernel configuration elements
required in `recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg`.
### Define the drive and partition to use for the LVM volume
The xenguest-manager is creating disk hard drive using LVM on an empty
The xenguest-manager creates guest storage drives using LVM on an empty
partition. The default value is set to use /dev/sda2.
You can change this for your board by setting XENGUEST_MANAGER_VOLUME_DEVICE.
@@ -191,37 +231,37 @@ Check `recipes-extended/xenguest/xenguest-manager.bbappend` for examples.
Please also read xenguest-manager.md.
### Define the interface to add to xenguest network bridge
xenguest-network bridge is creating a bridge on the host and adds network
interfaces to it so that guest connected to it have access to external network.
xenguest-network bridge creates a bridge on the host and adds network
interfaces to it so that guests connected to it have access to external network.
By default `eth0` is set as the list of interfaces to be added to the bridge.
Depending on your board or use case you might want to use an other interface
or use multiple interfaces.
You can change this for your board by setting XENGUEST_NETWORK_BRIDGE_MEMBERS.
Check `recipes-extended/xenguest/xenguest-network-bridge.bbappend` for
Check `recipes-extended/xenguest/xenguest-network.bbappend` for
exmaples.
Please also read xenguest-network-bridge.md.
### Define the network configuration of the xenguest network bridge
xenguest network bridge is putting the host network interfaces in a bridge
and is configuring it by default to use dhcp.
xenguest-network puts the host network interfaces in a bridge and configures it
by default to use dhcp.
If you need a different type of configuration you can set
XENGUEST_NETWORK_BRIDGE_CONFIG in a xenguest-network-bridge.bbappend to use
XENGUEST_NETWORK_BRIDGE_CONFIG in your xenguest-network-bridge.bbappend to use
a different file.
The recipe will look for the file in ${WORKDIR} so you will need to add it to
SRC_URI in your bbappend.
The recipe will look for the file in ${WORKDIR}, so you will need to add it to
the SRC_URI in your bbappend.
The recipe will also substitute `###BRIDGE_NAME###` with the bridge name
configured in ${XENGUEST_NETWORK_BRIDGE_NAME}.
configured in ${XENGUEST_NETWORK_BRIDGE_NAME} when the config file is installed.
You can find an example configuration file in
`recipes-extended/xenguest/files/xenguest-network-bridge-dhcp.cfg.in`.
Please also read xenguest-network-bridge.md.
Please also read xenguest-network.md.
### Customize Dom0 and Xen boot arguments for you board
xen-devicetree is writting inside the generated DTB Xen and Linux boot
arguments as long as the address where Dom0 Linux kernel can be found.
xen-devicetree modifies the generated DTB Xen and Linux boot arguments,
as long as the address where Dom0 Linux kernel can be found.
You might need to have different values for your board or depending on your
use case.
@@ -28,7 +28,7 @@ perform a couple of customizations in the generated wic image:
The `arm-autonomy-n1sdp-efidisk.wks.in` and `arm-autonomy-n1sdp-grub.cfg` files
are located at `meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic`.
Other variables can also be custmized to set what files need to be included
Other variables can also be customized to set what files need to be included
in the wic image boot partition. Please refer to
`meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc`
for more details.
@@ -56,7 +56,8 @@ The following parameters are available:
the xen devicetrees are properly regenerated if the source DTBs are changed.
This variable is set by default to "virtual/kernel:do_deploy" to use DTBs
generated during the compilation of the Linux kernel. This must be changed
if the machine your are using is not using a DTB listed in KERNEL_DEVICETREE.
if the machine you are using is not using a DTB listed in
KERNEL_DEVICETREE.
- XEN_DEVICETREE_DTBS: This should be set to the list of DTBs you want to be
modified by xen-devicetree. Those must be files that xen-devicetree can find
@@ -7,7 +7,7 @@ Introduction
xenguest-manager is a tool to manage Xenguest images generated by
[xenguest-mkimage](xenguest-mkimage.md).
On a Xen Dom0 system it will:
On a Xen Dom0 system it can:
- create a xen guest from a xenguest image: extract its components, create a
disk for the guest using LVM volumes.
- start/stop a xen guest (during init or using xenguest-manager directly).
@@ -48,6 +48,7 @@ Bitbake parameters
Several parameters are available to configure the xenguest manager during Yocto
project compilation (those can be set in your project local.conf, for example).
This config will be written to a file xenguest-manager.conf in /etc/xenguest/.
The following parameters are available:
@@ -68,13 +69,22 @@ 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
- XENGUEST_MANAGER_LOG_LEVEL: Set the default log level for xenguest manager.
Must be one of ERROR, INFO, VERBOSE (default: ERROR). The logs 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
Since /var/log is by default a volatile location, extra configuration is
required if logs are desired to be kept between reboots:
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 recipes-extended/xenguest/files/logrotate-xenguest
Init scripts
------------
@@ -103,26 +113,30 @@ and variables from the parent file's scope, including:
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
Options for log level: ERROR, INFO, VERBOSE,
and FATAL which will call exit 1 immediately after logging
the message at level ERROR.
- 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,
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, which may
be useful if the command is expected to return a non-zero
result.
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.
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.
Sourcing also allows the script to access params.cfg.
Init scripts also have access to config variables defined in params.cfg.
An example of how to create the directory and install an init shell script can
be found in:
@@ -4,9 +4,9 @@ Xenguest mkimage
Introduction
------------
xenguest-mkimage is a tool to create and modify images to be used as Guest with
Xen. It defines a format to store completely defined guests as a file or as
a directory and provides options to create and modify those images.
xenguest-mkimage is a tool to create and modify images to be used as a Guest
with Xen. It defines a format to store completely defined guests as a file or as
a directory, and provides options to create and modify those images.
A xenguest image contains all elements required to create a xen guest.
This is the base elements like a Xen configuration and a Linux kernel binary
@@ -15,8 +15,8 @@ but also some more advanced elements like init scripts or a disk definition.
The format is made to be deployable easily by storing everything in a single
file and provide tools to easily manipulate the images. It can also easily be
extended to have features like encryption or signature of images, updates or
complex configurations by providing features to have init script that will be
executed on the host embedded inside the image.
complex configurations by providing the ability to have init scripts embedded
inside the image that will be executed on the host when the guest is started.
Xenguest images content
-----------------------
@@ -35,7 +35,7 @@ before starting the guest.
### files
This directory contains files that can be used by the xen configuration, for
example the binary of the kernel referenced in xen configuration).
example the kernel image referenced in xen configuration.
This is where the kernel binary, the dtb or a ramdisk will be stored.
### init.pre, init.d and init.post
@@ -47,7 +47,7 @@ contains scripts called at a different time:
generate part of the xen configuration dynamically.
- init.d: scripts executed when the guest has been created but before it is
started. This can be used to do some xenstore operations or configure the
guest behaviour using xl, for example.
guest behaviour, using xl for example.
- init.post: scripts executed just after starting the guest. This can be
used to configure things created by xen for the guest like network
network interfaces.
@@ -4,4 +4,36 @@
# default rootfs, so use vda3 for guest lvm
XENGUEST_MANAGER_VOLUME_DEVICE ?= "/dev/vda3"
# We need to extend the wks search path to be able to find the wks file set in
# ARM_AUTONOMY_WKS_FILE.
WKS_SEARCH_PATH_prepend := "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic:"
ARM_AUTONOMY_WKS_FILE ?= "arm-autonomy-fvp-base-disk.wks.in"
# set wks file only if INITRAMFS_IMAGE_BUNDLE is not set
WKS_FILE = "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
'${ARM_AUTONOMY_WKS_FILE}', d)}"
XEN_FILE ?= "xen-fvp-base"
DTB_FILE ?= "${@ get_xen_dtb_filename(d)}"
XEN_ADDR ?= "0x84000000"
DTB_ADDR ?= "0x83000000"
FVP_DATA += "cluster0.cpu0=${DEPLOY_DIR_IMAGE}/${XEN_FILE}@${XEN_ADDR} \
cluster0.cpu0=${DEPLOY_DIR_IMAGE}/${DTB_FILE}@${DTB_ADDR}"
# Set the wks guest partition size and unit. It must be aligned with the sum of
# all XENGUEST_IMAGE_DISK_SIZE set for the guests. By default, LVM2 metadata is
# 1 MiB per physical volume, hence it needs to be taken into account when
# setting GUEST_PART_SIZE. The XENGUEST_IMAGE_DISK_SIZE default value is 4GiB.
GUEST_PART_SIZE ?= "4097"
GUEST_PART_SIZE_UNIT ?= "M"
XENGUEST_NETWORK_BRIDGE_MEMBERS ?= "eth0"
# This function uses the "KERNEL_DEVICETREE" variable and manipulates it to
# return the xen kernel device tree file name.
def get_xen_dtb_filename(d):
kernel_dtb_filename = d.getVar('KERNEL_DEVICETREE',d)
xen_dtb_filename = os.path.splitext(os.path.basename(kernel_dtb_filename))[0] + '-xen.dtb'
return xen_dtb_filename
@@ -49,20 +49,16 @@ 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
# When alternate-kernel DISTRO_FEATURE is present we set the linux-yocto-rt
# by default
PREFERRED_PROVIDER_alternate/kernel ?= "\
${@bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', \
'linux-linaro-arm-rt', '', d)}"
'linux-yocto-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 = "\
KERNEL_PACKAGE_NAME_pn-linux-yocto-rt = "\
${@ d.getVar('KERNEL_PACKAGE_NAME_alternate/kernel') \
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) \
else 'kernel' }"
@@ -88,3 +84,7 @@ 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 ''}"
# Additionnal kernel modules are necessary for n1sdp to be able to mount FAT
# filesystems using CP437.
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_append = " kernel-module-nls-cp437 kernel-module-nls-iso8859-1"
@@ -1,14 +1,14 @@
# Use OVERRIDES to minimize the usage of
# ${@bb.utils.contains('DISTRO_FEATURES', 'xen', ...
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ':xen', '', d)}"
# ${@bb.utils.contains('DISTRO_FEATURES', 'autonomy-host', ...
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', ':autonomy-host', '', d)}"
FILESEXTRAPATHS_prepend_xen := "${THISDIR}/${PN}:"
FILESEXTRAPATHS_prepend_autonomy-host := "${THISDIR}/${PN}:"
DEPENDS_append_xen = " dos2unix-native"
DEPENDS_append_autonomy-host = " dos2unix-native"
SRC_URI_append_xen = " file://add-xen-support.patch;patchdir=../"
SRC_URI_append_autonomy-host = " file://add-xen-support.patch;patchdir=../"
do_install_append_xen() {
do_install_append_autonomy-host() {
mv -v ${D}/${UNPACK_DIR}/SOFTWARE/uEnv.txt \
${D}/${UNPACK_DIR}/SOFTWARE/uenvfile
for dir in $(ls ${D}/${UNPACK_DIR}/SITE1/)
@@ -18,11 +18,11 @@ do_install_append_xen() {
}
DEPLOY_EXTRA_DEPS ??= ""
DEPLOY_EXTRA_DEPS_xen = "xen:do_deploy xen-devicetree:do_deploy"
DEPLOY_EXTRA_DEPS_autonomy-host = "xen:do_deploy xen-devicetree:do_deploy"
do_deploy[depends] += "${DEPLOY_EXTRA_DEPS}"
do_deploy_prepend_xen() {
do_deploy_prepend_autonomy-host() {
# To avoid dependency loop between firmware-image-juno:do_install,
# xen:do_deploy and xen-devicetree:do_deploy when
# INITRAMFS_IMAGE_BUNDLE = "1", we need to handle the xen and
@@ -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
@@ -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"
@@ -0,0 +1,17 @@
# short-description: Create a disk image
# long-description: Creates a partitioned disk image that the user
# can directly dd to boot media.
# For FVP Base first partition is empty to keep compatibility with disk.img
part --label empty --source empty --ondisk sda --size="1M" --system-id 8e --align 1024
# Second partition is rootfs normally populated as /dev/vda2
part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
# Third partition to accomodate guests images normally populated as /dev/vda3 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
part --label guests --source empty --ondisk sda --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
# Fourth partition is user defined entry normally populated as /dev/vda4
${AUTONOMY_HOST_EXTRA_PARTITION}
bootloader --ptable msdos
@@ -1 +0,0 @@
XENGUEST_NETWORK_BRIDGE_MEMBERS_gem5-arm64 ?= "eth0"
@@ -1,15 +0,0 @@
FILESEXTRAPATHS_prepend_gem5-arm64 := "${THISDIR}:"
#
# arm-autonomy kmeta extra
#
SRC_URI_append_gem5-arm64 = " file://arm-autonomy-kmeta-extra-gem5;type=kmeta;name=arm-autonomy-kmeta-extra-gem5;destsuffix=arm-autonomy-kmeta-extra-gem5"
# We need to turn off SVE support in the Linux kernel otherwise Xen is stopping
# Linux kernel with a coredump while trying to access XEN bit of CPACR1 core
# register.
LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE_gem5-arm64 = "${@bb.utils.contains_any('DISTRO_FEATURES', \
'arm-autonomy-host arm-autonomy-guest', \
' features/arm-autonomy/disable-arm64-sve.scc','',d)}"
KERNEL_FEATURES_append_gem5-arm64 = "${LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE}"
@@ -1 +1 @@
GRUB_BUILDIN += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen_boot', '', d)}"
GRUB_BUILDIN += "${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', 'xen_boot', '', d)}"
@@ -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)}"
@@ -0,0 +1,70 @@
#!/bin/sh
INSTALL_DIR="###CONTAINERS_INSTALL_DIR###"
MANIFEST="${INSTALL_DIR}/###CONTAINERS_MANIFEST###"
INIT_DIR="/etc/init.d"
DOCKER_INIT="docker.init"
find_docker_init() {
if [ -f "$INIT_DIR/$DOCKER_INIT" ]; then
$INIT_DIR/$DOCKER_INIT "start"
else
echo "ERROR: Couldn't find docker init script! ($INIT_DIR/$DOCKER_INIT)"
exit 1
fi
}
is_docker_started() {
if ! docker info > /dev/null 2>&1; then
find_docker_init
fi
}
check_manifest() {
if [ ! -f ${MANIFEST} ]; then
echo "No manifest found!"
exit 1
fi
}
has_docker_image() {
docker image inspect "$1" >/dev/null 2>&1
}
start() {
check_manifest
is_docker_started
while read -r archive name tag keep _; do
CONTAINER_IMAGE_NAME_AND_TAG="${name}:${tag}"
# Image does not exist and image file exists: Import the image.
if ! has_docker_image "${CONTAINER_IMAGE_NAME_AND_TAG}" && \
[ -f "${INSTALL_DIR}/${archive}" ]; then
echo "Importing ${CONTAINER_IMAGE_NAME_AND_TAG} container image..."
docker import "${INSTALL_DIR}/${archive}" \
"${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 [ "${keep}" != "1" ]; then
rm "${INSTALL_DIR}/${archive}"
fi
fi
done < ${MANIFEST}
}
case "$1" in
start)
start && exit 0
;;
*)
echo "Usage: $0 {start}"
exit 2
esac
exit $?
@@ -0,0 +1,36 @@
#
# This recipe adds an init script to import the containers added by
# docker_extern_containers.bbclass at boot time
# Notes:
# docker_extern_containers.bbclass creates a manifest file which contains
# the columns: archive name tag keep
# for each container. This file is read by the import_containers
# script to determine the parameters of the import
#
# Since the script needs knowledge of the values of $CONTAINERS_INSTALL_DIR
# and $CONTAINERS_MANIFEST these are substituted for placeholder strings when
# the script is installed.
DESCRIPTION = "Add init script to import docker images at boot"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit docker_extern_containers
SRC_URI = "file://import_containers.sh"
inherit update-rc.d
INITSCRIPT_PARAMS = "start 30 2 3 4 5 ."
INITSCRIPT_NAME = "import_containers.sh"
S = "${WORKDIR}"
do_install_append() {
install -d ${D}${sysconfdir}/init.d
install -m 755 import_containers.sh ${D}${sysconfdir}/init.d
sed -i "s,###CONTAINERS_INSTALL_DIR###,${CONTAINERS_INSTALL_DIR}," \
${D}${sysconfdir}/init.d/import_containers.sh
sed -i "s,###CONTAINERS_MANIFEST###,${CONTAINERS_MANIFEST}," \
${D}${sysconfdir}/init.d/import_containers.sh
}
@@ -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,4 +1,4 @@
# Recipe to create a minimal Arm Autonomy stack host image
# Recipe to create a minimal Arm Autonomy reference stack host image
DESCRIPTION = "Arm Autonomy stack host minimal image"
@@ -11,39 +11,6 @@ inherit core-image features_check
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# 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]
# - 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.
#
# Here are examples of values:
# /home/mydir/myguest.xenguest;guestname=guest1;guestcount=3
# http://www.url.com/testguest.xenguest
#
# If you are using the output of an other Yocto project, you should use the
# full path syntax instead of the Yocto SRC_URI to be able to use the
# symlink version of your image (as the real file has a new name on each
# build as it includes the date). You must not use SRC_URI type file:// as
# it will try to include the symlink and not the destination file which will
# be detected by the recipe and output an error 'Guest file is a symlink'.
#
# Guests can also be added using a bbapend to this recipe by adding entries
# to SRC_URI with parameter ;guestname=NAME to specify the destination
# guestname. The parameter guestname must be present as it is used to detect
# guests to be added
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS ??= ""
# Includes minimal set required to start and manage guest. The xen specific
# modules are not explicitly included as they are built as part of the kernel
# image for performance reasons. It doesn't include all kernel modules to
@@ -53,6 +20,7 @@ IMAGE_INSTALL += " \
packagegroup-core-boot \
packagegroup-core-ssh-openssh \
qemu-system-i386 \
xenguest-extern-guests \
xenguest-manager \
xenguest-network \
"
@@ -63,107 +31,5 @@ EXTRA_IMAGEDEPENDS += "xen"
# Build xen-devicetree to produce a xen ready devicetree
EXTRA_IMAGEDEPENDS += "xen-devicetree"
# Documentation for setting up a multiconfig build can be found in:
# meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
# In a multiconfig build this variable will hold a dependency string, which differs based
# on whether the guest has initramfs or not.
# It may have a space seperated list of dependency strings if mulitple guest types are
# configured
MC_DOIMAGE_MCDEPENDS ?= ""
# Example value: mc:host:guest:core-image-minimal:do_image_complete
# In a multiconfig build the host task 'do_image' has a dependency on multiconfig guest.
# This ensures that the guest image file already exists when it is needed by the host
DO_IMAGE_MCDEPENDS := "${@ '${MC_DOIMAGE_MCDEPENDS}' if d.getVar('BBMULTICONFIG') else ''}"
# 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+);?")
# Check in ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS for extra guests and add them
# to SRC_URI with xenguest parameter if not set
guestlist = d.getVar('ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS')
if guestlist:
for guest in guestlist.split():
# 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)
# in case we have a link we need the destination
guestfile = os.path.realpath(guestfile)
# make sure the file exist to give a meaningfull error
if not os.path.exists(guestfile):
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)
else:
# we have a Yocto URL
try:
_, _, path, _, _, parm = bb.fetch.decodeurl(guest)
# force guestname param in if not already there
if not 'guestname' in parm:
guest += ';guestname=' + os.path.basename(path)
d.appendVar('SRC_URI', ' ' + guest)
except:
raise bb.parse.SkipRecipe("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS contains an invalid entry: " + guest)
}
python add_extern_guests () {
# Destination directory on the rootfs
guestdir = d.getVar('IMAGE_ROOTFS') + d.getVar('datadir') + '/guests'
# Parse SRC_URI for files with ;guestname= parameter
src_uri = d.getVar('SRC_URI')
for entry in src_uri.split():
_, _, path, _, _, parm = bb.fetch.decodeurl(entry)
if 'guestname' in parm:
if os.path.islink(path):
realpath = os.path.realpath(path)
if not os.path.exists(realpath):
bb.fatal("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS link does not resolve: " + path)
bb.note("Guest file is a symlink:\n " + path + "\nResolved to:\n " + realpath)
path = realpath
bb.utils.mkdirhier(guestdir)
dstname = parm['guestname']
# 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; "
@@ -1,12 +1,12 @@
# Use OVERRIDES to minimize the usage of
# ${@bb.utils.contains('DISTRO_FEATURES', 'xen', ...
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ':xen', '', d)}"
# ${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', ...
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', ':autonomy-host', '', d)}"
# For Xen we only need the i386 binaries
QEMU_TARGETS_xen = "i386"
QEMU_TARGETS_autonomy-host = "i386"
PACKAGECONFIG[noaudio] = "--audio-drv-list='',,"
PACKAGECONFIG_append_xen = " noaudio"
PACKAGECONFIG_remove_xen = "fdt sdl kvm"
PACKAGECONFIG_append_autonomy-host = " noaudio"
PACKAGECONFIG_remove_autonomy-host = "fdt sdl kvm"
require ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'recipes-devtools/qemu/${BPN}-package-split.inc', '', d)}
require ${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', 'recipes-devtools/qemu/${BPN}-package-split.inc', '', d)}
@@ -12,9 +12,9 @@ S = "${WORKDIR}"
DESCRIPTION = "Add entries in DTB for Xen and Dom0"
# Please refer to documentation/xen-devicetree.md for documentation on those
# parameters
# kernel size is passed to xen via xen.dtb so wee need to add
# Please refer to documentation/xen-devicetree.md for documentation on these
# customizable parameters
# kernel size is passed to xen via xen.dtb so we need to add
# 'virtual/kernel:do_deploy' as a dependency
XEN_DEVICETREE_DEPEND_append = " virtual/kernel:do_deploy"
XEN_DEVICETREE_DTBS ?= "${KERNEL_DEVICETREE}"
@@ -25,8 +25,8 @@ XEN_DEVICETREE_DOM0_ADDR ?= "0x80080000"
XEN_DEVICETREE_DOM0_SIZE ?= "0x01000000"
XEN_DEVICETREE_DTSI_MERGE ?= "xen.dtsi"
# Our package does not generate any package for the rootfs but contributes to
# deploy
# Our package does not generate any packages for the rootfs, but instead
# contributes to deploy
inherit nopackages deploy
DEPENDS += "dtc-native"
@@ -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
@@ -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
@@ -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
@@ -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,8 +1,3 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-vif-nat-fix-hostname.patch \
"
PACKAGECONFIG_remove = "\
${@bb.utils.contains('DISTRO_FEATURES', \
'arm-autonomy-host', \
@@ -0,0 +1,4 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-4.14:"
SRC_URI += "file://0001-vif-nat-fix-hostname.patch \
"
@@ -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 \
"
@@ -22,7 +22,7 @@ case "$1" in
*)
# do not advertise unreasonable commands that there is no reason
# to use with this device
echo $"Usage: $0 {start|stop|status|restart|force-reload}"
echo "Usage: $0 {start|stop|status|restart|force-reload}"
exit 1
esac
@@ -10,13 +10,16 @@ BRIDGE_NAME="###BRIDGE_NAME###"
case "${XENGUEST_NETWORK_TYPE:=}" in
nat)
echo "vif = ['script=vif-nat']" >> ${guestcfgfile}
echo "vif = ['script=vif-nat']" >> "${guestcfgfile:?}"
log info "Network type is NAT"
;;
bridge)
echo "vif = ['script=vif-bridge,bridge=${BRIDGE_NAME}']" >> ${guestcfgfile}
echo "vif = ['script=vif-bridge,bridge=${BRIDGE_NAME}']" >> "${guestcfgfile:?}"
log info "Network type is bridge: ${BRIDGE_NAME}"
;;
none)
log info "Network type is none"
;;
*)
log error "XENGUEST_NETWORK_TYPE=$XENGUEST_NETWORK_TYPE invalid"
;;
@@ -25,19 +25,19 @@ case "$1" in
echo "Starting xenguest"
# Create unconfigured guests
if [ -d ${XENGUEST_GUEST_DIR} ]; then
for f in $(find ${XENGUEST_GUEST_DIR} -name "*.xenguest" \
-exec basename {} .xenguest \;); do
if [ ! -f ${XENGUEST_CONF_BASE}/guests/${f}/guest.cfg ]; then
if [ -d "${XENGUEST_GUEST_DIR}" ]; then
shopt -s nullglob
for path in "${XENGUEST_GUEST_DIR}"/*.xenguest; do
f=$(basename "${path}" .xenguest)
if [ ! -f "${XENGUEST_CONF_BASE}/guests/${f}/guest.cfg" ]; then
# Check if this guest should be auto booted
autoboot=$(/usr/bin/xenguest-mkimage dump-paramsconfig \
${XENGUEST_GUEST_DIR}/${f}.xenguest | \
"${path}" | \
grep GUEST_AUTOBOOT | sed -e "s,.*=,," | tr -d '"')
if [ "$autoboot" = "0" ]; then
echo "Do not create $f, autoboot disabled"
else
/usr/bin/xenguest-manager create \
${XENGUEST_GUEST_DIR}/${f}.xenguest
/usr/bin/xenguest-manager create "${path}"
# Update guestlist
if [ $? -eq 0 ]; then
guestlist="${guestlist} ${f}"
@@ -49,11 +49,11 @@ case "$1" in
if [ -n "${guestlist}" ]; then
for f in ${guestlist}; do
GUEST_AUTOBOOT="1"
if [ -f ${XENGUEST_CONF_BASE}/guests/${f}/params.cfg ]; then
source ${XENGUEST_CONF_BASE}/guests/${f}/params.cfg
if [ -f "${XENGUEST_CONF_BASE}/guests/${f}/params.cfg" ]; then
source "${XENGUEST_CONF_BASE}/guests/${f}/params.cfg"
fi
if [ "${GUEST_AUTOBOOT}" = "1" ]; then
/usr/bin/xenguest-manager start ${f}
/usr/bin/xenguest-manager start "${f}"
fi
done
else
@@ -66,9 +66,9 @@ case "$1" in
stop)
echo "Stopping xenguest"
# update guest list
guestlist=$(xenguest-manager status | grep Running | cut -d ":" -f1)
guestlist=$(xenguest-manager status | grep Running | cut -d " " -f1)
for f in ${guestlist}; do
xenguest-manager shutdown ${f} --kill
xenguest-manager shutdown "${f}" --kill
done
;;
reload)
@@ -36,7 +36,7 @@ case "$1" in
*)
# do not advertise unreasonable commands that there is no reason
# to use with this device
echo $"Usage: $0 {start|stop|status|restart|force-reload}"
echo "Usage: $0 {start|stop|status|restart|force-reload}"
exit 1
esac
@@ -11,19 +11,20 @@ set +u
#
check_if_vif_is_ready() {
ret=($(xl network-list "${guestname}" | grep "${1}"))
# ${ret[4]} is network interface status value
ret=$(xl network-list "${guestname:?}" | grep "${1}" \
| tr -s ' ' | cut -d' ' -f5)
# ${ret} is network interface status value
# 1 means vif is not ready
# 4 means vif is ready
[ "${ret[4]}" = "4" ] && return 0
[ "${ret}" = "4" ] && return 0
return 1
}
case "${XENGUEST_NETWORK_TYPE:-}" in
nat)
vif_name="$(xl network-list ${guestname} | grep -o vif.*)"
vif_name="$(xl network-list "${guestname:?}" | grep -o "vif.*")"
for try in {1..20}
for try in $(seq 20)
do
if check_if_vif_is_ready "${vif_name}"; then
claim_lock "vif-nat-kea"
@@ -1,11 +1,11 @@
# Create a xenguest base image
#
# This recipe creates a base image that is then extended by other recipes
# through xenguest-image class.
# xenguest image type is using this as base to add a kernel and a disk image
# to create a guest
# through xenguest_image class.
# xenguest image type uses this recipe as a base to add a kernel and a disk
# image to create a guest
#
# The recipe is also adding files in those directories to the xenguest image:
# The recipe also adds files in those directories to the xenguest image:
# - ${WORKDIR}/extend/disk-files: all files in this directory will be added to
# the guest disk files (using --disk-add-file)
# - ${WORKDIR}/extend/files: all files in this directory will be added to the
@@ -72,7 +72,15 @@ XENGUEST_IMAGE_SRC_URI_INIT_POST ??= ""
S = "${WORKDIR}"
inherit deploy xenguest-image
# Extra vars to add to xenguest.env
XENGUEST_IMAGE_VARS_EXTRA += "\
XENGUEST_IMAGE_HOST_PORT XENGUEST_IMAGE_GUEST_PORT \
XENGUEST_IMAGE_NAT_PORT_FORWARD_SCRIPT XENGUEST_IMAGE_SRC_URI_DISK_FILES \
XENGUEST_IMAGE_SRC_URI_XEN_FILES XENGUEST_IMAGE_SRC_URI_XEN_CONFIG \
XENGUEST_IMAGE_SRC_URI_INIT_PRE XENGUEST_IMAGE_SRC_URI_INIT \
XENGUEST_IMAGE_SRC_URI_INIT_POST"
inherit deploy xenguest_image
# parse XENGUEST_IMAGE_SRC_URI_ variables and add them to SRC_URI
python __anonymous() {
@@ -0,0 +1,85 @@
# Xenguest Extern Guests
#
# This recipe installs the extern guest files specified in
# ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS into the host image, They are installed
# to the directory XENGUEST_MANAGER_GUEST_DIR
#
# src_uri_parse_var.bbclass is used to parse
# ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS and add the guest paths to the SRC_URI
# to be fetched and unpacked to ${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}
#
# Further documentation can be found in documentation/arm-autonomy-quickstart.md,
# in the section named "Include guests directly in the host image"
DESCRIPTION = "Xenguest Extern Guests"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# Global value of XENGUEST_MANAGER_GUEST_DIR set here
require conf/xenguest.conf
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS ??= ""
# Parse the variable ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS for xenguest files,
# unpack them to SRC_URI_FROM_VAR_UNPACK_DIR and create a manifest file
# containing each of SRC_URI_FROM_VAR_MANIFEST_PARAMS for each entry
inherit set_src_uri_from_var
SRC_URI_FROM_VAR_NAME = "ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS"
SRC_URI_FROM_VAR_MANIFEST_PARAMS= "guestname=[basename] guestcount=1"
SRC_URI_FROM_VAR_UNPACK_DIR = "xenguests"
# Unnecessary tasks
do_compile[noexec] = "1"
do_configure[noexec] = "1"
do_patch[noexec] = "1"
# Install guest files to XENGUEST_MANAGER_GUEST_DIR
do_install() {
local guestfile guestname guestcount
if [ -f "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/manifest" ]; then
install -d "${D}${XENGUEST_MANAGER_GUEST_DIR}"
# Iterate over manifest file containing parameters
while read -r guestfile guestname guestcount _; do
[ -f "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/${guestfile}" ] ||
bbfatal "${guestfile} does not exist"
install -m 644 \
"${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/${guestfile}" \
"${D}${XENGUEST_MANAGER_GUEST_DIR}/${guestname}.xenguest"
# Create symlinks for duplicate guests, appending numbers to
# guestname
for i in `seq 2 $guestcount`
do
ln -s -r \
"${D}${XENGUEST_MANAGER_GUEST_DIR}/${guestname}.xenguest" \
"${D}${XENGUEST_MANAGER_GUEST_DIR}/${guestname}$i.xenguest"
done
done < "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/manifest"
fi
}
do_install[vardeps] += "ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS"
FILES_${PN} += "${XENGUEST_MANAGER_GUEST_DIR}"
# In a multiconfig build this variable will hold a dependency string, which
# differs based on whether the guest has initramfs or not. It may have a space
# seperated list of dependency strings if mulitple guest types are configured
MC_DOIMAGE_MCDEPENDS ?= ""
# Example value: mc:host:guest:core-image-minimal:do_merge_xenguestenv
# In a multiconfig build the host task 'do_image' has a dependency on
# multiconfig guest. This ensures that the guest image file already exists
# when it is needed by the host
DO_IMAGE_MCDEPENDS := "${@ '${MC_DOIMAGE_MCDEPENDS}' \
if d.getVar('BBMULTICONFIG') else ''}"
# Apply mc dependency. Empty string if multiconfig not enabled
do_fetch[mcdepends] += "${DO_IMAGE_MCDEPENDS}"
@@ -1,17 +1,10 @@
# Xenguest manager recipe
#
# xenguest-manager is a tool to control xen guest (e.g. create, start, stop)
# xenguest-manager is a tool to control xen guests (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
# Usage documentation for the xenguest-manager tool can be found in
# meta-arm-autonomy/documentation/xenguest-manager.md including the
# customizable bitbake variables.
DESCRIPTION = "Xen Guest Manager"
LICENSE = "MIT"
@@ -25,12 +18,12 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda
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_GUEST_DIR ?= "${datadir}/guests/"
XENGUEST_MANAGER_LOG_LEVEL ?= "ERROR"
#XENGUEST_MANAGER_GUEST_DIR set in xenguest.conf
require conf/xenguest.conf
# We add an init script to create and start guests automatically
# run start script after xen-tools and run stop script before xen-tools
@@ -2,8 +2,11 @@
#
# xenguest-mkimage is a tool to create/modify images to be used as xen guests
# Produced images contains a xen configuration and several optional components
# (kernel, device-tree, disk definition and files, init scripts) which all
# together fully define a full xen guest
# (kernel, device-tree, disk definition and files, and init scripts) which all
# together fully define a xen guest image
#
# Usage documentation for the xenguest-mkimage tool can be found in
# meta-arm-autonomy/documentation/xenguest-mkimage.md
DESCRIPTION = "Xenguest mkimage tool"
LICENSE = "MIT"
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda
S = "${WORKDIR}"
# Please refer to documentation/xenguest-network-bridge.md for documentation on
# those parameters
# the parameters available for customization
XENGUEST_NETWORK_BRIDGE_NAME ?= "xenbr0"
# The XENGUEST_NETWORK_BRIDGE_MEMBERS should be set in a machine.conf
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda
S = "${WORKDIR}"
inherit deploy xenguest-image
inherit deploy xenguest_image
# Name of the file we create in deploy
XENGUEST_IMAGE_NODISK_DEPLOY = "xenguest-nodisk-image.xenguest"
@@ -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
@@ -38,6 +38,12 @@ python() {
from distutils.version import LooseVersion
kernelVersion = d.getVar('LINUX_VERSION')
pn = d.getVar('PN')
if kernelVersion and pn != 'linux-libc-headers' \
and oe.utils.any_distro_features(d, "arm-autonomy-host arm-autonomy-guest"):
if LooseVersion(kernelVersion) < '5.9':
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"):
+1 -1
View File
@@ -9,7 +9,7 @@ BBFILE_COLLECTIONS += "meta-arm-bsp"
BBFILE_PATTERN_meta-arm-bsp = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-arm-bsp = "5"
LAYERSERIES_COMPAT_meta-arm-bsp = "gatesgarth"
LAYERSERIES_COMPAT_meta-arm-bsp = "hardknott"
LAYERDEPENDS_meta-arm-bsp = "core meta-arm"
# This won't be used by layerindex-fetch, but works everywhere else
+1 -1
View File
@@ -17,7 +17,7 @@ PREFERRED_VERSION_linux-yocto ?= "5.3%"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
KCONFIG_MODE = "--alldefconfig"
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"

Some files were not shown because too many files have changed in this diff Show More