#
…

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:31povikmarcan: in asahi sound needs thix fix: https://tpaste.us/DXyl
08:32povikand if we will be touching the branch somehow i should fix the compile warnings too
08:50Glanzmannpovik: Compile warnings are already fixed by axboe: tg.st/u//u/0001-apple-mca-correct-prinkts.patch
08:50Glanzmanntg.st/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. :-)
08:55povikworth trying...
08:55povikyeah, the warnings fix is obvious
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
09:27povikjannau: i know that workflow, but then there's the cherry-picking j`ey suggests
09:30jannauI'm not suggesting to rebase immediately, the fixup commit can be cherry picked as well
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:44jannaunot much to do on u-boot side except integrating it into the installer
12:44mpsmarcan: would it be (in future) possible to integrate m1n1 and u-boot, and does this idea make sense at all
12:45marcanmps: not really, they chain off of each other
12:45marcanjannau: I mostly want to work out how to specify an EFI partition from m1n1
12:45jannauonly important missing feature is pcie support for the usb-a ports of the mac mini
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:50marcanwe already talked about this
12:50marcanm1n1 will eventually have chainloading from NVMe ability so that can bring in updated dtbs
12:51marcanu-boot will be embedded in the second stage
12:51mpsaha, that sounds fine (sorry, didn't read backlog here)
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
12:54mpsmarcan: thanks for good explanation. now I understand better
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:15svenand if you submit the same tag twice without that nvmmu invalidation ANS will panic
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:19tpw_rulesjannau: what is the point of this?
16:20tpw_rulesconfused about why marcan wants m1n1 to be involved with EFI
16:24jannauthe installer will create for each installtion a seperate efi system partition which is fully owned by the installed OS
16:25tpw_ruleshow will you boot off a flash drive or so
16:26jannauu-boot can't provide efi variables so using efi as boot manger will not work
16:27tpw_rulesit's currently possible by running commands at u-boot's prompt
16:28jannauthat will continue to work
16:29jannauthis patch will fall back to the u-boot cmdline if the ESP is not found
16:29jannaualso the installer could offer to create the ESP on the flash drive
16:29mpsjannau: cmdline or read extlinux.conf?
16:34tpw_rulesjannau: i think your patch will break a simple "run usb_boot"
16:36mpstpw_rules: I think 'breaking' u-boot will be still possible with pressing key before timeout expire
16:36tpw_rulesyes that is, but if you do "run usb_boot", it will go right back into that code path
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:37mpshmm, yes
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:39mpsjannau: currently I boot from usb without ESP
16:39jannaucurrently the easiest option to override the booth from the cmdline would be to modify boot_esp
16:39tpw_ruleshow is that easy?
16:40jannauit is easier than the other options
16:40svenit’s a proof of concept not a final patch
16:40tpw_ruleswouldn't you have to know and punch in the correct UUID?
16:41mpsI prefer u-boot default behavior, find first ESP or partition with extlinux.conf
16:43mpsor I don't understand this patch
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:48mpsbut this will confuse end users I think
16:50svenDo you have an alternative then?
16:50jannaudefine end users
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:51mpsjannau: distro end user
16:52mpsjannau: and some (most?) users would like to have rescue system on usb
16:55kettenisI'd rather figure out a way to support EFI variables
16:57kettenisthat said, most users will not install multiple Linux distros on their machines
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:04jannaukettenis: if we can get efi vars to work it would be preferable
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:12kettenistpw_rules: you are free to do that (is rEFInd a thing on arm64)
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:39tpw_rulesit seems to save something as there is a mysterious "ubootefi.var" file on my ESP
17:40marcankettenis: invite sent
17:41marcanjannau: yes, we won't touch dtbs from the installer since they have to be generic; /chosen was my plan
17:41tpw_rulesrefind seems to work well
17:42kettenismarcan: thanks
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:45marcanyeah, an efibootmgr patch could do it
17:45marcanbut I'm still not convinced of the idea of merging everything into one ESP
17:45marcanthen what, how does each top-level stub know which sub-OS to boot?r
17:45marcanremember there are good reasons to have separate stubs everywhere
17:46marcanfor one distros will want to update their DTBs/u-boot with the chained m1n1 thing
17:46marcanplus using the native bootpicker means a11y support
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:46marcanof course people will do whatever they want
17:48kettenisI'm just trying to prevent U-Boot on the M1 to become too much of a special snowflake
17:48marcanwell, u-boot doesn't really have to change more does it?
17:48jannaumutliple stubs are also needed for allowing an old dcp driver to continue to work
17:48marcanother than ESP selection
17:48marcanthat too
17:48marcandistros will update their kernels separately
17:48marcanyou'd be locked into the oldest supported firmware
17:48marcanthere's just too much pain down this road, as a default
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:50kettenissjg1 is trying to get rid of those scripts, so that hack wouldn't be future-proof
17:50marcancertainly, I don't particularly care about the approach
17:51marcanas long as we can use multiple EFI partitions
17:51kettenisnote that multibooting OpenBSD is pretty much a non-starter at this point
17:52kettenisall those APFS volumes and EFI partitions would eat too many entries in the BSD disklabel
17:52marcanthat seems like an OpenBSD problem ;)
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:53marcanI'm happy to try any number of approaches as far as how u-boot actually handles this
17:53kettenisI pushed my asahi branch there; you might want to make that the default branch
17:54kettenis(I don't seem to have the permissions to do that)
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:56marcanyeah, I kind of assumed we'd be writing our own scripts/bootcmd to some extent anyway
17:56marcanthough I'm not a u-boot expert
17:56marcananyhoo, feel free to shave this yak while I sleep :-)
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.
17:57kettenisthat's why it uses UUIDs
17:58kettenismarcan: sleep well
17:59Glanzmannkettenis: I just looked at the patch, you're right of course. ;-)
18:11tpw_rulesi did some testing with efidebug and it looks like writing ubootefi.var will work
18:15tpw_rulesbut actually, wouldn't pre-seeding EFI variables require a specific ESP?
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:22tpw_rulesjannau: how would you plan to tell u-boot about the blessed ESP?
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:26tpw_ruleswhich is not controlled by the distro bootcmds
18:28jannauyes, it will be a little annoying to recreate all the device scanning distro_bootcmd does
18:28tpw_ruleshm? you don't need to
18:28tpw_rulesjust write the EFI device path to the vars file
18:33jannaufor finding the correct ESP to read the vars file
18:33tpw_rulesbut it already does that
18:35jannauI don't follow
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:36tpw_rulesindependent of the scanning in distro_bootcmd
18:37jannauare you sure this happens before distro_bootcmd?
18:37tpw_rulesit happens when distro_bootcmd tries to run the boot manager
18:37tpw_rulesthe efi boot manager
18:38jannauso it might not happen at all if the distro_bootcmd finds a partition with syslinux scripts first
18:42tpw_rulesthat might actually be a problem
18:45kettenisthat is the existing mechanism to "configure" u-boot from the device tree
18:48tpw_rulesworth nothing also that u-boot doesn't seem to offer an interface to select between different items in the BootOrder
18:48tpw_rulesit just always does the first one
18:50kettenistpw_rules: I believe there is a diff for that on the mailing list
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:00tpw_rulesyeah, i've been eying that too (and talking with the person behind it a lot)
19:13axboe has joined #asahi-dev
19:44jannaukettenis: but not yet implemented/committed in u-boot. it seems to use "/config"
19:49kettenisdid I say this is all a bit of a mess?
20:36kettenisjannau: that should indeed work with the current status quo
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:39jannauI think that's fine since we first need to find the ESP to read the EFI variables
20:40ketteniswell, yes, that is the other issue
20:40kettenisI think the EFI variables will be read from the first ESP, even with your change
20:41tpw_rulesyes, the segment of code i posted is what identifies the ESP that houses the variables
20:41tpw_rulesthe distro_bootcmds script doesn't really have anything to do with that
20:42kettenisthat is the attempt to get rid of the distroboot scripts that I mentioned earlier
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:34jannauI declare my hack as good enough for now. Let's wait and see what happens upstream
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"
21:55alyssaWoo you understand how the DCP driver happened now -p
22:10bps has joined #asahi-dev
22:31axboe has quit [Quit: leaving]
22:36jannauwhat's upstream of dcp? macos or linux-drm?
22:42alyssajannau: yes.
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
…