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

RTC: time is set to year 1970 #47

Closed
andreeaflorescu opened this issue Apr 20, 2021 · 0 comments
Closed

RTC: time is set to year 1970 #47

andreeaflorescu opened this issue Apr 20, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@andreeaflorescu
Copy link
Member

We have a bug in the RTC implementation by which we are not setting the correct value to the Load Register (LR). This register is suppose to be initialized with the time elapsed since the UNIX Epoch, otherwise the guest will have the time set to 1970.

@andreeaflorescu andreeaflorescu added the bug Something isn't working label Apr 20, 2021
@andreeaflorescu andreeaflorescu self-assigned this Apr 20, 2021
andreeaflorescu added a commit to andreeaflorescu/vm-superio that referenced this issue Apr 20, 2021
The load register needs to be initialized to the unix epoch time.
Otherwise, if we initialize it to 0, the guest will always see the time
as in the year 1970.

Fixes: rust-vmm#47

Signed-off-by: Andreea Florescu <fandree@amazon.com>
andreeaflorescu added a commit to andreeaflorescu/vm-superio that referenced this issue Apr 21, 2021
The load register needs to be initialized to the unix epoch time.
Otherwise, if we initialize it to 0, the guest will always see the time
as in the year 1970.

Fixes: rust-vmm#47

Signed-off-by: Andreea Florescu <fandree@amazon.com>
andreeaflorescu added a commit to andreeaflorescu/vm-superio that referenced this issue Apr 28, 2021
The data register is the register that is telling the RTC time.
Before we were initializing this to 0, which meant that in a VMM the
guest would always see the time as it was 1970s (corresponding to UTC
0).

Fixes: rust-vmm#47

Signed-off-by: Andreea Florescu <fandree@amazon.com>
andreeaflorescu added a commit to andreeaflorescu/vm-superio that referenced this issue Apr 28, 2021
The data register is the register that is telling the RTC time.
Before we were initializing this to 0, which meant that in a VMM the
guest would always see the time as it was 1970s (corresponding to UTC
0).

Fixes: rust-vmm#47

Signed-off-by: Andreea Florescu <fandree@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant