hyperkit icon indicating copy to clipboard operation
hyperkit copied to clipboard

HPET: 64-bit main counter

Open wkozaczuk opened this issue 7 years ago • 4 comments

What would it take to implement 64-bit main counter - https://github.com/moby/hyperkit/blob/8975f80ae46ef315e600552328ba63af09b742f7/src/lib/vmm/io/vhpet.c#L96?

wkozaczuk avatar Jul 08 '18 05:07 wkozaczuk

Could anyone please weigh in on it? Would you be interested in a pull request to enhance hpet clock functionality in hyperkit to support 64-bit counters?

wkozaczuk avatar Mar 02 '19 15:03 wkozaczuk

I general PRs are always welcome, yes.

Why do you need a 64 -bit HPET though, are you seeing an issue?

ijc avatar Mar 04 '19 10:03 ijc

While trying to make OSv unikernel to boot on hyperkit I discovered that the assert https://github.com/cloudius-systems/osv/blob/master/drivers/hpet.cc#L55 to verify the counter is 64-bit breaks. I actually disabled the assert which made OSv boot and run but eventually fail in another place after roughly 8 minutes. I am not really familiar with HPET but I am guessing disabling the assert is not the right way to fix it on OSv side. So I was wondering if it might be easier to support 64-bit counter on hyperkit side same way as QEMU supports. Looking at Linux implementation - https://github.com/torvalds/linux/blob/master/arch/x86/kernel/hpet.c - it seems that properly supporting HPET in both 32 and 64 bit mode might be pretty tricky judging the lines of code (1300) and some comments in there https://github.com/torvalds/linux/blob/master/arch/x86/kernel/hpet.c#L362-L384.

wkozaczuk avatar Mar 05 '19 03:03 wkozaczuk

If FreeBSD bhyve supports 64bit HPET it should be relatively easier to backport. I would check that

On 5 Mar 2019, at 03:32, WALDEMAR KOZACZUK [email protected] wrote:

While trying to make OSv unikernel to boot on hyperkit I discovered that the assert https://github.com/cloudius-systems/osv/blob/master/drivers/hpet.cc#L55 to verify the counter is 64-bit breaks. I actually disabled the assert which made OSv boot and run but eventually fail in another place after roughly 8 minutes. I am not really familiar with HPET but I am guessing disabling the assert is not the right way to fix it on OSv side. So I was wondering if it might be easier to support 64-bit counter on hyperkit side same way as QEMU supports. Looking at Linux implementation - https://github.com/torvalds/linux/blob/master/arch/x86/kernel/hpet.c - it seems that properly supporting HPET in both 32 and 64 bit mode might be pretty tricky judging the lines of code (1300) and some comments in there https://github.com/torvalds/linux/blob/master/arch/x86/kernel/hpet.c#L362-L384.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

rn avatar Mar 05 '19 08:03 rn