Re: [PATCH 6/6] KVM: x86: Emulator support for TF

Gleb Natapov
2010-02-23T12:02:25Z

On Tue, Feb 23, 2010 at 12:30:27PM +0100, Jan Kiszka wrote:
> Gleb Natapov wrote:
> > On Tue, Feb 23, 2010 at 11:37:21AM +0100, Jan Kiszka wrote:
> >> Gleb Natapov wrote:
> >>> On Tue, Feb 23, 2010 at 11:10:57AM +0100, Jan Kiszka wrote:
> >>>> Gleb Natapov wrote:
> >>>>> On Mon, Feb 22, 2010 at 06:51:23PM +0100, Jan Kiszka wrote:
> >>>>>> Support both guest- as well as host-owned EFLAGS.TF while emulating
> >>>>>> instructions. For guest-owned TF, we simply inject DB and update DR6.BS
> >>>>>> after completing an instruction that has TF set on entry. To support
> >>>>>> guest single-stepping under host control, we store the pending step
> >>>>>> along with its CS and RIP and trigger a corresponding user space exit
> >>>>>> once guest execution is about to resume. This check is is also required
> >>>>>> in the VMX emulation loop during invalid guest states.
> >>>>>>
> >>>>> Emulator currently is a total mess. It is not a good time to add more mess
> >>>>> there right now IMO.
> >>>> Then let's clean up what you consider "mess" in this feature. Unless
> >>>> there are plans to clean up the emulator for the next or next-but-one
> >>>> kernel release, I do not want to wait for this.
> >>>>
> >>> There are plans to cleanup the emulator.
> >> When?
> > ASAP :) I am looking into that, but it will not be easy.
>
> Ok, so you are targeting 2.6.35? Then I'm fine to wait for this, keeping
> the patch for local use so far.
>
As I said ASAP :) I can't as of yet tell how much time it will take.
Right now I am trying to revive emulator tests that we have, since
touching this code without test cases is madness.

> But we should then merge patch 5 as a workaround so that guest debugging
> is at least not completely broken when stepping over emulated instructions.
Yes, patch 5 is fine.

--
Gleb.