>> >> One of the optimization, which can be used in pure SW is that >> we can shadow APIC state as "RO" to guest so that all guest >> read to APIC registers can run in full speed. T >> >> > >This can still be done with unacked interrupts: modify the >state to "as >if" the interrupt was injected, but commit it only if the injection >succeeds. If injection fails, revert the change. It isn't very nice >though.
Agree. > >Another possibility is: > > get_interrupt() > ... do all sleepy things prior to injection > enter critical section > ack interrupt > enter guest > Yes, that is safe and similar with current logic. Plus one condition: if (real mode) for those sleepy things. >> This optimization is probably cleaner & less-intrusive. Dynamic >> patching to modify guest code could trigger mine sooner or later:( >> >> > >Dynamic patching is dangerous, but the only option to run >Windows SMP on >millions of machines out there. I know:) RO of APIC page can solve this issue in most case. > >> >>> But the motivation here is not coding style, it's to be >able to do the >>> injection non-atomically. The tpr-opt patchset wants to write >>> the tpr to >>> memory, and that is a sleeping operation. Similarly, if we >emulate big >>> real mode we need to simulate interrupt injection by writing >>> to the stack. >>> >> >> OK. For big real mode has issue, that is very easy >> to walk around, we can probably pre-load (pin) those 2 or 3 pages >> before >> injecting real mode irq. >> > >Pinning has problems of its own. It can be made to work >though. In any >case, it can fail, so we need to ack the interrupt only after we have >successfully pinned the page. What I mean is we pre-load 2 pages where the stack are in, the logic may be: If (real mode) get 2 pages. enter critical path .... VM Resume. put these 2 pages. handle VM Exit normally. Since real mode is just a boot/install time isseu, performance is not critical. This way doesn't hurt us. thx,eddie ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel