Skip to contentSkip to conversation

runfvp: reset the process group on startup

PATCH New Ross Burton 1 participant 6 messages Oct 18, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 runfvp: reset the process group on startup

So that it is easy to kill runfvp and everything it starts (such as telnet or the FVP itself), reset the process group on startup.

---
 scripts/runfvp | 3 +++
 1 file changed, 3 insertions(+)
scripts/runfvp +3 -0
index a5a436e8..97836726 100755
@@ -217,6 +217,9 @@ def runfvp(cli_args):
 
 if __name__ == "__main__":
     try:
+        # Set the process group so that it's possible to kill runfvp and
+        # everything it spawns easily.
+        os.setpgid(0, 0)
         runfvp(sys.argv[1:])
     except KeyboardInterrupt:
         pass
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/6 arm/oeqa: add FVP testimage controller target

Add a new oeqa.core.target.OETarget subclass for testimage which starts a FVP using runfvp. This uses --console to connect to the console so telnet is needed on the host.

---
 .gitignore                                |  1 +
 meta-arm/lib/oeqa/controllers/__init__.py |  0
 meta-arm/lib/oeqa/controllers/fvp.py      | 87 +++++++++++++++++++++++
 3 files changed, 88 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 meta-arm/lib/oeqa/controllers/__init__.py
 create mode 100644 meta-arm/lib/oeqa/controllers/fvp.py
.gitignore new file +1 -0
new file mode 100644
index 00000000..bee8a64b
@@ -0,0 +1 @@
+__pycache__
meta-arm/lib/oeqa/controllers/__init__.py new file +0 -0
new file mode 100644
index 00000000..e69de29b
meta-arm/lib/oeqa/controllers/fvp.py new file +87 -0

87 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw

PATCH 3/6 arm-bsp/fvp: enable virtio drivers

In reply to Ross Burton

All FVPs can use virtio networking devices, so enable virtio in all of the FVP kernels.

Remove our fvp/fvp-virtio.cfg as there's cfg/virtio.scc we can use.

---
 .../linux/arm-platforms-kmeta/bsp/arm-platforms/fvp-arm32.scc | 3 +--
 .../linux/arm-platforms-kmeta/bsp/arm-platforms/fvp.scc       | 3 +--
 .../arm-platforms-kmeta/bsp/arm-platforms/fvp/fvp-virtio.cfg  | 4 ----
 3 files changed, 2 insertions(+), 8 deletions(-)
 delete mode 100644 meta-arm-bsp/recipes-kernel/linux/arm-platforms-kmeta/bsp/arm-platforms/fvp/fvp-virtio.cfg
meta-arm-bsp/recipes-kernel/linux/arm-platforms-kmeta/bsp/arm-platforms/fvp-arm32.scc +1 -2
index 85659aa7..15bb4831 100644
@@ -1,14 +1,13 @@
 include features/input/input.scc
 include cfg/timer/no_hz.scc
+include cfg/virtio.scc
 
 kconf hardware fvp-arm32/fvp-board.cfg
 kconf hardware fvp-arm32/fvp-features.cfg
 kconf hardware fvp/fvp-net.cfg
 kconf hardware fvp/fvp-rtc.cfg
 kconf hardware fvp/fvp-serial.cfg
-kconf hardware fvp/fvp-virtio.cfg
 kconf hardware fvp/fvp-cfi.cfg
 kconf hardware fvp/fvp-drm.cfg
 kconf hardware fvp/fvp-timer.cfg
-kconf hardware fvp/fvp-virtio.cfg
 kconf hardware fvp/fvp-watchdog.cfg
meta-arm-bsp/recipes-kernel/linux/arm-platforms-kmeta/bsp/arm-platforms/fvp.scc +1 -2
index 79e3a69a..80b85819 100644
@@ -1,14 +1,13 @@
 include features/input/input.scc
 include features/net/net.scc
 include cfg/timer/no_hz.scc
+include cfg/virtio.scc
 
 kconf hardware fvp/fvp-board.cfg
 kconf hardware fvp/fvp-net.cfg
 kconf hardware fvp/fvp-rtc.cfg
 kconf hardware fvp/fvp-serial.cfg
