#
✕ nick:maz
#asahi · 2021-03-08 13:12
mazarnd: I have no idea, and to be honest I don't really want to know what macos does...
#asahi · 2021-03-08 11:04
mazyup.
#asahi · 2021-03-08 11:03
mazbecase this is a major hack in the vgic implementation, which is already a very complicated beast.
#asahi · 2021-03-08 11:03
mazsure, but if I can get decent perf with just mask/unmask, I'd be happy to just ditch the IMPDEF stuff.
#asahi · 2021-03-08 11:01
mazmarcan: it is illegal to have two LRs with the same INTID...
#asahi · 2021-03-08 11:01
mazwhich we don't have to do on normal GIC implementations, as the HW knows how to link the virtual interrupt to the physical one.
#asahi · 2021-03-08 11:00
mazthe main disadvantage is that you need to force an exit whenever the guest EOI a timer interrupt in order to unmask the physical interrupt.
#asahi · 2021-03-08 10:59
mazwhich we need to do anyway for the physical timer, which doesn't have a magic LR.
#asahi · 2021-03-08 10:59
mazyup, at the expense of using mask/unmask to prevent the timer from firing.
#asahi · 2021-03-08 10:58
mazit really is a corner case, but deviating from the architecture is in general a very bad idea.
#asahi · 2021-03-08 10:57
mazyup.
#asahi · 2021-03-08 10:56
mazand we can't do that for the timer.
#asahi · 2021-03-08 10:56
mazbut in general writing to GICx_ISPENDING must generate an interrupt, full stop.
#asahi · 2021-03-08 10:56
mazin the case of a level interrupt, that's not a huge problem. it's more for edge interrupt that it is problematic.
#asahi · 2021-03-08 10:55
mazdriven*
#asahi · 2021-03-08 10:54
mazbecause that pending state is *only* drive by the timer, SW can't inject an interrupt in that LR despite the timer not firing, which the GICv3 architecture allows.
#asahi · 2021-03-08 10:53
mazit's a really nice shortcut in the sense that it doesn't generate an exit from the VM when the timer fires.
#asahi · 2021-03-08 10:53
mazyes. the magic LR takes the timer output as its pending bit, and exposes the resulting interrupt in the guest via ICV_IAR*_EL1.
#asahi · 2021-03-08 10:50
mazyou can obviously plug a userspace interrupt controller.
#asahi · 2021-03-08 10:50
mazin the kernel, that is.
#asahi · 2021-03-08 10:50
mazI'm only concerved with GIC emulation, because that's the only thing KVM supports.
#asahi · 2021-03-08 10:50
mazwe'll get a performance degradation because of the exit on EOI.
#asahi · 2021-03-08 10:50
mazand rely on a normal LR for injection.
#asahi · 2021-03-08 10:49
mazwhich is why I'm going to try and switch to just masking/unmasking the interrupt.
#asahi · 2021-03-08 10:49
mazso short of being able to set the Pending bit in the LR, we can't actually emulate the GICR_ISPENDING register for the virtual timer PPI.
#asahi · 2021-03-08 10:47
mazsetting TVAL to 0 would be observable by the guest, so that's a bit nono.
#asahi · 2021-03-08 10:47
mazmarcan: you don't need to save the pending bit itself. the state of the timer is enough to regenerate it.
#asahi · 2021-03-08 10:46
mazmarcan: the GICv3 architecture mandates that you can write to the pending state and generate the corresponding interrupt, so that's pretty annoying.
#asahi · 2021-03-08 10:45
mazmarcan: so although we can save/restore the timer state correctly, including the GIC Active state, we can't pend an interrupt from SW, and Linux relies on that for interrupt resending.
#asahi · 2021-03-08 10:44
mazmarcan: the main problem is that you can't inject a timer interrupt using that magic register. the Pending state is only driven by the timer itself, and only the Active state is writable.
#asahi · 2021-03-08 09:01
mazmarcan: I'll explore a solution that doesn't involve the magic timer LR though, as it prevents the emulation of some GICv3 features Linux relies on.
#asahi · 2021-03-08 09:00
mazmarcan: finally ironed out the annoying timer issue over the weekend, though the result isn't pretty at all. guests now work reliably.
#asahi · 2021-03-05 18:59
maz(and yes, this works absolutely fine!)
#asahi · 2021-03-05 18:53
mazThanks, and good night!
#asahi · 2021-03-05 18:43
mazgoes and hack some python...
#asahi · 2021-03-05 18:43
maz(KASAN enabled)
#asahi · 2021-03-05 18:43
mazmy decompressed kernel is 54M.
#asahi · 2021-03-05 18:43
mazright, I'm way above that.
#asahi · 2021-03-05 18:41
mazserial
#asahi · 2021-03-05 18:34
mazmarcan: what is the practical size limit for m1n1 Linux boot? I've just enabled tons of debug in my kernel, and I'm getting "Decompression error!"...
#asahi · 2021-03-05 13:44
mazdefconfig? haha! try a full distro kernel with all the modules... :D
#asahi · 2021-03-05 13:41
mazand then there is the Debian package that follows, which is pretty horrible too.
#asahi · 2021-03-05 13:40
mazlink time is the bottleneck for me.
#asahi · 2021-03-05 13:29
mazj`ey: D05.
#asahi · 2021-03-05 13:26
mazand to be fair, the name of my build box is perfectly appropriate... 64*A72 makes it hot and pretty crap.
#asahi · 2021-03-05 13:24
mazj`ey: all my machines are named after Frank Zappa songs. And I bet you can still spot a few in the Cambridge office!
#asahi · 2021-03-05 13:19
mazactually, maybe not the timers. looks like it is 9p that sucks...
#asahi · 2021-03-05 13:18
mazunsurprisingly, still some issues with the timers...
#asahi · 2021-03-05 13:18
mazmarcan: https://paste.debian.net/1187988/
#asahi · 2021-03-04 14:38
mazI gues this bit should trap all the Auxilary stuff from EL1 to EL2.

plus ›