From nobody Tue Jul 25 09:10:32 2023 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R9B88388xz4pTNt for ; Tue, 25 Jul 2023 09:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R9B882NMHz4KpJ; Tue, 25 Jul 2023 09:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690276232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kjySAFq/0uJ4LQYPY1ZPzC1RVvXaIJKrJOOQLmqI6rk=; b=J85CEdugbuPizE3dzEeuJDAC4Hcsk4fHMJEZL+OO198rnhuGv+GKjpWOI1Nzp5+USIr/sC iKv74Me94tC7Xz6kU3lB0RTkBzbaAKevLAVvXthU/kkz+jBdgcJ4Ak/MMrQ69xxbTpg6ot 8ZFLYLDBeHaLTYkqr0/wBT5tdWgHzyRv5Qtey0MEgTanrO6AzHbvdWuva/WVszuGcIGvhF tAKKGglh3HP0PMmX5ApQTZK5vTYipsuzqY9rT/Skh5RQ2HFG4AhuExDZtHRNumcung4gWB IG9pdVxiS1Q0WmQQA7HMgK3kk6e8Mpo7HWJn9HCPxnAvLn7nQ1EwkfbhaZ5ThA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690276232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kjySAFq/0uJ4LQYPY1ZPzC1RVvXaIJKrJOOQLmqI6rk=; b=qc8kLvrLguCXnyT2EJPjM+7fGBa1dTI4KDBMVwlf+X/g5uV72mRNcfLteEqq/5evL4FZMn UTXvIsTQ2ZUTNN0eKKHWr4iglzdHOhPIoofqkm9jmYuiawpkZlbz2YW5z2oSbliwZfSVOO UcRg/QhavyT/t5yWoPmAShOuIamee3it7Ryr5HSBArtFUhYjZGCMCJmgzBaVaZiFuIXth1 BoLgyIun3VrPXFPRo83WU5VMeHIlsH4hqxkTkr3atR/xW79bCaIA0f6VwPNJxPxDeZmdXA ZEbHlLyb0P8DrfyeP5suow/x0IophZ3jlIdO5M7DaRWwb9PRgmUmy8/9ZyuhAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690276232; a=rsa-sha256; cv=none; b=dua1esLhEjb7iJbukAQyI/RHGmUPl1RRgv1AQ3t37ZCpaqz62RtBV8yUuV0Uuwl2SvC3ed 7TFuyT2k/mQpB4k2iZCq6qRBd7puC7dRkz51xXLG5oFp+twc/5bfRaR2qLw9PH6psOjogl p7d2ZedVhwnqAeGAi77qqpmqXD6x82beFEt8wiCcJgaaPPAm5e7z50D8Pdz7jXKMo8GATz NpSkmzEJyAkxHJHJgHwA+Ko1HWdeBHSix+3V+VLxoU5+8FGu08nwA0g0rlVJ4Q2OUBKMXn OsQdG5u1oGez13H5QAmtLXj2JeqYZxsfXAXbtqmcFGn3QrueEz07u306aCnEzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R9B881TRyztQy; Tue, 25 Jul 2023 09:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36P9AWue014847; Tue, 25 Jul 2023 09:10:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36P9AWRX014836; Tue, 25 Jul 2023 09:10:32 GMT (envelope-from git) Date: Tue, 25 Jul 2023 09:10:32 GMT Message-Id: <202307250910.36P9AWRX014836@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Lorenzo Salvadore Subject: git: 2ce9741087 - main - Status/2023Q2/kboot.adoc: Add report List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: salvadore X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ce97410877595e425d9a0109b77914980772d06 Auto-Submitted: auto-generated The branch main has been updated by salvadore: URL: https://cgit.FreeBSD.org/doc/commit/?id=2ce97410877595e425d9a0109b77914980772d06 commit 2ce97410877595e425d9a0109b77914980772d06 Author: Warner Losh AuthorDate: 2023-07-25 08:28:30 +0000 Commit: Lorenzo Salvadore CommitDate: 2023-07-25 09:05:55 +0000 Status/2023Q2/kboot.adoc: Add report Reviewed by: grahamperrin, status (Pau Amma ) Approved by: carlavilla (mentor, implicit) Pull Request: https://github.com/freebsd/freebsd-doc/pull/202 --- .../en/status/report-2023-04-2023-06/kboot.adoc | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/website/content/en/status/report-2023-04-2023-06/kboot.adoc b/website/content/en/status/report-2023-04-2023-06/kboot.adoc new file mode 100644 index 0000000000..c6a199cfa1 --- /dev/null +++ b/website/content/en/status/report-2023-04-2023-06/kboot.adoc @@ -0,0 +1,56 @@ +=== LinuxBoot FreeBSD on aarch64 + +Contact: Warner Losh + +Links: + +link:https://www.linuxboot.org/[LinuxBoot Project] URL: link:https://www.linuxboot.org/[]+ +link:https://docs.google.com/presentation/d/1N5Jp6XzYWv9Z9RhhETC-e6tFkqRHvp-ldRDW_9h2JCw/edit?usp=sharing[BSDCan 2023 kboot talk slides] URL: link:https://docs.google.com/presentation/d/1N5Jp6XzYWv9Z9RhhETC-e6tFkqRHvp-ldRDW_9h2JCw/edit?usp=sharing[] + +LinuxBoot is an effort to create a clean, robust, auditable and repeatable boot firmware. +What originally started as a specific project at Google has grown to encompass any boot environment that uses Linux to launch the final operating system. +Many platforms now support this environment, and in some cases it is the only available boot environment. +In addition, some embedded boxes have a LinuxBoot environment hard-coded that is quite hard to change, and being able to reboot into FreeBSD is desirable. + +The old Sony PlayStation 3 port used a boot loader called 'kboot' to boot the FreeBSD port from its Linux kernel (all predating the LinuxBoot project). +That code has been greatly expanded, made generic with easily replaceable per-architecture plug ins. +The normal FreeBSD [.filename]#/boot/loader# is built as a Linux binary that reads in the FreeBSD kernel, modules and tunables. +It places them into memory as if it were running in a pre-boot environment, then loads that image into the Linux kernel with man:kexec_load[2] and does a special reboot to that image. +For UEFI-enabled systems, it passes the UEFI memory table and pointer to UEFI runtime services to the new kernel. + +It supports loading files from the host's filesystem, from any man:loader[8]-supported filesystem on the host's block devices (including pools that span multiple devices), from ram disk images and from files downloaded over the network. +Any mix of these is available. +So, for example, configuration overrides can be loaded from the host's filesystem whilst the kernel loads from dedicated storage (say NVME) or a ram disk image. +It supports a host console running over stdin/stdout. +It supports explicit locations such as `/dev/nvme0ns1:/boot/loader/gerbil.conf` for where to load filesystems from. +It supports ZFS boot environments, including the boot-once feature. + +Additional details about kboot, what it supports and some general background can be found in Warner's BSDcan talk (slides linked above). + +FreeBSD/aarch64 now can boot from Linux in a LinuxBoot environment, with support and functionality comparable to man:loader.efi[8]. +Memory layout passed in for GICv3 workarounds. +Need patch for aarch64 kernel for the GICv3 workaround (link:https://reviews.freebsd.org/D40902[]). + +FreBSD/amd64 support is in progress and is maybe 80% done. +The amd64 boot environment places more requirements on the boot loader to provide data for the kernel than aarch64, due to amd64 being an older port. +All sources for data in the BIOS enviornment had to be provided by the boot loader since the kernel had no access to them from long mode. +While UEFI and ACPI provide ways for the kernel to get this data, much of the data must still be provided by the boot loader. +The kernel panics during initialization since all these prerequisites have not been discovered and implemented. + +PowerPC builds, but nothing more of its state is known. +Attempts to acquire a suitable Playstation 3 proved to be too time consuming for the author. + +==== Help Needed + +1. man:loader.kboot[8] needs to be written. +It should document how to use [.filename]#loader.kboot#, how to create images, and the use cases that work today. +1. Finish amd64 support. +1. The current elf arch-specific metadata code is copied from efi. +Unifying the kboot and efi copies is needed. +While they are mostly the same, sharing is complicated by remaining compile-time differences. +In addition, the build infrastructure makes sharing awkward. +1. It would be nice to add riscv64 support. +1. PowerPC testing (it has been untested since the refactoring started). +1. Creating a script to repackage EDK-II image (say, from QEMU) as a linux-boot image with a Linux kernel built on FreeBSD for CI testing. +1. Testing it from the coreboot LinuxBoot. + +Sponsored by: Netflix, Inc