kernel: enable RTC on x86_64#260
Conversation
The two might differ due to vm templating. We need to fix the drift by setting system clock from hardware clock since kvmclock should be trusted. Depends-on: github.com/kata-containers/packaging#260 Fixes: kata-containers#422 Signed-off-by: Peng Tao <bergwolf@gmail.com>
|
out of interest, I'm going to ask the NEMU folks what they do here, if anything, just in case there is an alternative route to the same end :-) |
|
/test |
| # CONFIG_CPU_SUP_AMD is not set | ||
| # CONFIG_CPU_SUP_CENTAUR is not set | ||
| CONFIG_HPET_TIMER=y | ||
| CONFIG_HPET_EMULATE_RTC=y |
There was a problem hiding this comment.
Why is this one needed? Are we expecting the kernel to emulate an RTC based on HPET?
There was a problem hiding this comment.
It comes when I selected CONFIG_RTC_CLASS. Looking closer, CONFIG_RTC_DRV_CMOS and HPET_TIMER automatically enables this feature.
There was a problem hiding this comment.
I'm concerned that having those enabled might fail the kernel from booting properly if they do expect HPET or CMOS to be emulated, which is not the case for NEMU.
There was a problem hiding this comment.
hmm, I think you are right. We don't need CONFIG_RTC_DRV_CMOS, nor CONFIG_RTC_NVMEM. I've dropped both of them from the patch.
The two might differ due to vm templating. We need to fix the drift by setting system clock from hardware clock since kvmclock should be trusted. Depends-on: github.com/kata-containers/packaging#260 Depends-on: github.com/kata-containers/osbuilder#213 Fixes: kata-containers#422 Signed-off-by: Peng Tao <bergwolf@gmail.com>
It is already enabled on ARM and powerpc. We should provide RTC so that guest can access the hw clock. Fixes: kata-containers#259 Signed-off-by: Peng Tao <bergwolf@gmail.com>
|
We have no emulated RTC on the NEMU virt platform so this won't work (and it's pretty inaccurate as the RTC is only really accurate to the second.) The correct solution it to use PTP between the guest and host. Here is the RHEL bug about this feature: https://bugzilla.redhat.com/show_bug.cgi?id=1379822 which explains a lot more details and how to synchronise the guest real world time to the host. |
|
@rbradford Is OTOH, I do agree it is a better solution than RTC. But do you mean NUMU has dropped RTC completely? Is there plan for NUME to support other platforms? |
|
@bergwolf NEMU aims to have no emulated hardware, including the RTC. NEMU does support aarch64 although I believe that is not currently enabled with Kata. If you don't want to use PTP a simpler solution might be just to send the host time from the host to the guest via the agent. That will give you similar accuracy as the RTC. |
|
@rbradford Another problem with |
|
Ping @bergwolf and @rbradford. Also, cc @alicefr in case os390 also needs to be updated for this. |
|
I think the best solution is to send the time from the host to the agent and have the agent set the time. This would then not require any kernel changes / would work on all architectures. |
|
That's a great idea - gRPC it! ;) |
|
although we'd need something to adjust the time for the wire delay I guess. |
|
@jodh-intel the PC RTC only has an accuracy to the second so I don't think you should put too much effort into time adjustment. |
|
Let's pursue grpc based solution. See kata-containers/agent#425 |
builder: Pass the DEBUG flag when using docker
It is already enabled on ARM and powerpc. We should provide RTC
so that guest can access the hw clock.
Fixes: #259
Signed-off-by: Peng Tao bergwolf@gmail.com