Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-18 Thread Jan Kiszka
[only saw this now, or delivery to me was delayed - anyway] On 16.03.21 19:02, Maxim Levitsky wrote: > On Tue, 2021-03-16 at 18:01 +0100, Jan Kiszka wrote: >> On 16.03.21 17:50, Sean Christopherson wrote: >>> On Tue, Mar 16, 2021, Maxim Levitsky wrote: On Tue, 2021-03-16 at 16:31 +0100, Jan K

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-18 Thread Jan Kiszka
On 16.03.21 13:34, Maxim Levitsky wrote: > On Tue, 2021-03-16 at 12:27 +0100, Jan Kiszka wrote: >> On 16.03.21 11:59, Maxim Levitsky wrote: >>> On Tue, 2021-03-16 at 10:16 +0100, Jan Kiszka wrote: On 16.03.21 00:37, Sean Christopherson wrote: > On Tue, Mar 16, 2021, Maxim Levitsky wrote: >

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-17 Thread Jan Kiszka
On 16.03.21 18:26, Sean Christopherson wrote: > On Tue, Mar 16, 2021, Jan Kiszka wrote: >> On 16.03.21 17:50, Sean Christopherson wrote: >>> Rather than block all events in KVM, what about having QEMU "pause" the >>> timer? >>> E.g. save MSR_TSC_DEADLINE and APIC_TMICT (or inspect the guest to fin

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Maxim Levitsky
On Tue, 2021-03-16 at 18:01 +0100, Jan Kiszka wrote: > On 16.03.21 17:50, Sean Christopherson wrote: > > On Tue, Mar 16, 2021, Maxim Levitsky wrote: > > > On Tue, 2021-03-16 at 16:31 +0100, Jan Kiszka wrote: > > > > Back then, when I was hacking on the gdb-stub and KVM support, the > > > > monitor

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Sean Christopherson
On Tue, Mar 16, 2021, Jan Kiszka wrote: > On 16.03.21 17:50, Sean Christopherson wrote: > > Rather than block all events in KVM, what about having QEMU "pause" the > > timer? > > E.g. save MSR_TSC_DEADLINE and APIC_TMICT (or inspect the guest to find out > > which flavor it's using), clear them to

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Jan Kiszka
On 16.03.21 17:50, Sean Christopherson wrote: > On Tue, Mar 16, 2021, Maxim Levitsky wrote: >> On Tue, 2021-03-16 at 16:31 +0100, Jan Kiszka wrote: >>> Back then, when I was hacking on the gdb-stub and KVM support, the >>> monitor trap flag was not yet broadly available, but the idea to once >>> us

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Sean Christopherson
On Tue, Mar 16, 2021, Maxim Levitsky wrote: > On Tue, 2021-03-16 at 16:31 +0100, Jan Kiszka wrote: > > Back then, when I was hacking on the gdb-stub and KVM support, the > > monitor trap flag was not yet broadly available, but the idea to once > > use it was already there. Now it can be considered

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Jan Kiszka
On 16.03.21 16:49, Maxim Levitsky wrote: > On Tue, 2021-03-16 at 16:31 +0100, Jan Kiszka wrote: >> On 16.03.21 15:34, Maxim Levitsky wrote: >>> On Tue, 2021-03-16 at 14:46 +0100, Jan Kiszka wrote: On 16.03.21 13:34, Maxim Levitsky wrote: > On Tue, 2021-03-16 at 12:27 +0100, Jan Kiszka wrot

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Jan Kiszka
On 16.03.21 15:34, Maxim Levitsky wrote: > On Tue, 2021-03-16 at 14:46 +0100, Jan Kiszka wrote: >> On 16.03.21 13:34, Maxim Levitsky wrote: >>> On Tue, 2021-03-16 at 12:27 +0100, Jan Kiszka wrote: On 16.03.21 11:59, Maxim Levitsky wrote: > On Tue, 2021-03-16 at 10:16 +0100, Jan Kiszka wrot

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Maxim Levitsky
On Tue, 2021-03-16 at 14:46 +0100, Jan Kiszka wrote: > On 16.03.21 13:34, Maxim Levitsky wrote: > > On Tue, 2021-03-16 at 12:27 +0100, Jan Kiszka wrote: > > > On 16.03.21 11:59, Maxim Levitsky wrote: > > > > On Tue, 2021-03-16 at 10:16 +0100, Jan Kiszka wrote: > > > > > On 16.03.21 00:37, Sean Chri

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Jan Kiszka
On 16.03.21 13:34, Maxim Levitsky wrote: > On Tue, 2021-03-16 at 12:27 +0100, Jan Kiszka wrote: >> On 16.03.21 11:59, Maxim Levitsky wrote: >>> On Tue, 2021-03-16 at 10:16 +0100, Jan Kiszka wrote: On 16.03.21 00:37, Sean Christopherson wrote: > On Tue, Mar 16, 2021, Maxim Levitsky wrote: >

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Maxim Levitsky
On Tue, 2021-03-16 at 12:27 +0100, Jan Kiszka wrote: > On 16.03.21 11:59, Maxim Levitsky wrote: > > On Tue, 2021-03-16 at 10:16 +0100, Jan Kiszka wrote: > > > On 16.03.21 00:37, Sean Christopherson wrote: > > > > On Tue, Mar 16, 2021, Maxim Levitsky wrote: > > > > > This change greatly helps with t

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Jan Kiszka
On 16.03.21 11:59, Maxim Levitsky wrote: > On Tue, 2021-03-16 at 10:16 +0100, Jan Kiszka wrote: >> On 16.03.21 00:37, Sean Christopherson wrote: >>> On Tue, Mar 16, 2021, Maxim Levitsky wrote: This change greatly helps with two issues: * Resuming from a breakpoint is much more reliab

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Maxim Levitsky
On Tue, 2021-03-16 at 10:16 +0100, Jan Kiszka wrote: > On 16.03.21 00:37, Sean Christopherson wrote: > > On Tue, Mar 16, 2021, Maxim Levitsky wrote: > > > This change greatly helps with two issues: > > > > > > * Resuming from a breakpoint is much more reliable. > > > > > > When resuming executi

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Maxim Levitsky
On Mon, 2021-03-15 at 16:37 -0700, Sean Christopherson wrote: > On Tue, Mar 16, 2021, Maxim Levitsky wrote: > > This change greatly helps with two issues: > > > > * Resuming from a breakpoint is much more reliable. > > > > When resuming execution from a breakpoint, with interrupts enabled, more

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-16 Thread Jan Kiszka
On 16.03.21 00:37, Sean Christopherson wrote: > On Tue, Mar 16, 2021, Maxim Levitsky wrote: >> This change greatly helps with two issues: >> >> * Resuming from a breakpoint is much more reliable. >> >> When resuming execution from a breakpoint, with interrupts enabled, more >> often >> than no

Re: [PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-15 Thread Sean Christopherson
On Tue, Mar 16, 2021, Maxim Levitsky wrote: > This change greatly helps with two issues: > > * Resuming from a breakpoint is much more reliable. > > When resuming execution from a breakpoint, with interrupts enabled, more > often > than not, KVM would inject an interrupt and make the CPU jum

[PATCH 2/3] KVM: x86: guest debug: don't inject interrupts while single stepping

2021-03-15 Thread Maxim Levitsky
This change greatly helps with two issues: * Resuming from a breakpoint is much more reliable. When resuming execution from a breakpoint, with interrupts enabled, more often than not, KVM would inject an interrupt and make the CPU jump immediately to the interrupt handler and eventually ret