2021-02-24
00:05xarkes has joined #asahi
00:13brandas has joined #asahi
00:40Tokamak has quit [Quit: Textual IRC Client: www.textualapp.com]
00:42brandas has quit [Quit: quit]
00:42brandas has joined #asahi
00:47brandas has quit [Client Quit]
00:47brandas has joined #asahi
00:48brandas has quit [Client Quit]
00:49brandas has joined #asahi
00:55choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
01:41klaus has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:54fridtjof[m] has quit [Quit: authenticating]
01:54fridtjof[m] has joined #asahi
02:00balrog has quit [Quit: Bye]
02:04balrog has joined #asahi
03:53BaughnLogBot has quit [Ping timeout: 256 seconds]
03:54BaughnLogBot has joined #asahi
04:00phiologe has quit [Ping timeout: 240 seconds]
04:01phiologe has joined #asahi
04:16mxw39 has quit [Ping timeout: 240 seconds]
04:16mxw39 has joined #asahi
04:24BaughnLogBot has quit [Ping timeout: 256 seconds]
04:25KindOne is now known as KindTwo
04:25KindTwo is now known as 18WABQDLV
04:31mxw39 has quit [Remote host closed the connection]
04:34mxw39 has joined #asahi
04:45marvin24 has quit [Ping timeout: 260 seconds]
04:45marvin24_ has joined #asahi
05:13bgianf has quit [Quit: leaving]
05:22bgianf has joined #asahi
06:12GlanzmannSomeone in here disabled the swap in macos, was your system stable, can I do the same?
06:12GlanzmannBecause I currently only use macos for three things: ssh, firefox, iina (movie player)
06:16maor26 has joined #asahi
06:20VinDuv has joined #asahi
06:46amw has quit [Ping timeout: 246 seconds]
07:09jaXvi has joined #asahi
07:23raster has joined #asahi
07:23nicolas17 has quit [Quit: Konversation terminated!]
07:30VinDuv has quit [Quit: Leaving.]
07:49amw has joined #asahi
07:55amw has quit [Ping timeout: 240 seconds]
08:11amw has joined #asahi
08:24ephe_meral has joined #asahi
08:30klaus has joined #asahi
08:3218WABQDLV is now known as KindOne
08:56klaus has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:05amw has quit [Ping timeout: 265 seconds]
09:11ephe_meral has quit [Ping timeout: 240 seconds]
09:15klaus_ has joined #asahi
09:26TheJollyRoger has quit [Ping timeout: 268 seconds]
09:46arndI haven't tried that, but I expect it would not be particularly stable. Regarding the heavy swap usage I have two other observations though:
09:47arnd- if I only log in remotely to macos and there is no local user, the 16GB are usually sufficient for what I do, even when running an 8GB linux VM guest, and it doesn't swap at all as long as there is free memory (this is what is supposed to happen, but it wasn't obvious that there was no bug here)
09:48arnd- the swap problem is likely made worse by the use of 16KB pages, compared to the 4KB pages that macos on x86, and (most) Linux on arm use
09:49arndI did some experiments on Amazon Graviton guests a while ago and found that while the memory usage explosion from 64KB pages compared to 4KB wasn't as bad as I had expected,
09:50arnd16KB obviously won't be as bad as 64KB for either the extra memory usage, or the extra I/O per swap operation, but it will still be very noticeable
10:04marcandocumented another sysreg: AFPCR https://github.com/AsahiLinux/docs/wiki/HW:ARM-System-Registers#sys_apl_afpcr
10:05marcanarnd, maz: this one has me worried. it's a pre-standard implementation of FEAT_AFP (i.e. the SSE-compatible denormal handling), but with bits in a custom register, not FPCR
10:06marcanit has to be enabled to *work*, but APFCR itself is not locked out if the feature is disabled; the bits just have no effect
10:15never_releasedmarcan: AFPCR is writable from EL0
10:15never_releasedas far as I know
10:16marcanmy real question is: is there a way to make it trap on userspace access, and is that the default from iBoot
10:18never_releaseddo you know what APFLG are for?
10:19never_releasedI'll have to look at AHCR too
10:19never_releasedit's Apple-specific hypervisor control regs
10:19never_releasedthe hypervisor stuff is censored from OSS XNU
10:19never_releasedso will have to reverse
10:20marcanI'm looking through the 11.1 binary blob object files right now, since those are fair game because APSL
10:20never_releasedmarcan: those are _very_ partial
10:20never_releaseda thing that's nice to experiment with, marcan
10:20never_releasedis that almost all the Apple extensions
10:20never_releasedare accessible within a VM
10:21never_releasedincluding guarded exec
10:21never_releasedyou can experiment from within macOS with GL1 just fine
10:21marcanthat's a good point, and if they didn't do anything about this AFPCR in linux VMs then this is a CVE in macOS VMs - and one they might not be able to fix
10:22never_releasedeven AMX is accessible to VMs
10:22marcanhow? I haven't even figured out how to turn it on yet, unless it works in EL0 and not EL2
10:22never_releasedmarcan: you have specific AMX sysregs to toggle
10:23never_releasedand then you specifically have to arm it with the AMX enable instruction
10:23never_releasedthe reg for it is amx_config_el1
10:24never_releasednot yet, didn't want to poke in detail at the binaries themselves, but will have to do it at some point
10:24marcanif you know the bits I can also just try brute-force; I have a list of all sysregs anyway
10:25marcanprobably about time I try toggling all bits in all sysregs and build a blocklist of things that break the world
10:29never_releasedfunnily enough
10:29never_releasedthe hypervisor is present on iOS builds too
10:30never_releasedbut is gated by CONFIG_HYPERVISOR_PUBLIC, which isn't present in the MASTER.arm64 config
10:30never_released(only there in the macOS kernel one, private entitlement on iOS)
10:44thestr4ng3r has quit [Ping timeout: 264 seconds]
10:49thestr4ng3r has joined #asahi
10:53mazmarcan: if there is no way to disable it from EL2 when HCR_EL2.TGE==1, we'll need to wipe this register on context switch. really ugly.
10:55marcanmaz: if this affects linux guests under macos, can we file a CVE and do nothing and let *Apple* send the kernel a patch fixing it?
10:57mazmarcan: what would be interesting is to find out whether HCR_EL2.TIDCP is honored when these non-architectural features are used at EL0/EL1.
11:29never_releasedmarcan: no reason to make it trap on EL2 in practice anyway... so
11:31never_releasedmarcan: you might want to test at EL1.
11:31never_releasedmore important than EL2 tbh
11:31never_released(for KVM)
11:32never_releasedbecause it could allow communication between VMs
11:32ch has quit [Quit: restart]
11:34never_releasedmarcan: there is, for virtual machines
11:34never_releasedEL0 is sane
11:35never_releasedhint: you can just test without m1n1 there, just from a booted up Linux
11:35never_releasedwhat you care about is two things
11:35never_releasedmarcan: you can drop to EL1
11:35never_releasedand run Linux there
11:35never_releasedw/ nothing running at EL
11:39never_releasedmarcan: you also have the _EL12 variant on those
11:39never_releasednot even the need for that
11:39never_releasedif you aren't ever going to go back to EL2
11:39maznever_released: the _EL123 only gives you some save/restore facility. being out of context, exceptions doen't apply to them.
11:40never_releasedyou set interrupt routing in HCR to EL1
11:40never_releasedand then you lose EL2 forever after dropping to EL1, with no way to come back
11:40never_released(some companies annoyingly do this in the devices they ship)
11:42never_releasedwhat really annoys me in the M1 tho
11:42never_releasedis apparently no nested virt support
11:44never_releaseddidn't TX3 implement the lunatic ARMv8.3 variant
11:44never_releasedof the NV extensions
11:45never_releasedoh nice
11:46never_releasedmeanwhile, Cortex-A78AE and C have PAC among other backports
11:46never_releasedbut not regular A78 (to match the A55 ISA level I guess)
11:48never_releasedI wonder if there's an Apple-specific implementation sitting in AHCR
11:48never_releasedwouldn't bet against it
11:49never_releasedactlr, acfg, ahcr
12:05BaughnLogBot has joined #asahi
12:14marcanheh, my el0 thunk code worked on the first try other than getting data aborts on everything (bad page attributes making everything RO at EL0 probably)
12:26marcanI remember this from back when I was messing with page permissions, but setting bit 6 in the PTEs breaks everything and it doesn't look like it's PAN?
12:34marcanis there any mechanism that would forbid EL2/1 execution from EL0-accessible pages, other than the PXN bit in the page tables?
12:36j`ey"c. Not executable, because AArch64 execution treats all regions writable at EL0 as being PXN."
12:42marcanI guess this makes sense to some extent; it means the kernel save/restore code can just unconditionally save/restore these flags, regardless of whether a given process has the feature enabled
12:47mechpilotace has quit [Quit: WeeChat 2.8]
13:27Necrosporus has quit [Killed (barjavel.freenode.net (Nickname regained by services))]
13:27Necrosporus has joined #asahi
13:47Necrosporus has quit [Ping timeout: 256 seconds]
13:48Necrosporus has joined #asahi
13:57Behemoth has joined #asahi
14:10maor26 has quit [Ping timeout: 264 seconds]
14:11maor26 has joined #asahi
14:26tomhv has joined #asahi
14:33jaXvi has quit [Quit: Leaving]
14:53jaXvi has joined #asahi
14:57ephe_meral has joined #asahi
15:17tomhv has quit [Ping timeout: 260 seconds]
15:21tomhv has joined #asahi
15:22tomhv has quit [Client Quit]
15:36marcanmaz: I don't know what s3_5_c15_c10_1 is, but it's also 2 bits, and writable by EL0 by default
15:37ephe_meral has quit [Ping timeout: 240 seconds]
15:53davidrysk[m]oh yeah, something I noticed is that it does not seem darwin-xnu has the concept of "swappiness"
15:54odmir has quit [Remote host closed the connection]
16:00devinvs[m] has quit [Quit: Idle for 30+ days]
16:00nutmanja[m] has quit [Quit: Idle for 30+ days]
16:00marcanit does trap in VMs if I'm not mistaken, so at least there's that, but I need to double check
16:19davidrysk[m]does apple support the standard FEAT_AFT as well as theirs?
16:20marcanthat came out last year, so presumably Apple's is basically a prerelease version of the same
16:20marcanamusingly, they both call it "AFP", but I'm pretty sure the "A" stands for "Apple" in Apple's case
16:21marcanApple just blatantly called their bits by the SSE names, ARM integrated it into the existing FPCR in a slightly less obvious way
16:31modwizcodeWell that was a fun few days of chat to catch up on
16:33modwizcodemarcan: afaik dmb is only guranteed as a memory ordering op. i.e. do not issue memory ops out of order. It offers no assurances beyond that. ARM docs usually use it as part of locking, but from what I can tell it offers no meaning in the face of io.
16:35marcanmodwizcode: my question is whether it guarantees ordering between device memory and normal memory ops
16:36marcanor e.g. only between normal-normal and device-device within a peripheral window (there is a reference to an imp-def window size in the spec)
16:37marcani.e. what I *really* want to know is whether A writing memory and writing to peripheral B is ordered wrt C reading from peripheral B and reading the memory that A wrote
16:37marcanI'll probably end up writing a litmus test-ish thing for this to prove it to myself that dmb is enough
16:51modwizcodeYeah I wasn't clear in my answer and even if I was I think I was wrong.
17:04modwizcodeThe ARM is annoyingly vague on that specific issue too.
17:05ephe_meral has joined #asahi
17:06modwizcodeMy interpretation seems to indicate that DMB is safe for orderings between both on the same core, but DSB is required for multicore because you need to be sure the writes have "completed" which seems to be the only gurantee of external visibility?
17:07modwizcodewrt device accesses that is.
17:16modwizcodeI hope that's wrong though because that contradicts a sane interpretation of DMB that affects outer shareable regions like device memory...
17:16VinDuv has joined #asahi
17:55maor has joined #asahi
17:58maor26 has quit [Ping timeout: 240 seconds]
18:02odmir has joined #asahi
18:07zkrx has quit [Ping timeout: 240 seconds]
18:09ephe_meral has quit [Ping timeout: 240 seconds]
18:18zkrx has joined #asahi
18:28TheJollyRoger has joined #asahi
19:22KindTwo has joined #asahi
19:24KindOne has quit [Ping timeout: 272 seconds]
19:24KindTwo is now known as KindOne
19:35nicolas17 has joined #asahi
19:43KindTwo has joined #asahi
19:44KindOne has quit [Ping timeout: 265 seconds]
19:44KindTwo is now known as KindOne
19:45br377 has quit [Quit: WeeChat 1.9.1]
19:49hir0 has joined #asahi
20:06hir0 has quit [Remote host closed the connection]
20:08niv has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
20:13klaus_ has quit [Quit: Textual IRC Client: www.textualapp.com]
20:18niv has joined #asahi
20:37hir0 has joined #asahi
20:41raster has quit [Quit: Gettin' stinky!]
20:59Spiffy has quit [Ping timeout: 272 seconds]
20:59Spiffy has joined #asahi
21:08niv has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
21:11niv has joined #asahi
21:27choozy has joined #asahi
21:58VinDuv has quit [Quit: Leaving.]
22:12choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
22:16hir0 has quit [Ping timeout: 240 seconds]
22:41Z750 has joined #asahi
22:57zopieux has quit [Ping timeout: 264 seconds]
22:58zopieux has joined #asahi
23:06maor has quit [Ping timeout: 240 seconds]
23:35amw has joined #asahi
23:44raster has joined #asahi