Skip to content

Commit

Permalink
powerpc/time: Fix clockevent_decrementer initalisation for PR KVM
Browse files Browse the repository at this point in the history
[ Upstream commit b4d16ab ]

In the recent commit 8b78fdb ("powerpc/time: Use
clockevents_register_device(), fixing an issue with large
decrementer") we changed the way we initialise the decrementer
clockevent(s).

We no longer initialise the mult & shift values of
decrementer_clockevent itself.

This has the effect of breaking PR KVM, because it uses those values
in kvmppc_emulate_dec(). The symptom is guest kernels spin forever
mid-way through boot.

For now fix it by assigning back to decrementer_clockevent the mult
and shift values.

Fixes: 8b78fdb ("powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Michael Ellerman authored and Greg Kroah-Hartman committed Nov 24, 2019
1 parent d09d148 commit cd3cac5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,10 @@ static void register_decrementer_clockevent(int cpu)

printk_once(KERN_DEBUG "clockevent: %s mult[%x] shift[%d] cpu[%d]\n",
dec->name, dec->mult, dec->shift, cpu);

/* Set values for KVM, see kvm_emulate_dec() */
decrementer_clockevent.mult = dec->mult;
decrementer_clockevent.shift = dec->shift;
}

static void enable_large_decrementer(void)
Expand Down

0 comments on commit cd3cac5

Please sign in to comment.