On 2017-08-23 14:55, Gustavo Lima Chaves wrote: > * Henning Schild <[email protected]> [2017-08-23 07:28:56 +0000]: > > [...] > >>>> >>>> Exactly: If the root Linux was brought up in xAPIC mode, Jailhouse >>>> has to follow this. Same in case it was using x2APIC before. We >>>> cannot switch the mode safely, so we follow what was configured >>>> before (auto mode) or defined in the config (like in your case). >>> >>> Thanks. It indeed wors for, say, apic-demo.c inmate. But I see code >>> paths there that are hardcoded (at least seem, please correct me) to >>> using x2APIC access—int_init() is one of them. I thought it had >>> infrastructure for everything APIC be twofold, not just >>> apic_ops.read/write. I ask that because I'd like to be able to work on >>> xAPIC in Zephyr as well (x2APIC mode being a separate patch), but the >>> world crashed for me while trying. >> >> Andreas found and fixed a bug in the zephyr apic timer code. That might >> be causing your trouble. I am not sure about the status of getting that >> patch upstream. As far as i remember it was an ordering issue between >> setting the counter and the mode, where the counter would drop to 0 >> before the mode is set from one-shot to periodic. > > Thanks, but I'm afraid it's not due to that (I have the patch and it > did not help). One thing that I have to clarify for once, though: so > there is no mapping to XAPIC_BASE to inmates, right? The sole way of > having it is linking with libinmate and issuing apic_init()? I tried > an ugly hack of adding it at vcpu_map_memory_region(), with no > success.
There is mapping, look at vcpu_vendor_cell_init. If the system is in xAPIC mode, accesses are trapped, filtered and executed on behalf of the guest. If it is in x2APIC mode, execution is replaced with emulation. However, a typical trap is mapping something over the xAPIC page, allowing the guest direct access (or access to something totally different). Double-check your config in this regard. Jan -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
