On Sun, Oct 8, 2017 at 6:03 AM, Theo de Raadt <dera...@openbsd.org> wrote:

> > Adam will correct me if I'm wrong, but his idea was to provide clock
> > emulation to the operating system running in userland (solo5/unikernel).
> > Perhaps vmd can make use of this interface too.
>
> But why does it matter if it knows the frequency?
>

Hi Mike, Theo

yes, Mike you are correct.

To provide more background, quoting the solo5 readme[https://github.com/
Solo5/solo5], "Solo5 is most useful as a "base layer" to run MirageOS
unikernels, either on various existing hypervisors (KVM/QEMU, bhyve) or on
a specialized "unikernel monitor" called ukvm."

With the Help of Mike B and Mile L, i have been successfully running solo5
test kernels on ukvm (userland) and vmm (OpenBSD kernel) locally.

ukvm needs to know the tsc frequency, so it can pass this information to a
Solo5 unikernel which then uses rdtsc() to implement a clock.

the following links to source code provide some more information
solo5 unikernel clock implementation
https://github.com/Solo5/solo5/blob/f8a277f83807333685742228ffef0d
87270207cf/kernel/ukvm/tscclock.c#L60-L106

solo5 unikernel clock initialisation
https://github.com/Solo5/solo5/blob/9bad601c79ba7a549c87d22aaa970d
695e81e188/kernel/ukvm/time.c#L25
ukvm on OpenBSD setting up the tsc frequency
https://github.com/adamsteen/solo5/blob/master/ukvm/ukvm_
hv_openbsd_x86_64.c#L137
and

https://github.com/adamsteen/solo5/blob/200d7c4d4feb7aca62a3bae61f2ab1ec4bdd5bc9/ukvm/ukvm_hv_openbsd_x86_64.c#L52-L73





Cheers
Adam

Reply via email to