Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aarch64: bugs in arm-clock #1091

Closed
wkozaczuk opened this issue Jul 20, 2020 · 7 comments
Closed

aarch64: bugs in arm-clock #1091

wkozaczuk opened this issue Jul 20, 2020 · 7 comments

Comments

@wkozaczuk
Copy link
Collaborator

wkozaczuk commented Jul 20, 2020

It appears there are bugs in the arm-clock implementation that cause time/clock related "misbehaviors".

Looking at the code, both the boot_time() and time() delegate to uptime(), which seems to be wrong. The boot_time() should return a constant value captured early and represent the point-it-time the boot process started (see at hpet.cc which returns _wall value). Similarly time() should be equal to sum of uptime() and boottime() which does not seem to be the case for arm_clock.

@anirudh-goyal
Copy link

Hello, I'm a CS student at UT Austin. I was wondering if me and my classmates could work on this issue as part of our virtualization class? Thank you!

@nyh
Copy link
Contributor

nyh commented Sep 21, 2020

Hello, I'm a CS student at UT Austin. I was wondering if me and my classmates could work on this issue as part of our virtualization class? Thank you!

Sure you can, and we'll be happy to help if we can. If you have general questions on OSv, how to run it, how it works, etc., please subscribe to the OSv mailing list ([email protected]) and ask questions there. On this bug tracker here we should focus on the specific issue. Good luck.

@wkozaczuk
Copy link
Collaborator Author

wkozaczuk commented Sep 28, 2020

Hi @anirudh-goyal! Please note that my comment mentioning printing inf most likely is not related to this issue but to the lack of proper floating-point support in aarch64 port that is addressed by the pending musl upgrade patch.

Also to develop/test this issue you will need to be able to build and run aarch64 images. The best Linux distribution for that is Fedora if you want to cross-compile and run the image in the emulated mode on x64 hardware. If you do not like this, you can also run OSv on the latest Raspberry PI 4. I do not think you can build on Raspberry PI 4, but if you want you can help us with that - it would be mostly fiddling with the main Makefile.

For more details about the state of our AArch64 port read this wiki page - https://github.com/cloudius-systems/osv/wiki/AArch64

@michaelsatanovsky
Copy link

Hi. I'm working with @anirudh-goyal on this issue. Is there some documentation or something for me to read to understand the expected behavior for u64 processor_to_nano(u64 ticks)?

@wkozaczuk
Copy link
Collaborator Author

wkozaczuk commented Nov 18, 2020

Unfortunately, there is no specific documentation of how this method should operate except for the comments in https://github.com/cloudius-systems/osv/blob/master/drivers/clock.hh.

You can also compare the existing implementation of it used by kvm and xen paravirtual clocks - see include/osv/pvclock-abi.hh. This commit comments might also help.

Ultimately this method is heavily used by bootchart.cc

@wkozaczuk
Copy link
Collaborator Author

@michaelsatanovsky @anirudh-goyal are you still working on this issue?

wkozaczuk added a commit that referenced this issue Jan 4, 2021
This patch provides missing implementation of processor_to_nano()
in the arm_clock driver.

We simply re-use the formula in the arm_clock::uptime() method
and instead of reading the counter, we simply apply the passed
in one and convert to nanoseconds. This is enough to make bootchart
work properly on aarch64.

Partially addresses #1091

Signed-off-by: Waldemar Kozaczuk <[email protected]>
@wkozaczuk
Copy link
Collaborator Author

I think to properly implement time() we need to add support of PrimeCell RTC (PL031) - https://developer.arm.com/documentation/ddi0224/c/Functional-overview/RTC-operation/RTC-operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants