#
…

2021-09-12

00:42tomtastic has quit [Quit: ZNC - https://znc.in]
00:42tomtastic has joined #asahi
01:04marcanit should be
01:05marcaner sorry, was backlogged
01:05marcanthat was re: SMC
01:05marcanit should come up before the main CPU
01:15dfip^ has quit [Ping timeout: 480 seconds]
01:30kettenis has joined #asahi
01:32___nick___ has joined #asahi
02:05chadmednoob-tier question, is there a particular technical reason why one might want to expose the UEFI interface on these machines other than to make the Linux experience more PC-like? the only obvious thing I can think of is it might make the life of distro kernel maintainers a little easier, but UEFI is... problematic... and i can see some users specifically complaining about it if made a requirement
02:06chadmedbut then again those users would probably have far bigger philosophical issues with this platform than needing to use UEFI
02:12marcanchadmed: what do you think is problematic about UEFI?
02:13marcanUEFI allows distributions to use the same installation process as on ARM SystemReady platforms (and x86), with GRUB and such, which users are used to and things integrate with
02:13phireI think it's more so that any random OS can work unmodified, like the various BSDs
02:14marcanthe OS still needs to be modified; *bootloaders* don't, and thus neither does a lot of the installation machinery
02:14marcanthat means once we upstream things into the kernel/userspace, distros don't have to do *anything*
02:14marcanyou just install m1n1+u-boot, plug in a USB install image, and it just works like on any other machine
02:14marcan(especially if we solve the page size issue)
02:15marcan(which looks likely with sven's magic)
02:15marcanwe are going to be using the UEFI implementation that is part of U-Boot; we are not throwing EDK2 on here
02:15phireby *works*, I mean with a basic framebuffer and keyboard via the UEFI interfaces
02:15marcanthat's not a thing once you exit bootservices AIUI
02:15marcanonly the FB, not the keyboard
02:16marcanand without interrupts and timers you can't really have an OS
02:16phirethat will apply to grub too?
02:16marcanno, I don't think grub needs IRQs, nor do most bootloaders
02:16marcanExitBootServices gets called prior to booting the OS
02:16phireI mean lack of keyboard
02:16marcanGRUB is a UEFI app that runs in the UEFI environment
02:16marcanOSes aren't
02:17marcanUEFI apps can use console/keyboard/etc services
02:17marcanOSes can only use an extremely restricted set of services, basically the framebuffer that is already set up and EFI variable storage
02:17phireI though OSes could continue to use UEFI interfaces after boot as a fallback for not having a driver. Guess I was wrong
02:17marcanyou're thinking of ye olde PS/2 SMM emulation nonsense on x86
02:17marcanthat's not a thing on ARM
02:18marcanand it runs on that secret hypervisor mode on x86 that has existed since pentium
02:18chadmedyeah no i dont have a personal problem with using it. it is disliked mostly in infosec circles because it is a large and complex interface (generally something youd want to avoid for security reasons) and non-libre. like i said though, these sorts of people likely have far bigger things to complain about with this platform than the UEFI
02:18phireyeah, I don't think I've played with OS dev since UEFI became a thing
02:18marcanchadmed: it's completely libre
02:18marcanall the code is open source, both EDK2 and what we'll be using in U-Boot
02:18marcanand as I said, the U-Boot version is way, way simpler
02:18marcanthis is not UEFI *firmware*
02:19marcanthis is *U-Boot* that just happens to provide a UEFI *interface*
02:19marcanit's a very different thing
02:19chadmedyeah true
02:19chadmedi did not realise EDK2 and uboots interface were actually libre
02:19chadmedthat was _my_ main gripe with it
02:19marcanUEFI's core stuff is completely open source, e.g. the versions that run on KVM/QEMU
02:19marcanyou can build them yourself, I have
02:19chadmedi guess other complaints are also PC-centric
02:20marcanof course once manufacturers go and put that on devices they throw in a million proprietary modules
02:20marcanpart of which is required by AMD/Intel etc
02:20marcanbut this isn't even that, this is a completely separate implementation in U-Boot, which has nothing to do with EDK2 as far as I know
02:20marcan(except maybe like, headers)
02:20marcan(not sure, just guessing)
02:21chadmedyeah ive worked with uboot precisely once but didnt really pay attention to what parts of uefi it actually incorporates
02:21marcanthere are of course technical reasons not to like UEFI's design (e.g. the fact that it uses the Windows PE executable format of all things), but those are minor gripes; the reality is that for better or for worse it's a standard well worth supporting
02:22marcanand actually completely openly documented and open source as I said
02:22marcan(in its core)
02:22marcanof course if you want to build U-Boot without UEFI support and install that with m1n1, you are completely free to do that too :)
02:22marcanthen you get to roll your own install tooling though, most mainstream distros won't be managing U-Boot configs for you
02:23chadmedwell yeah if youre building your own kernel youll be able to load it and the dt straight from m1n1 like is possible now, right?
02:24marcanyeah though I wouldn't recommend skipping U-Boot, because it means you have to go into macos recovery for every kernel update
02:24marcan(or load it via USB, tethered)
02:25chadmedah yeah true that would get very painful
02:25marcanthe point of the m1n1 -> U-Boot -> GRUB chain is that each step of the way gets closer to distro/user-friendly management
02:25marcansure you can skil everything after m1n1, it's just not... practical
02:26chadmedyeah and once youre out of boot services theres no difference to the user experience while the machine is running, apart from not having to mess around with macos every time theres a kernel update
02:27marcannot even sure if U-Boot provides runtime services
02:27marcanI should look into that
02:27marcan(EFI variables basically)
02:27marcanI'm guessing not, given it has no way to share storage access
02:27marcanso probably efibootmgr and co won't actually work, need to look into that
02:27yuyichao has quit [Quit: Konversation terminated!]
02:27marcanbut at least booting from the default path should
02:28marcan"As of U-Boot v2018.03 UEFI variables are not persisted and cannot be set at
02:28marcanruntime."
02:28marcanyeah thought so
02:29marcanso we might still need to have users manually move grub if installed to a nondefault path, or patch u-boot to recognize "typical" boot paths for distros, to make it properly seamless
02:29chadmedyeah it seems to have once been able to but no longer
02:29yuyichao has joined #asahi
02:29marcanthere's no real way for us to support that
02:30marcansince unless we use the M1's actual nvram (which seems reeeeal hairy), we'd have to store variables on disk
02:30marcanand we have no way to share NVMe access with the running OS
02:30marcanOTOH, it would be possible to just patch efibootmgr to access efivars differently, or even if u-boot uses an EFI variable storage as flat files, just bind mount that into /sys/firmware/efi/efivars
02:30marcanthat'd be a neat hack
02:33chadmedits probably worth finding ways to avoid exposing the machine's nvram at all costs. someone will inevitably brick their machine if they have the means to do so
02:33chadmedit should probably be a formalised axiom at this point :P
02:34marcanyes, I don't plan to expose the NOR flash at *all* unless I have to
02:34marcanyou'll probably need a DT overlay or somesuch to turn it on if I have my way
02:35marcanOTOH I've heard that, in fact, these machines *are* fully unbrickable via DFU even if you manage to nuke the entire NOR
02:35marcanthough I'm not sure if I want to try that
02:35marcanI guess that works by grabbing certs/calibration from the mothership? which is neat if it works
02:43tomtastic_ has joined #asahi
02:44tomtastic has quit [Ping timeout: 480 seconds]
02:50malvo has quit [Ping timeout: 480 seconds]
02:51malvo has joined #asahi
02:56PhilippvK has joined #asahi
03:00phiologe has quit [Ping timeout: 480 seconds]
03:27phirethat would imply there is some other way of identifying the serial number, other than NOR
03:44marvin24_ has joined #asahi
03:47marvin24 has quit [Ping timeout: 480 seconds]
04:19chadmedgetting flashbacks of the pentium iii...
04:27marcanphire: fuses
04:27marcanthe chip ID etc
04:27marcanthere is definitely calibration data in fuses too
04:28marcanchadmed: *every* modern SoC has a unique serial number
04:28marcanthat ship has long sailed
04:28marcanthe piii controversy wasn't about that
04:28marcanthe piii controversy was about *letting any random unprivileged app read it*
04:28marcan*that* was the problem, not the existence of a serial number
04:57zigmars has quit [Remote host closed the connection]
05:04zigmars has joined #asahi
05:12zigmars has quit [Ping timeout: 480 seconds]
05:22zigmars has joined #asahi
05:31zigmars has quit [Ping timeout: 480 seconds]
05:33zigmars has joined #asahi
05:38sorearcan the fuses be used to brick the soc during usage or do they have a "lock out fuse writes" fuse
05:58amwmarcan: I'm testing your installer again so I can update the wiki but it's failing with "Unable to determine primary OS" - https://paste.debian.net/1211454/
06:01nico_32_sorear: an "out of factory" fuse?
06:01sorearsomething like that
07:02amwI think my problem might be because I upgraded MacOS 11.5.2 (was 11.4 when it worked last time)
07:51svenalyssa: :<
08:08aleasto has joined #asahi
08:34marcanamw: it should work; it doesn't like something about the macOS partition
08:35marcansorear: they usually have locks like that, yes
08:36marcanamw: can you show the APFS volumes on that first partition?
08:36marcanif you have multiple installs in one APFS container it won't work, I need to rearchitect things a bit to fix that
08:36j_eyamw: if you want to debug the code, im pretty sure the issue is that https://github.com/AsahiLinux/asahi-installer/blob/bfbd5dbca42ae772949a03426c0bbdea4ce87ac7/src/osenum.py#L45 is returning early, just not sure which part is failing
08:37j_eymultiple installs is probably the 'elif len(vols) > 1:' bit?
08:37marcanand you can run it from /tmp/asahi-install and just edit files there
08:37marcanyeah, exactly
09:03akemin_dayo has quit [Ping timeout: 480 seconds]
09:05riker77 has quit [Quit: Quitting IRC - gone for good...]
09:15riker77 has joined #asahi
09:16Benjamin2365 has joined #asahi
09:20Benjamin2365 has quit [Remote host closed the connection]
09:20Benjamin2365 has joined #asahi
09:21akemin_dayo has joined #asahi
09:37Benjamin2365 has quit [Quit: Page closed]
09:37Benjamin2365 has joined #asahi
09:42Benjamin2365 has quit []
09:45kettenis has quit [Ping timeout: 480 seconds]
10:00abilash1994[m] has joined #asahi
10:03kettenis has joined #asahi
10:23amwmarcan: I don't know which partition you want - so all are here https://paste.debian.net/1211464/
10:32amwdisk0s2 returns at 'elif len(vols) > 1:' bit
10:49marcanamw: you have a Linux-V thing going on in your first container
10:49marcanbesides the macOS install
10:49marcanthat's what's causing it to bail
10:49marcan(I need to fix this to make multiple OSes per container work)
10:52Tom__ has joined #asahi
10:59StupidYui has quit [Ping timeout: 480 seconds]
11:16zigmars has quit [Remote host closed the connection]
11:17zigmars has joined #asahi
11:36jmcneillmarcan: U-Boot can provide quite a few UEFI runtime services apart from variable services
11:38jmcneill(whether or not it does depends on build options and target I suppose)
11:41jmcneillNetBSD will use UEFI RT services for RTC access and if PSCI isn't available, for shutdown/reset
11:42jmcneill(although only when booting in ACPI mode today)
11:43jmcneillfor shutdown/reset anyway
13:17zigmars has quit [Remote host closed the connection]
13:23zigmars has joined #asahi
13:31zigmars has quit [Ping timeout: 480 seconds]
13:49zigmars has joined #asahi
13:51zigmars_ has joined #asahi
13:51zigmars has quit [Read error: Connection reset by peer]
13:59zigmars_ has quit [Ping timeout: 480 seconds]
14:01zigmars has joined #asahi
14:09zigmars has quit [Ping timeout: 480 seconds]
14:47svenshutdown may a bit tricky. it requires talking to the SMC co-processor which can't easily be multiplexed between the os and u-boot. and the os will probably need to talk to SMC for e.g. enabling wifi
15:02everslick_ has joined #asahi
15:08everslick has quit [Ping timeout: 480 seconds]
15:41zigmars has joined #asahi
15:49zigmars has quit [Ping timeout: 480 seconds]
15:51boardwalk has quit [Quit: The Lounge - https://thelounge.chat]
16:39jmcneillyeah common problem with UEFI RT, i think why a lot of vendors prefer other approaches
16:40jmcneilloften problematic for i2c based RTCs too
16:42jmcneillfor shutdown/reset your OS stack is probably quiescent or crashed by the time you make those calls, so it's not as much of a problem
16:44sventrue. i guess uboot could just reinitialize communication with SMC at that point and send the shutdown command
16:48kettenismost runtime services are optional
16:48method_ has joined #asahi
16:50kettenisthis includes the ResetSystem() call so we don't have to bend over backwards to implement that in u-boot
16:51kettenissame holds for GetTime()/SetTime()
16:52Method has quit [Ping timeout: 480 seconds]
16:55Andalu30 has joined #asahi
16:58kettenisNot being able to set the BootOrder variable and others isn't really an issue if you don't install multiple OSes that boot via UEFI as the removable media boot flow will just work
16:59kettenisI believe most of the arm64 linux distros that use the UEFI bootflow can handle that already and so can OpenBSD
17:25marcankettenis: I don't know if this is different on arm64, but at least on x86 it's common to put grub on a nonstandard path and rely on BootOrder to point to it
17:27j_eywhat's the benefit over uboot loading grub?
17:27j_eys/over/of/
17:27marcandistros being able to use the usual kernel management stuff
17:27j_eyoh, distros might be using grub..
17:27j_eyyeah ok
17:42Andalu30 has quit [Ping timeout: 480 seconds]
17:53jvoisin has joined #asahi
17:58lanodan has quit [Quit: WeeChat 3.1]
18:11zigmars has joined #asahi
18:42lanodan has joined #asahi
19:04aleasto has quit [Remote host closed the connection]
19:10psykose has quit [Remote host closed the connection]
19:17zigmars has quit [Remote host closed the connection]
19:32zigmars has joined #asahi
19:35zigmars has quit [Remote host closed the connection]
19:38boardwalk has joined #asahi
19:49nsklaus_ has quit [Quit: WeeChat 3.2]
19:50nsklaus has joined #asahi
20:14zigmars has joined #asahi
20:34lanodan has quit [Quit: WeeChat 3.1]
20:58bpye has quit [Quit: The Lounge - https://thelounge.chat]
21:05bpye has joined #asahi
21:12lanodan has joined #asahi
21:46zigmars has quit [Remote host closed the connection]
22:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
22:01yrlf has joined #asahi
22:20Darksecond has quit [Read error: Connection reset by peer]
22:20Darksecond has joined #asahi
22:24akemin_dayo has quit [Ping timeout: 480 seconds]
22:25ella-0[m] has quit [Ping timeout: 480 seconds]
22:31ella-0[m] has joined #asahi
22:40___nick___ has quit [Ping timeout: 480 seconds]
…