Re: [PATCH] KVM: lapic: restart counter on change to periodic mode

Sean Christopherson
2019-08-21T17:17:40Z

On Tue, Aug 20, 2019 at 12:34:20AM -0700, Matt Delco wrote:
> On Mon, Aug 19, 2019 at 10:09 PM Wanpeng Li <kernellwp@gmail.com> wrote:
> >
> > On Tue, 20 Aug 2019 at 12:10, Nadav Amit <nadav.amit@gmail.com> wrote:
> > > These tests pass on bare-metal.
> >
> > Good to know this. In addition, in linux apic driver, during mode
> > switch __setup_APIC_LVTT() always sets lapic_timer_period(number of
> > clock cycles per jiffy)/APIC_DIVISOR to APIC_TMICT which can avoid the
> > issue Matt report. So is it because there is no such stuff in windows
> > or the windows version which Matt testing is too old?
>
> I'm using Windows 10 (May 2019). Multimedia apps on Windows tend to
> request higher frequency clocks, and this in turn can affect how the
> kernel configures HW timers. I may need to examine how Windows
> typically interacts with the APIC timer and see if/how this changes
> when Skype is used. The frequent timer mode changes are not something
> I'd expect a reasonably behaved kernel to do.

Have you tried analyzing the guest code? If we're lucky, doing so might
provide insight into what's going awry.

E.g.:

Are the LVTT/TMICT writes are coming from a single blob/sequence of code
in the guest?

Is the unpaired LVTT coming from the same code sequence or is it a new
rip entirely?

Can you dump the relevant asm code sequences?