#asahi · 2021-02-11 13:39
mazmarcan: I think this looks reasonable. there will be some corner cases, I'm sure. but the mapping between DT and resources seem OK.#asahi · 2021-02-11 09:04
mazdavidrysk[m]: The only valid fixed value for HCR_EL2.E2H is 0. Having it being stuck to 1 is not legal.#asahi · 2021-02-10 17:28
mazno worries.#asahi · 2021-02-10 17:24
mazfab!#asahi · 2021-02-10 17:14
mazalso, be careful when using _EL1 *and* _EL2 registers from EL2, the two views are not guaranteed to be synchronised (isb is your friend).#asahi · 2021-02-10 17:13
mazindeed.#asahi · 2021-02-10 17:13
mazkettenis: it must, or Linux wouldn't boot, for example.#asahi · 2021-02-10 17:11
mazsince you can run an EL1 OS at EL2 almost transparently.#asahi · 2021-02-10 17:11
mazVHE implementations must be able to use their _EL1 registers from EL2 and see their own state being affected by them.#asahi · 2021-02-10 17:08
maznot if you access it via cpacr_el1. that's the whole point of VHE.#asahi · 2021-02-10 17:06
mazat EL2 with E2H, cpacr_el1 *is* cptr_el2.#asahi · 2021-02-10 17:06
mazthe write to cpacr_el1 should definitely do it.#asahi · 2021-02-10 17:01
mazit's mostly that you can get rid of this patch altogether.#asahi · 2021-02-10 17:01
mazcritical path! :)#asahi · 2021-02-10 16:57
mazkettenis: yup.#asahi · 2021-02-10 16:53
mazkettenis: yes, the ARM ARM is unreadable.#asahi · 2021-02-10 16:52
mazkettenis: small nit about your CPTR_EL2 change: you should be able to leave the programming via CPACR_EL1 (E2H redirects the access to CPTR_EL2 and shuffle bits around).#asahi · 2021-02-10 09:10
mazgoes and reread the OF/PCI stuff...#asahi · 2021-02-10 09:09
maz(though it uses the top cell for other purposes, AFAICR)#asahi · 2021-02-10 09:09
mazI think that's how PCI works.#asahi · 2021-02-09 10:09
mazmarcan: sure, just wanted to be precise.#asahi · 2021-02-09 10:08
mazfrom ARM, they licence the architecture, not patents.#asahi · 2021-02-08 16:39
mazgood night!#asahi · 2021-02-08 16:39
mazyeah. Just need to cherry pick a few patches from my rVIC series to drive the VI/VF bits.#asahi · 2021-02-08 16:38
mazmarcan: I've made some good progress on the GICv3 handling, reusing the ThunderX workarounds. I never though that code would be useful again, and I was about to drop it!#asahi · 2021-02-08 16:38
mazmarcan: yeah, it's interesting stuff. Anyway, I think I nailed the sucker (I could easily reproduce it in a KVM guest...)#asahi · 2021-02-08 16:34
mazmarcan: and you're welcome. it's nice to see a small series focusing on the bare minimal.#asahi · 2021-02-08 16:33
mazmarcan: I haven't had a chance to look into that yet, somebody found a critical bug in one of my series, so I'm scrambling to fix that first! :D#asahi · 2021-02-05 17:21
mazthanks, and good night!#asahi · 2021-02-05 17:19
mazI had a prototype doing some lazy stuff a la FPSIMD, but it was complicated for no real performance benefit.#asahi · 2021-02-05 17:18
mazKVM saves everything on preemption.#asahi · 2021-02-05 17:18
mazyou could detect that particular case, but that's pretty rare, and hard to identify.#asahi · 2021-02-05 17:17
mazyou always need to save/restore the timer state on context switych.#asahi · 2021-02-05 17:16
mazspecially if that hypervisor has to handle nVHE as well.#asahi · 2021-02-05 17:15
mazobviously, that goal complicates the hypervisor.#asahi · 2021-02-05 17:15
mazanyway, the design goal for VHE was to take an unmodified EL1 OS, and run it at EL2.#asahi · 2021-02-05 17:14
mazwell, it's not x86's flavour of virtualisation.#asahi · 2021-02-05 17:13
mazif E2H implies TGE, how do you enter a guest?#asahi · 2021-02-05 17:13
mazof course M1 is violating the architecture by not implementing E2H==0.#asahi · 2021-02-05 17:12
mazand TGE has its own meaning when !VHE.#asahi · 2021-02-05 17:12
mazbecause ARMv8.0 doesn't have VHE, so you need to be able to run non-VHE.#asahi · 2021-02-05 17:12
mazyou get extra accessors to fish out EL1 sysregs from EL2.#asahi · 2021-02-05 17:11
mazso you can run EL1 code at EL2 transparently.#asahi · 2021-02-05 17:11
mazmodwizcode: it's actually pretty simple. E2H+TGE makes EL1 disappear. Most sysregs in _EL1 become _EL2.#asahi · 2021-02-05 17:10
mazs/from/flip/#asahi · 2021-02-05 17:09
mazwe only from it back when reaching the host on exit, and there is a metric butload of isb there...#asahi · 2021-02-05 17:09
mazflipping TGE definitely needs some heavy handed sync. usually, it is followed by an exception return, so you get that for free...#asahi · 2021-02-05 17:07
mazmarcan: right. so we definitely need to find a way to mask the bloody interrupt before it is injected into the guest.#asahi · 2021-02-05 16:31
mazGICv2 solved that by having a set of banked register, but that was a huge pain to implement, and required early address decoding inside the CPU. terrible idea.#asahi · 2021-02-05 16:29
mazanother crutial thing is that it allows trapping without messing with the page tables.