-kconf hardware fvp/fvp-virtio.cfg
 kconf hardware fvp/fvp-cfi.cfg
 kconf hardware fvp/fvp-drm.cfg
 kconf hardware fvp/fvp-timer.cfg
-kconf hardware fvp/fvp-virtio.cfg
 kconf hardware fvp/fvp-watchdog.cfg
meta-arm-bsp/recipes-kernel/linux/arm-platforms-kmeta/bsp/arm-platforms/fvp/fvp-virtio.cfg deleted +0 -4
deleted file mode 100644
index afc76a09..00000000
@@ -1,4 +0,0 @@
-CONFIG_VIRTIO=y
-CONFIG_VIRTIO_MMIO=y
-CONFIG_BLOCK=y
-CONFIG_VIRTIO_BLK=y
Signature · 1 line
2.25.1
#3 lore raw

PATCH 4/6 arm-bsp/fvp-common: set TEST_TARGET to OEFVPTarget

In reply to Ross Burton

Set TEST_TARGET so that all FVP machines use the new FVP target out of the box, instead of attempting to use qemu.

---
 meta-arm-bsp/conf/machine/fvp-common.inc | 2 ++
 1 file changed, 2 insertions(+)
meta-arm-bsp/conf/machine/fvp-common.inc +2 -0
index 2579d94a..9adb4309 100644
@@ -25,3 +25,5 @@ EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
 # initialise) and install the pre-generated keys.
 PACKAGECONFIG:remove:pn-openssh = "rng-tools"
 MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
+
+TEST_TARGET = "OEFVPTarget"
Signature · 1 line
2.25.1
#4 lore raw

PATCH 5/6 CI: install telnet into the images

In reply to Ross Burton

runfvp currently needs telnet to communicate with the guest, so install telnet into the image.

---
 .gitlab-ci.yml | 1 +
 1 file changed, 1 insertion(+)
.gitlab-ci.yml +1 -0
index 04e65ffe..f00bdcf8 100644
@@ -27,6 +27,7 @@ stages:
     - mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
     # Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
     - ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
+    - sudo apt update && sudo apt install telnet -y
 
 # Generalised fragment to do a Kas build
 .build:
Signature · 1 line
2.25.1
#5 lore raw

PATCH 6/6 CI: enable testimage for fvp-base

In reply to Ross Burton

Inherit fvpboot so that the FVP binary is fetched and configuration generated.

Configure the FVP to forward host port 8022 to port 22 locally, and tell testimage to SSH to localhost:8022. This has the limitation that only one testimage can run per machine, but this will be removed shortly.

Disable the parselogs test case, as there are some harmless warnings in the dmesg which cause it to fail. Currently meta-arm can't extend the whitelist of ignorable warnings.

The FVP binaries are x86-64 only, so tag the job appropriately.

---
 .gitlab-ci.yml  | 4 +++-
 ci/fvp-base.yml | 9 +++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
.gitlab-ci.yml +3 -1
index f00bdcf8..4a2b3366 100644
@@ -109,8 +109,10 @@ corstone700-fvp:
 corstone700-mps3:
   extends: .build
 
-fvp-base:
+fvp-base/testimage:
   extends: .build
+  tags:
+  - x86_64
 
 fvp-base-arm32:
   extends: .build
ci/fvp-base.yml +9 -0
index 1c3675fa..47d123e3 100644
@@ -5,3 +5,12 @@ header:
 
 machine: fvp-base
 
+local_conf_header:
+  testimagefvp: |
+    INHERIT = "fvpboot"
+    # This fails but we can't add to the ignorelist from meta-arm yet
+    # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14604
+    TEST_SUITES:remove = "parselogs"
+    # Tell testimage to connect to localhost:8022, and forward that to SSH in the FVP.
+    TEST_TARGET_IP = "localhost:8022"
+    FVP_CONFIG[bp.virtio_net.hostbridge.userNetPorts] ?= "8022=22"
Signature · 1 line
2.25.1