2022-02-20
00:24Gaspare has quit [Quit: Gaspare]
01:24willemml has joined #asahi-dev
01:36willemml has quit [Quit: willemml]
03:25kov has quit [Quit: Coyote finally caught me]
03:25phiologe has joined #asahi-dev
03:26kov has joined #asahi-dev
03:29PhilippvK has quit [Ping timeout: 480 seconds]
04:47gladiac is now known as Guest340
04:47gladiac has joined #asahi-dev
04:53Guest340 has quit [Ping timeout: 480 seconds]
04:53axboe has quit [Quit: leaving]
05:25psykose has quit [Remote host closed the connection]
05:26psykose has joined #asahi-dev
05:57willemml has joined #asahi-dev
06:34willemml has quit [Quit: willemml]
07:19willemml has joined #asahi-dev
07:31willemml has quit [Quit: willemml]
08:03willemml has joined #asahi-dev
08:15willemml has quit [Quit: willemml]
08:50Glanzmannpovik: Compile warnings are already fixed by axboe: tg.st/u//u/0001-apple-mca-correct-prinkts.patch
08:51Glanzmannpovik: I would not get my hope up, the last 'asahi' branch also had three small hickups which killed the keyboard that never got in after the initial 'merge' for 4 weeks. :-)
09:21j`eyI wonder if it's easier for markan to just cherry-pick on top of asahi, and then incorporate all the fixes into the proper branches on the next rebase
09:22jannaupovik: `git commit --fixup $commit_hash` is helpful for suche commits. `git rebase --autosquash` handles sorts and marks such commits as fixup automatically
09:24jannauI think it is. that's how I work on stuff living in a bits branch. That case is even worse as I can't test the bits branch standalone
10:04chadmed has joined #asahi-dev
10:46gabuscus has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
10:46gabuscus has joined #asahi-dev
11:41bps has joined #asahi-dev
12:40marcankettenis: I think we should move it under asahilinux, yeah. I can give you commit rights :)
12:40marcanI finally got the kernel ~where I want it, so I finally need to get on the u-boot side of things
12:44mpsmarcan: would it be (in future) possible to integrate m1n1 and u-boot, and does this idea make sense at all
12:47mpsdistros would like to install m1n1+u-boot once (when machine is converted to linux/openbsd) and upgrade kernels with dtbs whenever are mainline kernels are released
12:50marcanm1n1 will eventually have chainloading from NVMe ability so that can bring in updated dtbs
12:51marcanit doesn't make any sense to upgrade dtbs outside of m1n1 because m1n1 has to modify the dtb, and because very often m1n1 will require some more initialization code to make whatever you changed in the dtb work anyway
12:52marcanbut we've already very thoroughly proven that chainloading m1n1 is a solid way to add features, so we're just going to make that the normal way
12:53marcanbut it's not as easy as "distros upgrading dtbs" either; we're going to need some kind of max-version mechanism, because we don't want a distro to downgrade a m1n1 that was installed by the installer which is newer
12:53marcanso that will require some thought, probably just having m1n1 be packaged in /usr/share or whatever and then have an install script that checks versions and only installs it if it's newer
13:14svenalright, i'm out of ideas why we miss interrupts or don't start commands sometimes without the lock around the writel :/
13:15svenfrom looking at the ANS firmware there's a hardware FIFO behind that submission doorbell and ANS would panic if we somehow managed to overflow it. I've also written some hack in m1n1 to issues commands from all 8 cores simultaneously and everything worked as expected.
13:15sventhere also doesn't seem to be any relationship between the CQ and the NVMMU inval. I can submit commands with the same tag even without advancing the CQ as long as I invalidate the tag inbetween
13:32bps has quit [Ping timeout: 480 seconds]
13:51bps has joined #asahi-dev
14:36kettenismarcan: I suppose the easiest way is for you to fork https://github.com/u-boot/u-boot and give me access to that such that I can push my asahi branch to that?
14:40bps has quit [Ping timeout: 480 seconds]
14:42bps has joined #asahi-dev
14:56bps has quit [Ping timeout: 480 seconds]
15:13___nick___ has joined #asahi-dev
15:13___nick___ has quit []
15:15___nick___ has joined #asahi-dev
16:01jannauone simple way to set the boot_esp variable in u-boot would be to tunnel it through the chosen devicetree node
16:03jannaum1ni could set it from a config payload. modifying all dtbs from the installer seems to be annoying
16:17bps has joined #asahi-dev
16:24jannauthe installer will create for each installtion a seperate efi system partition which is fully owned by the installed OS
16:36mpstpw_rules: I think 'breaking' u-boot will be still possible with pressing key before timeout expire
16:36tpw_rulesso the usb device would have to have an ESP with the correct UUID to be booted from. it would be possible to manually construct a bootefi command but that would be a pain.
16:38jannauit intentionally will only boot from a partition with the correct UUID, otherwise it's just a proof of concept and we can think how we can make manually booting from mismatched ESP easier
16:39jannaucurrently the easiest option to override the booth from the cmdline would be to modify boot_esp
16:46jannauthis is for the u-boot bundled by the installer and required to support more than one linux/*bsd installation without requiring cooperation
16:47jannauyou're free to install a m1n1 + u-boot payload configured as you like in the same way you do it now
16:51jannauI guess most will not have more than one alternative OS installation and they would expect it to boot like it was installed and not from a random usb-stick
16:51kettenisI'm skeptical about this approach; OS installers will be confused by the presence of multiple ESPs
16:58kettenisso if things continue to work as normal if you just create a single "install" in the Asahi installer I don't see a problem
16:58tpw_rulesimo the asahi installer should have a base option of making free space on the disk and installing m1n1 + u-boot. then have a separate section where it will optionally create an ESP and rootfs and download a few pre-canned images to it. otherwise, you put an iso on a flash drive or so and boot off that
17:00jannaumps: this is an proof of concept, there can be a convenient way to boot from a mismatched partition
17:02jannaubut a usb rescue system is good argument for using a blessed boot partition. I the main installation is also on usb it would only depend on scan order which one is booted
17:05tpw_rulesat the risk of making the boot process even more ludicrous, rEFInd will let you select multiple boot options from one ESP without having to persist anything
17:13tpw_rulesif the goal behind having multiple ESPs is to have multiple linuces on the same machine, then i think one ESP + rEFInd in the fallback boot path is better
17:23kettenisso one thought I had was to have a way for the OS to leave a file behind on the ESP that would then be used to update the EFI variables on the next boot
17:25kettenisif we get something agreed upon and convince the maintainers of the efibootmgr tool to implement it, that would provide a solution for all systems that don't have proper EFI variables support
17:25mpsjannau: yes, understand that this is POC and I just thinking aloud what is in my head right now, which doesn't mean I'm right
17:34kettenisjannau: I'm wondering if it is possible to pre-seed the EFI variables in u-boot in a way that makes "bootefi bootmgr" do the right thing
17:37kettenisnote that the current u-boot config does not define CMD_EFIDEBUG and doesn't provide a way to save the U-Boot environment
17:41marcanjannau: yes, we won't touch dtbs from the installer since they have to be generic; /chosen was my plan
17:43marcankettenis: OS installers will need changes to support multiple ESPs, yes; one workaround would be to have u-boot or m1n1 mark the current ESP as the only real ESP, but that's hacky
17:44marcanwe still want multiple ESPs for other reasons, like platform firmware comes from the stub which goes in its associated ESP
17:44marcanfrom the POV of the platform the stub partitions are the OSes; it doesn't *really* make sense to have them all merge back into one ESP
17:44marcanand I don't see how we can support EFI variables sanely including runtime services, which we need for installers to work...
17:44marcanso it seems easier to get distros to read a DT node and look for the ESP there, to be honest
17:45jannaukettenis: can't we use u-boot's standard environment handling for that with a file on the ESP? and then convince the efibootmgr to support this format
17:46marcanplus there's the whole how badly are we going to confuse SEP if multiple OSes try to use it under the same boot context
17:46marcanI see too many things becoming a mess letting OSes share an ESP, at least for the "official" install approach
17:50kettenisif you can achieve what you want with pre-seeded EFI variables, I think that would be preferable to hacking the distroboot script
17:52kettenisall those APFS volumes and EFI partitions would eat too many entries in the BSD disklabel
17:53marcananyway, next week is going to be playing around with all this and the installer, that's why I wanted a u-boot repo
17:55jannauwe should not hack the distroboot scripts, that's just the PoC, we would use our own bootcmd to search and boot the blessed ESP first (reusing as much as possible from the distro boot)
17:55kettenisas with the asahi branch for the linux.git repository, expect this branch to be rebased every now and then
17:57Glanzmannjannau: Just one thing you should keep in mind: parted and the Debian installer creates partition numbers which are not ordered. If you run diskutil under macos, it will reorder the partitions. That means you can not use the parition as identifier for the esp, but you need another mechanism.
18:20tpw_ruleslike it will read the efi variables off the first ESP it finds, which brings us back to the original problem, right?
18:25jannauadd a "esp_uuid" property to the "/chosen" node in the dt and set an u-boot env variable based on it
18:26tpw_rulesok. so u-boot could also just use that to pick an ESP that it tries to read its variables from
18:28jannauyes, it will be a little annoying to recreate all the device scanning distro_bootcmd does
18:35tpw_rulesyou would just have to modify here: https://github.com/u-boot/u-boot/blob/693650b15d04cd5a5861bd3136c9ed9e23f95c41/lib/efi_loader/efi_disk.c#L474 to check the UUID
18:36tpw_rulesu-boot's efi stuff already scans all the devices and partitions to locate an ESP and build the UEFI tables of devices
18:38jannauso it might not happen at all if the distro_bootcmd finds a partition with syslinux scripts first
18:44kettenishttps://github.com/devicetree-org/dt-schema/commit/0986f729eff0f40a66e85ab9dfb37681bf025ac4
18:48tpw_rulesworth nothing also that u-boot doesn't seem to offer an interface to select between different items in the BootOrder
18:55kettenisunfortunately this is an area of active development in u-boot and not necessarily one where there is consensus among developers how things should work
18:59arspeaking of menu-driven selection, there is a heavily-opinionated toward user-friendlyness fork of uboot, https://tow-boot.org/
19:13axboe has joined #asahi-dev
20:07jannauminimal viable change: https://github.com/jannau/u-boot/commit/d490a5cdc2ceecd3285602bb4411e98c8b7c04e4
20:37kettenisalthough as soon as you set the Boot#### and BootOrder EFI variables, those will override the effect of boot_esp as soon as "bootefi bootmgr" runs
20:41tpw_rulesyes, the segment of code i posted is what identifies the ESP that houses the variables
21:05bps has quit [Ping timeout: 480 seconds]
21:08___nick___ has quit [Ping timeout: 480 seconds]
21:13skoobasteeve has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
21:18skoobasteeve has joined #asahi-dev
21:21jeffmiw has quit [Ping timeout: 480 seconds]
21:37jannaumarcan: https://github.com/jannau/u-boot/commit/d490a5cdc2ceecd3285602bb4411e98c8b7c04e4 boots first from the specified UUID, if it's not found it will search for any bootable partition
21:38jannausetting the variable with "bootcmd" is a little strange but requires no u-boot code changes
21:43skoobasteeve has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
21:47skoobasteeve has joined #asahi-dev
21:55alyssajannau: "I declare my hack as good enough for now. Let's wait and see what happens upstream"
22:10bps has joined #asahi-dev
22:31axboe has quit [Quit: leaving]
22:43bps has quit [Remote host closed the connection]
23:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
23:53yrlf has joined #asahi-dev