#asahi · 2021-03-08 11:03
marcanespecially for a first implementation#asahi · 2021-03-08 11:03
marcansure, works for me#asahi · 2021-03-08 11:02
marcanI mean that magic register is already way out in IMP-DEF territory anyway#asahi · 2021-03-08 11:02
marcanworth trying it :)#asahi · 2021-03-08 11:02
marcanyes, but a lot of things are illegal about this architecture already...#asahi · 2021-03-08 11:01
marcancould we use both, somehow? use a regular LR to inject pending states if the guest asks us to, otherwise let the timer use the shortcut LR#asahi · 2021-03-08 10:59
marcanright#asahi · 2021-03-08 10:58
marcancan we use a regular LR for that?#asahi · 2021-03-08 10:57
marcanargh, okay#asahi · 2021-03-08 10:57
marcanoh, you mean if the guest writes that#asahi · 2021-03-08 10:56
marcanright, but these timers are level, right?#asahi · 2021-03-08 10:55
marcanhow would that be used? wouldn't the guest always expect the timer to be pending when it receives an IRQ?#asahi · 2021-03-08 10:53
marcanand what you're saying is we can't make the timer drive a pending state?#asahi · 2021-03-08 10:53
marcanmakes sense#asahi · 2021-03-08 10:52
marcan*bit does#asahi · 2021-03-08 10:52
marcanoh, I guess what that HACR bit is redirect the vtimer from FIQ to that LR which then interacts with vGIC?#asahi · 2021-03-08 10:52
marcanis that magic LR connected to the vGIC stuff?#asahi · 2021-03-08 10:51
marcanso I need a bit of context :)#asahi · 2021-03-08 10:51
marcanor that magic LR register for that matter#asahi · 2021-03-08 10:51
marcanso I actually don't know at all how the timers interact with the vGIC stuff#asahi · 2021-03-08 10:50
marcanright#asahi · 2021-03-08 10:50
marcanthis is for emulating a normal GIC system, not the FIQ stuff, right?#asahi · 2021-03-08 10:48
marcanyeah. I noticed only one of the bits is writable in the LR#asahi · 2021-03-08 10:48
marcanI was talking about the timer IRQ flag itself in the control register#asahi · 2021-03-08 10:47
marcanoh wait, you mean in that LR#asahi · 2021-03-08 10:47
marcanbut wouldn't that be enough to inject the FIQ? AIUI it's level-triggered#asahi · 2021-03-08 10:46
marcancould you force the issue by, say, setting it up to count down 0 ticks?#asahi · 2021-03-08 10:46
marcanah, so you can save/restore the timer counter state, but not the pending bit?#asahi · 2021-03-08 10:27
marcan(need to poke around the pasemi i2c driver)#asahi · 2021-03-08 10:26
marcanwhich I guess is a very good reason to make that my next target#asahi · 2021-03-08 10:26
marcanbut that does depend on i2c#asahi · 2021-03-08 10:26
marcanthe linux driver for it should mostly just work#asahi · 2021-03-08 10:26
marcanI bet it's not too hard of a dance though, and those things are mostly documented#asahi · 2021-03-08 10:25
marcanthe controller doesn't have DFP negotiation enabled by default, so if you present to it as an UFP it just does nothing until macos boots#asahi · 2021-03-08 10:25
marcansame reason you need to be DFP for serial in m1n1#asahi · 2021-03-08 10:25
marcansven: the ports won't go into DFP mode without poking the type C controller#asahi · 2021-03-08 10:24
marcanI think qemu on macos works reliably without that LR stuff, only mask bits for the two timers, though I'm not entirely sure#asahi · 2021-03-08 10:24
marcanmaz: awesome! what's the exact issue?#asahi · 2021-03-08 07:38
marcansven: it shouldn't be too hard to do CDC serial AIUI#asahi · 2021-03-08 02:04
marcanTheLink: dougall is around here too :)#asahi · 2021-03-06 09:12
marcan*ew#asahi · 2021-03-06 09:12
marcanI guess you could probably fake it by, uh, trapping VBAR_EL1 writes and then jigging that page to always trap to EL2 but... eq.#asahi · 2021-03-06 09:10
marcansince that lets you emulate arbitrary system functionality, it probably would let you implement nested virtualization all on its own#asahi · 2021-03-06 09:10
marcanor, at least, being able to just blanket trap all UNDEFINED exceptions would've been damn handy#asahi · 2021-03-06 09:09
marcan*actually* being able to run in EL2/EL1/EL0 mode and trap all exceptions that EL1 takes would be a damn useful feature#asahi · 2021-03-06 09:08
marcanTGE isn't "trap general exceptions", it's "vanish EL1 and disable most VM features"#asahi · 2021-03-06 09:08
marcanit annoys me so much that ARMv8 didn't specify something like HCR_EL2.TGE that *actually* does what it says on the tin#asahi · 2021-03-05 18:48
marcan(off to sleep)#asahi · 2021-03-05 18:48
marcanhope it works :)#asahi · 2021-03-05 18:46
marcanthere's no real reason not to just commit that, so I might just apply it