Linaro / lite-lava-docker-compose

LITE Team LAVA docker dispatcher
MIT License
5 stars 10 forks source link

[WIP]: test-images: TF-M: Add QEMU-based TF-M test support #80

Closed microbuilder closed 4 years ago

microbuilder commented 4 years ago

This commit adds a new Debian-based docker image that can be used for testing TF-M on QEMU using the mps2_an521 machine target.

It also adds a new qemu_mps2_an521/tfm application image for testing purposes, which can be run with QEMU.

Signed-off-by: Kevin Townsend kevin.townsend@linaro.org

pfalcon commented 4 years ago

@microbuilder: Great progress here! While I see that's it's marked [WIP], the biggest question is of course: "So, does it work? Will the actual test job follow in the next PR?"

This commit adds a new Debian-based docker image that can be used for testing TF-M on QEMU

I assume you found it easier to just use a recent Debian package than to prepare an image with ephyr SDK installed. Works for me. We can always change that later if needed.

It also adds a new qemu_mps2_an521\tfm

Typo re: backslash? ;-)

test-images/qemu_mps2_an521/tfm/tfm_full.hex

I'd suggest to add a version to the binary filename, be it actual TFM version, git revision, or just date built.

I also personally would have made this be 2 commits: one adding docker image, another sample binary. I don't think it's worth perfectalizing it and splitting now, just a friendly note that reviewers pay attention to that ;-).

pfalcon commented 4 years ago

Oh, and I personally really appreciate README's - will save a lot of time for someone looking into it afterwards.

microbuilder commented 4 years ago

I assume you found it easier to just use a recent Debian package than to prepare an image with ephyr SDK installed. Works for me. We can always change that later if needed.

This doesn't use Zephyr's SDK or Zephyr ... the binary comes from TF-M's build system, so I figured a TF-M specific Docker image made more sense in case the requirements ever differ from what's available in the Zephyr SDK. A Zephyr image is also worth putting together, of course.

And I'll add the plumbing to test this today, and update this PR accordingly.

microbuilder commented 4 years ago

@pfalcon I appended the commit version to the hex file name, and also referenced the SHA in README.md. Thanks for catching the commit message typo as well.

pfalcon commented 4 years ago

I confirm that with the latest lite-lava-docker-compose lite branch HEAD (5edfb89cf0dab42500c3f24f861a0d7ab79faf07) and test job from here I get the following error:

qemu-system-arm: Invalid RAM size, should be 16 MiB
err: lava test monitoring reached end of file
Connection closed

@microbuilder, the question is what's wrong: is it the case that mps2-an521 machine has 16MB of RAM, and qemu refuses us to set any other value (we indeed configure it at 1MB), or TF-M binary specifically requires such size?

microbuilder commented 4 years ago

@microbuilder, the question is what's wrong: is it the case that mps2-an521 machine has 16MB of RAM, and qemu refuses us to set any other value (we indeed configure it at 1MB), or TF-M binary specifically requires such size?

The chip has 16 MB, yes.

pfalcon commented 4 years ago

Ok, with https://github.com/Linaro/lite-lava-docker-compose/pull/98 merged, and applying following patch to the job from this PR:

--- a/example/regression-qemu-tfm.job
+++ b/example/regression-qemu-tfm.job
@@ -17,6 +17,8 @@ context:
   machine: mps2-an521
   serial: '-serial mon:stdio'
   vga: '-vga none'
+  memory: 16M
+  model: model=lan9118

 actions:
 - deploy:

I get:

start: 3.1 lava-test-monitor (timeout 00:04:54) [common]
Waiting for start message: 
Setting prompt string to ''
ok: start string found, lava test monitoring started
test monitoring timeout: 300 seconds
qemu: fatal: Lockup: can't escalate 3 to HardFault (current priority -1)
R00=00000000 R01=00000000 R02=00000000 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=ffffffe0 R14=fffffff9 R15=0a414530
XPSR=40000003 -Z-- A S handler
FPSCR: 00000000
err: lava test monitoring reached end of file
Connection closed

I.e., the binary crashes. Is it known to run with this particular QEMU version? (qemu5 from debian). Are command-line args right enough?

microbuilder commented 4 years ago

@pfalcon Test runs and passes as expected:

Screenshot 2020-07-07 at 16 53 55
pfalcon commented 4 years ago

@microbuilder: Confirm that the current version of this PR passes on my local LAVA install, as expected.

My only concern is naming of the job file, please see comment above.

pfalcon commented 4 years ago

@microbuilder, Oh, and also please check that the .hex file as included in this PR is the latest/known-working. Thanks.

microbuilder commented 4 years ago

@pfalcon Should be merge-ready, thanks for the feedback.