marcan changed the topic of #asahi to: Asahi Linux: porting Linux to Apple Silicon macs | General project discussion | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Topics: #asahi-dev #asahi-re #asahi-gpu #asahi-stream #asahi-offtopic | Keep things on topic | Logs: https://alx.sh/l/asahi
yuyichao has quit [Ping timeout: 480 seconds]
<shenki>
jannau: the hypervisor keeping the usb port, if I'm seeing it drop off part way through osx boot then it must be a different issue?
<shenki>
nevermind. i was planning on looking at how the pmu worked, but i see maz has a driver in his tree already
<chadmed>
huh so apparently apple will at some point in the next couple of years be trying to sell its silicon to hyperscalers. we might be getting first party help
<timetheory[m]>
?
<chadmed>
well no one in the datacentre/infrastructure market is going to just accept running macos server, theyre going to want linux. so if apple plan on selling their chips into this market, they will need to make sure they run linux.
mps has quit [Ping timeout: 480 seconds]
<timetheory[m]>
I feel like the most likely scenario is that they make their own port
<timetheory[m]>
When has Apple ever helped an open source project majorly
<timetheory[m]>
It’s probably countable on a single hand
<kode54>
they have helped themselves to open source projects
<kode54>
but that's about it
<timetheory[m]>
Yeah they don’t contribute back the code to upstream 99% of the time
<chadmed>
yeah but linux is GPL2 licensed, so they cant do what they usually do with MIT/BSD licensed projects
<chadmed>
they will need to make the source for their modifications available upon request, and a big deal in that market segment is audit. theyre not going to run black box kernels on their machines. if apple are serious about getting back into the server game, they have to play by the markets rules, which are very different to the consumer segment
<timetheory[m]>
They’re running black box Secure Enclaves either way
<timetheory[m]>
What I think is the most likely is that they just make macOS based on BSD or something
<chadmed>
yeah and they also run amd psp and intel me, that device firmware doesnt matter so much as actual kernel modifications to these guys
<timetheory[m]>
If they really want to use iChips they’ll use it even if the software is black box
<timetheory[m]>
Frankly the best that can reasonably be hoped for is for Apple to post their code on GitHub or something without documentation on the changes
<timetheory[m]>
I doubt they’re giving us actual documentation on hardware and stuff
<chadmed>
no they wont, not unless apple provide some absolutely enormous benefit over the status quo. apple simply wont sell any chips if they come in acting like hotshots trying to dictate what customers can and cannot run on their chips.
<timetheory[m]>
Fine maybe they’ll release the documents to the high paying customers under strict NDAs
<timetheory[m]>
But it’s being too hopeful to think Apple will directly try to help us and send documentation our way
<chadmed>
oh no i didnt mean direct help for us specifically, but they will in some form or another be forced to make linux work on their chips, and because linux is GPL2 licensed, they have to make those modifications public
<chadmed>
they are used to obfuscating their open source forks because they usually just prey on BSD/MIT licensed stuff. they cant do that with linux.
<timetheory[m]>
Yeah that’s possible
<chadmed>
so either way, if theyre serious about that market, we will benefit indirectly at the very least
<timetheory[m]>
I thought you meant “hey it’s Apple, we’re really impressed by your work, here’s all of our secret chip design documents to help you guys get along a bit quicker”
<chadmed>
oh nah nah lmao im not _that_ delusional :P
<marcan>
chadmed: they're probably going to run linux on VMs
<chadmed>
i thought of that, but would those players trust macos as a hypervisor?
<marcan>
they have to trust the chips anyway
<chadmed>
yeah true
<marcan>
they only need to trust the Hypervisor.framework part
<marcan>
which is a thing thing like KVM
<marcan>
you can run qemu on it along with whatever paravirt devices they already use
<krbtgt>
proper power boxes from IBM come that way
<marcan>
yeah, I think they started supporting bare metal in POWER7 or so, so KVM can work?
<marcan>
but IBM do like their LPARs
<marcan>
I remember getting a POWER4 box to boot bare metal, but KVM can't support that platform (I think it even lacks a hypervisor decrementer? there was something pretty major missing IIRC)
marvin24 has joined #asahi
marvin24_ has quit [Ping timeout: 480 seconds]
<shenki>
power8. there were hacks for power7, but only in the lab
yuyichao has joined #asahi
<marcan>
the macos way is more flexible though, since you can still use your own VMM
<jannau>
shenki: what is dropped off during the mac os boot? the vUART with mac os log messages? does mac os boots to the login screen and is useable?
dioput12 has joined #asahi
dioput12 has left #asahi [#asahi]
mps has joined #asahi
bgb has joined #asahi
bgb_ has quit [Ping timeout: 480 seconds]
rkt has left #asahi [#asahi]
rkt has joined #asahi
labavonn has joined #asahi
sailorek1234 has joined #asahi
<maz>
shenki: there is still plenty of work to be done on the PMU. only *two* events are know. it you have time to write test cases and work out some of the most obvious events (cache miss, for example), that'd be useful.
<_jannau_>
maz: I'm still confused that the defined events from the xnu source code do not work. There is even a filter so I doubt mac os user space uses different event id
<maz>
_jannau_: the events are for much older CPUs. they all have A32/T32 events, which makes no sense on a 64bit only CPU.
<_jannau_>
I guess from the source code that apple has two PMU types. the non-early design was added before apple removed a32/t32 support. the event id are still there for supporting the old CPUs. I would expect them to simply count nothing on M1
<maz>
_jannau_: the most recent stuff is Hurricane, which predates the M1 cores by at least 4 years. In general, events are reorganised pretty often to fit the uarch, so it is quite understandable that the event numbering is vastly different.
<maz>
I'm also pretty sure that counter #1 (instruction count) is completely synthetic. there is no other event that counts anything close.
<bgb>
they removed the event ids at the latest commit
<_jannau_>
I guess I have to boot macos in the hypervisor and see what kind of events it supports
<maz>
_jannau_: if you have the equivalent of perf in macos and it disclose the raw event numbers, that'd be great!
<maz>
'and if it discloses'*
<_jannau_>
I'm only aware of the Instruments GUI and I would be surprised if it listed raw event numbers. my plan was to use a single event and observe PMC register writes
<bgb>
_jannau_: can macos with hypervisor trap the event config sys regs?
<maz>
_jannau_: ah, I see. yes, that seems to be a good approach.
<_jannau_>
yes, we disable the pmu while we are in the hv to avoid dealing with pmu irqs in the hv
aleasto has joined #asahi
psykose has quit [Read error: No route to host]
psykose has joined #asahi
<_jannau_>
as expected no raw event numbers instruments
<bgb>
yeah, just user friendly pmc names
rkt is now known as Guest4991
rkt_ has joined #asahi
rkt_ is now known as rkt
labavonn has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Guest4991 has quit [Ping timeout: 480 seconds]
labavonn has joined #asahi
labavonn has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<sven>
maz: / jannau: there's /usr/share/kpep/a14.plist which may or may not contain the numbers for some of these events
<sven>
i don't really understand that format yet but "INST_ALL" appears to be "fixed_counter: 1"
<sven>
INST_NEON_OR_FP might be easy to test which would be "number: 154" in that file (for some reason that's not what apple calls a fixed_counter?)
<bgb>
the "number" is used to config SYS_APL_PMESR0_EL1/SYS_APL_PMESR1_EL1
<_jannau_>
sven: the first two pmc registers are fixed cycle and instruction event counters
<_jannau_>
instruments has "INST_ALL" and "Instructions (fixed)"
<sven>
FIXED_CYCLES / CYCLE is fixed_counter: 0 and FIXED_INSTRUCTIONS / INST_ALL is fixed_counter: 1
<bgb>
jannau, maz: there are many event numbers in a14.plist/a15.plist! seems this is what we need
<bgb>
sven: how did you find this? great discovery :)
<sven>
grep and strings
<bgb>
sven: simple and powerful...btw, is it ok to publish the ascii text(xcode parsed) on the wiki page ?
<maz>
I'll give this a try, that looks like what I need!
<bgb>
maz: does your pmu tree need any other merge for basic linux work on M1 ?
<maz>
bgb: not that I can think of. but I'm not using much apart from PCIe.
<bgb>
maz: ok, I think keyboard working is enough
<maz>
bgb: I only use a mini, so no kbd.
<bgb>
maz: got it. I will do some test if possible
<maz>
0x8c (aka INST_ALL) never counts here.
<bgb>
maz: btw, the "counters_mask" in plist seems representing the usable counter regs for corresponding event
<bgb>
0x8c has 128, which means it can only used with pmc#7, right ?
<bgb>
*0x8c has "counters_mask"= 128=b'1000 000
<bgb>
maz: so, try PMC#7 ?
<maz>
is there a public repo with this file? dougall's python script doesn't seem to do anything...
<bgb>
you can open the /usr/share/kpep/a14.plist with xcode, and save in ascii
<maz>
bgb: that'd involve booting macos, and I'm not doing that.
<bgb>
is it ok to publish the ascii text(xcode parsed) on the wiki page ?
<bgb>
I just got the text
<maz>
I would really refrain from doing so.
<maz>
this is obviously copyrighted material.
<chadmed>
#asahi-re
<bgb>
maz: so, what should we do to share this info safely?
<kettenis>
you write it down in a sensible way
<chadmed>
same way you would avoid plagiarism in any written work based on the work of others. rewrite it in your own words :)
<bgb>
kettenis: according to the plist ? so, just do NOT copy/paste
<bgb>
ah, got it :)
<kettenis>
the information itself is not copyrighted, just the expression of it
<bgb>
ok, I will add wiki page for this
<bgb>
maz: can you try 0x8c with PMC#7?
<kettenis>
but if you use some sort of automatic process to do a 1:1 translation it is debatable whether it is your own expression of the same information
<chadmed>
yeah dont just dump out what xcode gives you and rename some assignments. parse the output in your brain and write it down in a sensible list yourself or something
<chadmed>
assuming its just a list of counters with their addresses or whatever, this is pretty trivial and saves you getting chased down by apples army of faceless men
<chadmed>
dont forget, this is the same company that quite literally hires former spies and PMCs to "patrol" gathering spots around their offices to eavesdrop on staff and make sure theyre not discussing company matters off the clock. dont test them.
<bgb>
oh, dangerous try.
<maz>
bgb: I'll give it a shot later, debugging something else ATM.
<maz>
bgb: I'm generating the event-map myself. after all, it is just a matter of iterating through the event space with all counters configured the same way, and see what sticks.
bgb has quit [Ping timeout: 480 seconds]
yuyichao has joined #asahi
<maz>
almost halfway through (6.5 sec per event)
X-Scale has quit [Ping timeout: 480 seconds]
[X-Scale] has joined #asahi
kettenis has joined #asahi
bgb has joined #asahi
X-Scale` has quit [Ping timeout: 480 seconds]
<maz>
event 0x8c is really odd. it can count everywhere if placed at least in PMCR7...
<maz>
a whole bunch are restricted to 5,6,7.
bgb has quit [Ping timeout: 480 seconds]
unrelentingtech has joined #asahi
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
sailorek1234 has quit []
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
jan[m]123 is now known as lockejan[m]
yuyichao_ has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
richbridger has quit [Remote host closed the connection]
richbridger has joined #asahi
yuyichao has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
dsrt^ has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
<maz>
PMU driver updated with a mapping table of which event can count where. Probably not complete, but that's what I could find with a bit of experimentation.
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
<pitust[m]>
Could i install asahi on my laptop? even if it's not super usable, it'd be interesting to try
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
[X-Scale] is now known as X-Scale
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
tertu has joined #asahi
tertu2 has quit [Ping timeout: 480 seconds]
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
___nick___ has joined #asahi
___nick___ has quit []
___nick___ has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
timokrgr6 has joined #asahi
timokrgr has quit [Ping timeout: 480 seconds]
timokrgr6 is now known as timokrgr
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
jix_ has joined #asahi
jix has quit [Ping timeout: 480 seconds]
bgb has quit [Ping timeout: 480 seconds]
malvo has quit [Ping timeout: 480 seconds]
malvo has joined #asahi
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
<simjnd[m]>
<pitust[m]> "Could i install asahi on my..." <- I think they're still working on an installer that can be used by us mere mortals
malvo has quit [Ping timeout: 480 seconds]
dsrt^ has joined #asahi
bgb has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
malvo has joined #asahi
aleasto has quit [Remote host closed the connection]
yuyichao has joined #asahi
yuyichao_ has quit [Ping timeout: 480 seconds]
<mps>
iiuc keyboard doesn't work on macbook? or I'm wrong
<j_ey>
mps: it does
<j_ey>
with patches / branches ofc
<mps>
j_ey: ah good
<mps>
then I think I will try next week to install linux (need to find some free time)
bgb has joined #asahi
___nick___ has quit [Ping timeout: 480 seconds]
Misthios has quit [Quit: Ping timeout (120 seconds)]
Misthios has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
Eric[m] has joined #asahi
dottedmag has quit [Quit: QUIT]
yrlf2 has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
jannau_ has joined #asahi
lanodan_ has joined #asahi
yrlf has quit [Remote host closed the connection]
lanodan has quit [Read error: Connection reset by peer]
jannau has quit [Remote host closed the connection]
Eric[m] has quit [reticulum.oftc.net liquid.oftc.net]
marvin24 has quit [reticulum.oftc.net liquid.oftc.net]
oi_wtf has quit [reticulum.oftc.net liquid.oftc.net]
grange_c has quit [reticulum.oftc.net liquid.oftc.net]
tasild[m] has quit [reticulum.oftc.net liquid.oftc.net]
astrorion26[m] has quit [reticulum.oftc.net liquid.oftc.net]
long[m] has quit [reticulum.oftc.net liquid.oftc.net]
Raito_Bezarius has quit [reticulum.oftc.net liquid.oftc.net]
os has quit [reticulum.oftc.net liquid.oftc.net]
roxfan has quit [reticulum.oftc.net liquid.oftc.net]
d4ve has quit [reticulum.oftc.net liquid.oftc.net]
arekm has quit [reticulum.oftc.net liquid.oftc.net]
Synth[m] has quit [reticulum.oftc.net liquid.oftc.net]
Fanfwe has quit [reticulum.oftc.net liquid.oftc.net]
suricato has quit [reticulum.oftc.net liquid.oftc.net]
crabbedhaloablut has quit [reticulum.oftc.net liquid.oftc.net]
bradfier has quit [reticulum.oftc.net liquid.oftc.net]
YichaoYu[m] has quit [reticulum.oftc.net liquid.oftc.net]
wollymilkcap[m] has quit [reticulum.oftc.net liquid.oftc.net]
ytg has quit [reticulum.oftc.net liquid.oftc.net]
TellowKrinkle[m] has quit [reticulum.oftc.net liquid.oftc.net]
vasilymilovidov[m] has quit [reticulum.oftc.net liquid.oftc.net]
Guest3421 has quit [reticulum.oftc.net liquid.oftc.net]
SocioProphet[m] has quit [reticulum.oftc.net liquid.oftc.net]
Spectrejan[m] has quit [reticulum.oftc.net liquid.oftc.net]
simjnd[m] has quit [reticulum.oftc.net liquid.oftc.net]
samfromspace[m] has quit [reticulum.oftc.net liquid.oftc.net]
sajattack[m] has quit [reticulum.oftc.net liquid.oftc.net]
pho[m] has quit [reticulum.oftc.net liquid.oftc.net]
PeterHilgenfeld[m] has quit [reticulum.oftc.net liquid.oftc.net]
Scott[m]1 has quit [reticulum.oftc.net liquid.oftc.net]
nilsi[m] has quit [reticulum.oftc.net liquid.oftc.net]
PedroArajo[m] has quit [reticulum.oftc.net liquid.oftc.net]
lemonsus[m] has quit [reticulum.oftc.net liquid.oftc.net]
marcan[m] has quit [reticulum.oftc.net liquid.oftc.net]
kdrag0n[m] has quit [reticulum.oftc.net liquid.oftc.net]
lockna has quit [reticulum.oftc.net liquid.oftc.net]
GenieLotion[m] has quit [reticulum.oftc.net liquid.oftc.net]
joerosenberg[m] has quit [reticulum.oftc.net liquid.oftc.net]
parabola[m] has quit [reticulum.oftc.net liquid.oftc.net]
fridtjof[m] has quit [reticulum.oftc.net liquid.oftc.net]
CristianMgheruan-Stanciu[m] has quit [reticulum.oftc.net liquid.oftc.net]
cavoirom[m] has quit [reticulum.oftc.net liquid.oftc.net]
PeterB[m] has quit [reticulum.oftc.net liquid.oftc.net]
brentr123[m] has quit [reticulum.oftc.net liquid.oftc.net]
AnushervonTabarov[m] has quit [reticulum.oftc.net liquid.oftc.net]
davay[m] has quit [reticulum.oftc.net liquid.oftc.net]
bastilian[m] has quit [reticulum.oftc.net liquid.oftc.net]
AkihikoOdaki[m] has quit [reticulum.oftc.net liquid.oftc.net]
ganpa[m] has quit [reticulum.oftc.net liquid.oftc.net]
idf00[m] has quit [reticulum.oftc.net liquid.oftc.net]
nfbyte has quit [reticulum.oftc.net liquid.oftc.net]
ninja[m] has quit [reticulum.oftc.net liquid.oftc.net]
xerpi[m] has quit [reticulum.oftc.net liquid.oftc.net]
emilazy has quit [reticulum.oftc.net liquid.oftc.net]
alicela1n has quit [reticulum.oftc.net liquid.oftc.net]
psydroid[m]1 has quit [reticulum.oftc.net liquid.oftc.net]
akemin_dayo has quit [reticulum.oftc.net liquid.oftc.net]
trepatudo has quit [reticulum.oftc.net liquid.oftc.net]
nsr has quit [reticulum.oftc.net liquid.oftc.net]
Stary has quit [reticulum.oftc.net liquid.oftc.net]
eta has quit [reticulum.oftc.net liquid.oftc.net]
Esmil has quit [reticulum.oftc.net liquid.oftc.net]
jato has quit [reticulum.oftc.net liquid.oftc.net]
hl` has quit [reticulum.oftc.net liquid.oftc.net]
Xesxen has quit [reticulum.oftc.net liquid.oftc.net]
null has quit [reticulum.oftc.net liquid.oftc.net]
dottedmag has joined #asahi
xerpi[m] has joined #asahi
Eric[m] has joined #asahi
suricato has joined #asahi
marvin24 has joined #asahi
grange_c has joined #asahi
oi_wtf has joined #asahi
astrorion26[m] has joined #asahi
Raito_Bezarius has joined #asahi
long[m] has joined #asahi
os has joined #asahi
roxfan has joined #asahi
d4ve has joined #asahi
Synth[m] has joined #asahi
arekm has joined #asahi
Fanfwe has joined #asahi
TellowKrinkle[m] has joined #asahi
Guest3421 has joined #asahi
ytg has joined #asahi
Spectrejan[m] has joined #asahi
SocioProphet[m] has joined #asahi
Scott[m]1 has joined #asahi
simjnd[m] has joined #asahi
samfromspace[m] has joined #asahi
sajattack[m] has joined #asahi
pho[m] has joined #asahi
PeterHilgenfeld[m] has joined #asahi
PedroArajo[m] has joined #asahi
ninja[m] has joined #asahi
nilsi[m] has joined #asahi
nfbyte has joined #asahi
marcan[m] has joined #asahi
tasild[m] has joined #asahi
lemonsus[m] has joined #asahi
lockna has joined #asahi
kdrag0n[m] has joined #asahi
joerosenberg[m] has joined #asahi
GenieLotion[m] has joined #asahi
idf00[m] has joined #asahi
ganpa[m] has joined #asahi
fridtjof[m] has joined #asahi
parabola[m] has joined #asahi
emilazy has joined #asahi
CristianMgheruan-Stanciu[m] has joined #asahi
PeterB[m] has joined #asahi
AnushervonTabarov[m] has joined #asahi
brentr123[m] has joined #asahi
bastilian[m] has joined #asahi
davay[m] has joined #asahi
AkihikoOdaki[m] has joined #asahi
alicela1n has joined #asahi
akemin_dayo has joined #asahi
nsr has joined #asahi
eta has joined #asahi
Stary has joined #asahi
hl` has joined #asahi
null has joined #asahi
Xesxen has joined #asahi
jato has joined #asahi
bradfier has joined #asahi
trepatudo has joined #asahi
YichaoYu[m] has joined #asahi
wollymilkcap[m] has joined #asahi
vasilymilovidov[m] has joined #asahi
crabbedhaloablut has joined #asahi
Esmil has joined #asahi
bgb has joined #asahi
cavoirom[m] has joined #asahi
psydroid[m]1 has joined #asahi
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
<landscape15[m]>
<simjnd[m]> "I think they're still working on..." <- It would be great to see a polished qt GUI for the installer.
<j_ey>
that's unlikely to happen until there's a polished CLI installer :P
<landscape15[m]>
j_ey: Yeah i image :D
bgb has quit [Ping timeout: 480 seconds]
bgb has joined #asahi
timokrgr has quit [Quit: Ping timeout (120 seconds)]