#
…

2022-02-13

00:12mtjzh has quit [Ping timeout: 480 seconds]
00:18user982492 has joined #asahi-dev
00:37mtjzh has joined #asahi-dev
00:47axboe has quit [Quit: leaving]
00:53chadmed has quit [Quit: Konversation terminated!]
00:56chadmed has joined #asahi-dev
03:02user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
03:32grgy has joined #asahi-dev
03:33PhilippvK has joined #asahi-dev
03:37phiologe has quit [Ping timeout: 480 seconds]
03:46kov has quit [Quit: Coyote finally caught me]
03:46kov has joined #asahi-dev
04:16marcanerr... the low 16 bits of the raw RTC time I read are always constant, and the RTC time returned by SMC is << 15, not <<16, and does have active low bits
04:16marcanI'm smelling another "corellium did it wrong and everyone copied them" here...
04:19marcanoh wait, on the m1pro & friends it always goes via SMC anyway. let's see about the mac mini..
04:23marcanah, it does work on the mac mini/sera, interesting
04:23marcanand the LSB is always 0 so it's clearly <<15 either way
04:25user982492 has joined #asahi-dev
04:52marcanso the fractional part of the RTC time is somewhere else on maverick... dumping registers now :/
05:24marcanand I can't find it, lovely
05:43the_lanetly_052 has joined #asahi-dev
06:59AstaraOS has joined #asahi-dev
07:00* AstaraOShi all skraito here how are ya all ?
07:01* AstaraOSwhat you guys up to ?
07:03* AstaraOShey mind to do some coding advise at channel #0dev , let me know if anyone interested , lets code together
07:24AstaraOS<AstaraOS> yeah actually i am trying to break tor
07:24AstaraOS<arma> ah ha, i see that you have spammed every channel. definitely the wrong place.
07:24AstaraOS<AstaraOS> anyway if i know all node
07:24AstaraOS<AstaraOS> whwat is it that this tor is super bitcha anyway ?
07:24AstaraOS<AstaraOS> i just need to block all node
07:24AstaraOS<AstaraOS> if you go with server less
07:24AstaraOS<AstaraOS> people can block too
07:24AstaraOS<AstaraOS> client -- > server ?
07:24AstaraOS<AstaraOS> that's why in my opinion tor is stupid
07:24AstaraOS<AstaraOS> i don't even need the node
07:24AstaraOS<AstaraOS> just first node
07:25AstaraOS<AstaraOS> and last node
07:25AstaraOS<AstaraOS> if you encrypt it between middle
07:25AstaraOS<AstaraOS> i would rather
07:25AstaraOS<AstaraOS> use proxy
07:25AstaraOS<arma> ok. off you go then. please do not clutter up #tor.
07:25AstaraOS<AstaraOS> proxy1 -> proxy2 -< proxy3 -> proxy4 -> vpn --> target
07:25AstaraOS<AstaraOS> all traffic encrypted
07:25AstaraOS<AstaraOS> well i am skraito anyway
07:25AstaraOS<AstaraOS> that's why they call tor is stupid
07:25AstaraOS<AstaraOS> We are already breaking
07:27* AstaraOSlet's go code at channel #0dev if you guys want ... .
07:28* AstaraOSi am bot ? i am skraito the earthquake guy ... .just Repent https://tjc.org , before it's too late
07:31* AstaraOSif you want support from AstaraOS i am here or on another network #0dev or https://worldhacker.org
07:33* AstaraOShow to boot kernel from old to new one with out installation ?
07:34* AstaraOS[ Astara ] Team 0day request ... . https://worldhacker.org ... . https://worldhacker.org/index.php/irc-server/ ... . let's go code together :) and make some buck , i will wait ... .
07:35* AstaraOShandling case
07:37AstaraOS was banned on #asahi-dev by marcan [*!*@180.241.255.245]
07:37AstaraOS was kicked from #asahi-dev by marcan [AstaraOS]
08:02user982492 has quit [Remote host closed the connection]
08:02user982492 has joined #asahi-dev
08:08the_lanetly_052 has quit [Ping timeout: 480 seconds]
08:25user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
08:43the_lanetly_052 has joined #asahi-dev
08:58the_lanetly_052 has quit [Ping timeout: 480 seconds]
08:59user982492 has joined #asahi-dev
09:00user982492 has quit []
09:38marcankettenis/robher: I think I'm going to drop the idea of making the RTC forwards compatible and just use per-PMU compatibles and have the driver hardcode all the regs
09:38marcanI'm getting the feeling that Apple is moving towards doing this all in SMC anyway, given they're already outsourcing RTC reads to SMC for Maverick and apparently somehow the RTC pulls fractional seconds out of thin air
10:21marcanha, I think SMC is faking that tick count
10:22marcanif I wait for the PMU second to roll over, then read SMC, the SMC is a few milliseconds *behind* in its count, still on the previous second
10:22marcanmaybe it reads the PMU RTC on startup and then just free-runs off of some other clock in SMC?
10:31kettenismarcan: so what I found out is that the CLKM SMC key is present on the mini that I upgraded to 12.x but not there on the macbook pro that is still on 11.x
10:31ketteniswhich fits in with your theory that they're moving towards an SMC-based solution
10:33marcannow I almost want to just wait until 13.x and see if we can just put the RTC driver in SMC...
10:33kettenisregarding the shifts, I did quite a bit of experimentation and convinced myself the shifts in the OpenBSD driver are correct
10:33marcanthe tick count is >>1 to get 32768Hz ticks
10:33marcanthe offset is already in ticks
10:34marcanbut on maverick, the tick count always ends in 000a (pre shift) for some reason
10:34marcanso only integer seconds are valid
10:34marcanhowever, the field still starts at the a (!)
10:34marcanwhich you can tell because if you start reading at the seconds offset, the time never updates
10:34marcansince the time is atomically loaded into the registers when you read the first byte
10:38kettenisso the maverick PMU doesn't provide the sub-second resolution the sera pmu does
10:39kettenismost RTCs only provide second resolution so I suppose we can live with that
10:40marcanthe problem is the SMC is still providing sub-second resolution, and the offset also provides sub-second resolution
10:41marcanmost RTCs will reset the sub-second counter when you write to them, but we can't emulate that behavior without knowing when the second rolls over, which is annoying
10:41marcanand who knows how SMC implements that sub-second counter
10:42marcanso while linux will do sub-second updates when syncing to NTP on most RTCs, we can't implement that sanely here without hooking up the PMU driver to SMC
10:42marcanbut I guess for now this will have to do; if in 13.x they switch to a full SMC based solution we can just implement that and deprecate the PMU mechanism, and if they don't we can think of doing what macOS does and having the drivers talk to each other
10:43kettenisntp will fix it quickly enough
10:44kettenisthese days having the correct time is important such that you can do DNSSEC to lookup the ntp server
10:44kettenisbut that doesn't really need to be very accurate
10:45kettenisI suppose you ran macOS under the hypervisor to see what it does to set the clock?
10:45kettenisand it still pokes the PMU for that?
10:46gabuscus_ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
10:47gabuscus has joined #asahi-dev
10:48marcanlet me check, but I think so
10:55marcankettenis: yeah, it always reads the clock from SMC then immediately writes the offset to the PMU
10:57kettenisso they use the running clock in the SMC now, but stull use the offset in the PMC
10:57ketteniss/PMC/PMU/
10:57marcanhence the rtc helper function thing in the ADT
10:59marcanthe curious thing is how the SMC is synthesizing the sub-second precision
11:00marcanbecause if it's just free-running, it would fall out of sync with the real PMC clock, unless it continuously updates the PMC clock? but it's not writable as far as I can tell...
11:00marcanor maybe it has some magic way of reading it?
11:00kettenisI'm starting to suspect it is a different clock altogether
11:00marcanit has the same value though
11:00marcanat the seconds
11:01marcanand always rolls over a seemingly consistent-ish fraction of a second prior
11:01marcanpolling from m1n1 until the PMU rolls over, then reading SMC, I get: 001115b48005 (PMU) 001115b47fa8 (SMC)
11:14kettenisso maybe the way to solve this is to make the RTC a subnode of the SMC and reference the offset in the pmu through an nvmem-cells property
11:14marcanbut then the RTC needs to do the alarm stuff too
11:14marcanwhich isn't quite nvmem
11:15marcanthat said, there's a decent argument for doing that anyway, since we won't support alarms yet, and just hope 13.0 lets us do everything from SMC
11:16marcanand then I can also move the power sequencing stuff to SMC, that needs to poke at other PMU bits
11:16marcanit does kind of make sense to do it all in one driver under SMC and treat the PMU as dumb memory in this case
11:16kettenisyes, you'd have to have a separate RTC driver that handles the alarams
11:16marcanI'd be okay with saying no alarms in 12.x if 13.x comes around with everything doable from SMC
11:16marcanthen we just never have a PMU RTC driver
11:18kettenisthe sole reason for having alarm support is to be able to schedule a wakeup from suspend isn't it?
11:19marcanor from off
11:19marcanbut we don't even have suspend yet :)
11:20marcanalso looking at the nvmem stuff, that eliminates the entire question about how to represent this in the PMU binding since it just lets you define address ranges for cells
11:20marcanwhich means we can just treat the entire PMU as an nvmem device (a lot of it is), though I'd still make it an mfd so that if in the future we need to throw other things in there we can
11:22kettenispowerdown/shutdown could be done in the same way
11:30kettenisThis should help making things future-proof
11:31kettenisthe SMC keys are discoverable, so if at some point a key to read/write the offset appears the SMC RTC driver can just use that
11:31j`eyis it an offset from 1970?
11:33kettenisbasically the clock uses some arbitrary epoch and the offset is used to turn that into an offset from 1970
11:34kettenisto set the clock, you just tweak the ffset
12:15mtjzh has quit [Remote host closed the connection]
12:16mtjzh has joined #asahi-dev
12:23mtjzh has quit [Remote host closed the connection]
12:23mtjzh has joined #asahi-dev
12:30mtjzh has quit [Remote host closed the connection]
12:36mtjzh has joined #asahi-dev
12:37mtjzh has quit [Remote host closed the connection]
13:14mtjzh has joined #asahi-dev
13:20marcangoing to grab dinner, but here's a first pass at the binding: https://mrcn.st/p/fuLM5PaN
13:20marcankettenis, robher: ^
13:21marcangeneric spmi-mfd-nvmem driver is done, going to write the SMC RTC driver now hooking into it
13:21marcanI also added a bunch more nvmem/flag details I could gather around from the ADT and the PMU driver
13:21marcanI'm going to make the reboot driver handle the boot failure stuff properly too, since otherwise something could complain or decide to go into recovery mode or something
13:23marcanthere's one somewhat hacky thing in there, the RTC "nvmem" area actually covers the whole RTC including the counter, so you get the RTC included in the /nvmem file in sysfs if you cat it
13:24marcanbut I figured splitting it up into even tinier bits to avoid that isn't really worth it
13:24marcan(this is also why I *am* splitting it into 3 at least; if you try to cover the entire 64K PMU space with one NVMEM block, you get the whole thing when you cat the file, and that's bound to cause trouble)
13:28mtjzh has quit [Remote host closed the connection]
13:31mtjzh has joined #asahi-dev
13:36mtjzh has quit [Remote host closed the connection]
14:07mtjzh has joined #asahi-dev
14:25kettenisI suppose we should avoid exposing regions that have side-effects
14:31kettenisI question the wisdom of exposing hardware like that through sysfs, but that's not going to help you ;)
14:32alyssalet's not have a repeat of the infamous UEFI linux systems where "rm ... /" would brick the machine ;P
14:36mtjzh has quit [Remote host closed the connection]
15:14marcan*writing* to files in sysfs is a bit different from rm :p
15:14marcanbut FWIW I've been messing with nvram a lot today and nothing weird happened
15:15marcanthe RTC stuff shouldn't have any side effects when read
15:15marcanand writing to it won't brick anything; I tried :p
15:15marcanso I think we're pretty safe
15:17alyssa"I tried" 🍿
15:19kettenismarcan: what is pm_setting used for?
15:22marcankettenis: I think that's the power on after AC loss flag, but I haven't tested it yet
15:50alyssa has quit [Quit: leaving]
16:10the_lanetly_052 has joined #asahi-dev
17:00the_lanetly_052__ has joined #asahi-dev
17:06the_lanetly_052 has quit [Ping timeout: 480 seconds]
17:14refi64 has quit [Quit: The Lounge - https://thelounge.chat]
17:16refi64 has joined #asahi-dev
17:36sheepgoose has joined #asahi-dev
17:46the_lanetly_052__ has quit [Ping timeout: 480 seconds]
17:48sheepgoose has quit [Ping timeout: 480 seconds]
19:17chengsun_ has joined #asahi-dev
19:24chengsun has quit [Ping timeout: 480 seconds]
19:59user982492 has joined #asahi-dev
20:07philhug has joined #asahi-dev
20:24grgy has quit [Quit: ZNC 1.8.2 - https://znc.in]
20:26grgy has joined #asahi-dev
20:27grgy has quit []
20:35grgy has joined #asahi-dev
21:35AstaraOS has quit [autokilled: This host violated network policy. Contact support@oftc.net for further information and assistance. (2022-02-13 21:35:21)]
21:46user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
22:01auwooo has joined #asahi-dev
22:05* auwooogreeting all , how are you all ? night morning afernoon all , i have setup base here for United Nations , incase you need me just go to channel #astara and leave me a message , i will see your president from there , tell me which country are you from ... .
22:12auwooo has quit [Remote host closed the connection]
22:32auwooo has joined #asahi-dev
22:36auwooo has quit []
23:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
23:43yrlf has joined #asahi-dev
…