From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mx.groups.io with SMTP id smtpd.web10.46328.1674657193302152562 for ; Wed, 25 Jan 2023 06:33:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=auZJ+DV1; spf=pass (domain: kernel.org, ip: 145.40.68.75, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 38D7FB81991 for ; Wed, 25 Jan 2023 14:33:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAA02C433A4 for ; Wed, 25 Jan 2023 14:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674657189; bh=n0I5c3GPIy2LJfZ8f1o0UGmMK8k7PeFAx1umcGPiPaE=; h=From:Date:Subject:To:From; b=auZJ+DV1B/zCCn5nnfyQEOnyFIdU1aE4+nPKqkxf2dqMc2EtjKGXj93fUeCBKR1m0 HEVT3x4rivmu/6Isk5zqX2I25pYSaHYkN0h+sZxWkvJhV6pVPZrbv3QMdn0hfEEUxb QRk1UTpn5SP4k70wVYSwhODKLh8tye5qWRedHA2v8vRuWMu9wQzp6Doy1Xwc2yWc0h i9ajjmcfLByehtKMsWTTWd3PRyFdPtAx7S/cKGlM6rYaMpeBp+9ciYgpU2dal3YsU3 hY4MklvRjn4QT5hL8/P+8xwfjYf+ioWuPaSIFJpF4qVd2WT1z8IZPZH05cjjxgnLLv 75EXJkJpwIF7A== Received: by mail-lj1-f180.google.com with SMTP id c3so20562932ljh.1 for ; Wed, 25 Jan 2023 06:33:09 -0800 (PST) X-Gm-Message-State: AFqh2krsaZs8zLL9XwC0SxB59ne8wvJ6NLhNxFPQWiJ6opYO4rkpSiNy f/HAQxJOIPeT9cPwGVi2YJgtrISKNA9EuYMblzA= X-Google-Smtp-Source: AMrXdXtmMvdJ2ELcCdxOQ0wxh7o5rQEeziMzuw3iZmGNLTxjQdc63xobrt08smI5GqamPiG9m3ezTrH1kfQ2FGJto4U= X-Received: by 2002:a2e:b173:0:b0:27f:bc58:3924 with SMTP id a19-20020a2eb173000000b0027fbc583924mr2752132ljm.352.1674657187839; Wed, 25 Jan 2023 06:33:07 -0800 (PST) MIME-Version: 1.0 From: "Ard Biesheuvel" Date: Wed, 25 Jan 2023 15:32:56 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: arm64 support for stuart To: Michael Kubacki , Sean Brogan , Gerd Hoffmann , Michael Kinney , edk2-devel-groups-io , Jiewen Yao , Oliver Steffen Content-Type: text/plain; charset="UTF-8" Hello all, Given some recent issues with OVMF and ArmVirtPkg, where regressions were not caught, or resulted in different behavior between TCG (emulation) and KVM (virtualized executon) when running under KVM. So I have started with increasing the test coverage for ArmVIrtPkg, even for configurations that are not necessarily used in production. (E.g., ArmVirtQemu can be built with secure boot support, even though the virtual platform is not constructed in a way where using it makes a lot of sense). This should increase the likelihood that we will catch CryptoPkg or SecurityPkg build time regressions that could potentially affect other ARM platforms as well. Another thing I would like to implement is support for running QEMU in KVM mode from stuart_build.py. One aspect of that is deciding whether or not KVM is available and accessible (suggestions welcome, especially with the containerized build env now in the mix) On arm64, the architecture is much more finicky when it comes to memory ordering, alignment and mismatched memory attributes and coherency, and so enabling boot testing under KVM would be a meaningful addition there as well, given that TCG emulation does not model any of these behaviors However, the stuart stack fails to locate some of its dependencies (notably mu_nasm and iasl), and so I cannot even build the firmware on a arm64 Linux system, let alone execute it under virtualization. Given that nasm is x86 specific, we should be able to work around this by moving the nasm_ext_dep.yaml file into the right place. Then, if/when mu_nasm for arm64 becomes available, we will also be able to build OVMF from arm64 (although I am probably the only person in the world who does that regularly.) iasl is a different matter, as we need it to build for arm64 as well. iasl is already available in the arm64 distros, so as I see it, there are 3 options here: - build iasl for Linux/arm64 and add it to the nuget repo - allow a fallback to system-wide iasl (how?) - install the x86 version and run it under qemu user mode emulation (which can be enabled transparently on most distros using binfmt-misc) I have no idea whether or not the latter is feasible in terms of dependencies (i.e., if the binaries are statically built, it should be straightforward, but otherwise it is going to be tricky) With this out of the way, I can happily run stuart_setup/update/build and build and boot test ArmVirtQemu under KVM virtualization.