#asahi · 2021-02-06 15:29
modwizcodeOH#asahi · 2021-02-06 15:29
modwizcode*reading the ack* sets the mask?#asahi · 2021-02-06 15:29
modwizcode doesn't help that using qemu's built in bitmap code is annoyingly not the answer since you need to access the bit words directly in 32bit units and it works only in longs.#asahi · 2021-02-06 15:28
modwizcodeThat's all I was going to do but I wanted to understand the semantics better#asahi · 2021-02-06 15:28
modwizcodeQuestion though: HW IRQ comes in, I disable IRQ mask on CPU and then am handling where I disable it again (without reading the ACK/reason register) do I get prempted again immediately? The new reason will be the same or not?#asahi · 2021-02-06 15:27
modwizcodeI'm trying to figure out the best way to emulate it in QEMU and have encountered a few annoyances (worked around temporarily but I need to get it right now)#asahi · 2021-02-06 15:26
modwizcodeif you are handling a lower priority interrupt and you reenable interrupts do you get preempted?#asahi · 2021-02-06 15:26
modwizcodemarcan: The AIC can report multiple reason codes due to interrupt prioritization right?#asahi · 2021-02-05 17:14
modwizcodeARM virtualization makes x86 virtualization look sane from what I've seen. Although I don't understand x86 virtualization well enough to say that :p#asahi · 2021-02-05 17:14
modwizcodeSee this is the confusing part of having register descriptions with no conception of how they're used.#asahi · 2021-02-05 17:13
modwizcodeohhhhhhhh#asahi · 2021-02-05 17:13
modwizcodeIt doesn't implement E2H==0?#asahi · 2021-02-05 17:13
modwizcodeRight but what's the problem with E2H implying TGE#asahi · 2021-02-05 17:11
modwizcodeYes but why do I need E2H *and* TGE?#asahi · 2021-02-05 17:11
modwizcodeMy favorite thing was earlier when I was testing and didn't realize the board I was using had smp setup, so all the cores started running m1n1 and I got like m11nn11#asahi · 2021-02-05 17:10
modwizcodere: barriers, see my github issue :p#asahi · 2021-02-05 17:10
modwizcodeTGE confuses me greatly. I can read all the docs to see how the virtualization features *work* but how I'm intended to use most of them is a mystery. Especially when combined with VHE (is that the right name?)#asahi · 2021-02-05 17:09
modwizcodeDid it kick the fiq or did it kick the TGE?#asahi · 2021-02-05 17:08
modwizcodeA lot of arm stuff requires isb before cp writes are considered to be visible#asahi · 2021-02-05 16:52
modwizcodeI suppose another way is to wire it up with aliases such that each CPU's view of the AIC is wired up with an alias over the per-cpu registers pointing to it's CPU specific memory region. I've seen other code do something like that and that might be cleaner actually#asahi · 2021-02-05 16:47
modwizcodeThat is however, what I think my solution in QEMU is going to be. A special function you can use to wire up each CPU to it. Makes more sense for the SoC to drive the connections rather than the interrupt controller. It's a generic peripheral (I guss GIC gets a bit of a pass since with CP registers it's definitely ARM specific), but AIC is nice enough that I could see someone using this in other ways :)#asahi · 2021-02-05 16:45
modwizcodeI'm pretty sure that the way I'd do it is that each core has a set of local registers, and there's an arbiter or something that lets you also access them via the bus. But of course I don't design cores really so who knows#asahi · 2021-02-05 16:45
modwizcodeYeah#asahi · 2021-02-05 16:38
modwizcodeIt's a horrible way of doing things imo, because it precludes things like having an ARM system with a GIC and also having another type of CPU running too. Not sure if other things preclude that also but it's icky#asahi · 2021-02-05 16:37
modwizcodeIt has a seperate struct for per-cpu state which is obvious. But it initializes it by creating it during construction of the parent GIC device then looping through the CPU count in QEMU and grabbing them from qemu_get_cpu and using that to assign their CPU reference.#asahi · 2021-02-05 16:32
modwizcodeI'm looking at the qemu GICv3 code (v1 and v2 are basically the same code and are... not helpful to look at) and it solves this problem in a way I dislike also#asahi · 2021-02-05 16:31
modwizcodeopticron: yes it seems so#asahi · 2021-02-05 16:30
modwizcodeThe issue is things like the interrupt reason register are a constant address but will have to behave different for each core since multiple cores can take an interrupt (reading it is also the ack, a decision I dislike overall too)#asahi · 2021-02-05 16:26
modwizcodeI'm just going to do this wrong intentionally until I decide on a correct way that doesn't suck.#asahi · 2021-02-05 16:26
modwizcodeOne nice thing about system registers vs. MMIO is that when defining handlers you have access to the CPU state itself. Meaning if you have local CPU versions of an MMIO register things seem painful...#asahi · 2021-02-05 15:33
modwizcodedavidrysk[m]: I wonder if it somehow accidentally removes the interrupt handling code before it kills all interrupts#asahi · 2021-02-05 14:27
modwizcodeyou still need barriers with sysreg's generally from most arm docs ive seen#asahi · 2021-02-05 14:26
modwizcodeAlso ARM organizes them in an annpying way#asahi · 2021-02-05 14:26
modwizcodethe issue I have is the decompiler has to know about them or life sucks#asahi · 2021-02-05 14:24
modwizcodeI'm sure its useful but ARM insists on using both which I find to be the worat option#asahi · 2021-02-05 14:20
modwizcodekay later#asahi · 2021-02-05 14:20
modwizcodeThe GICv3 appeara to move more into system registers ehich is weird... luckily I don't have to use it :)#asahi · 2021-02-05 14:19
modwizcodeits perfect lol#asahi · 2021-02-05 14:19
modwizcodethe AIC is so nive and simple compared to the GIC#asahi · 2021-02-05 14:19
modwizcodecuriously why does linux need more?#asahi · 2021-02-05 14:18
modwizcoderight right#asahi · 2021-02-05 14:18
modwizcodethats very strange but yeah clearly a self IPI#asahi · 2021-02-05 14:17
modwizcodeohhh#asahi · 2021-02-05 14:17
modwizcodeI thought it was two true IPIs#asahi · 2021-02-05 14:17
modwizcodethat seems weirdly specific but i guess its easy#asahi · 2021-02-05 14:17
modwizcodeohhh#asahi · 2021-02-05 14:17
modwizcodealao theres some IPI macros using 0x5000+something that are unused in the lnux driverr#asahi · 2021-02-05 14:16
modwizcode0x80000000!? that's not part of the AIC?#asahi · 2021-02-05 14:13
modwizcodeDid the config for the UART just become kinda obvious once you poked at it a bit?#asahi · 2021-02-05 14:12
modwizcodeYou have the virtual IPIs but thats not important to non-linux code (neat idea tho)