For x86_64, we must have a RTC driver compiled in kernel. I compiled a native x86_64 Linux kernel without any RTC driver support, and the native Linux kernel also has the same time issue. If we run hwclock, we get Cannot access the Hardware Clock via any known method. Use the --debug option to see the details of our search for an access method. If this command fails, /etc/rc.d/rc.sysinit can not set kernel time (by calling syscall settimeofday()) correctly. And after adding CONFIG_RTC to xeno64 default config file, the time issue is gone. But for i386, this is not a must, for it has some other way to get the RTC time. Following is the patch: # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/06/08 23:59:01-07:00 xin@los-vmm64.sc.intel.com # fix time issue bug on x86_64 # Signed-off-by: Li B Xin <li.b.xin@intel.com> # Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> # # linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 # 2005/06/08 23:59:00-07:00 xin@los-vmm64.sc.intel.com +1 -1 # fix time issue bug by adding RTC driver support. # x86_64 must have a RTC driver support, or we can not run hwclock successfully, so we can not set a correct time to kernel. # Signed-off-by: Li B Xin <li.b.xin@intel.com> # Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> # diff -Nru a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 --- a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 2005-06-09 00:02:32 -07:00 +++ b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 2005-06-09 00:02:32 -07:00 @@ -701,7 +701,7 @@ # CONFIG_WATCHDOG is not set # CONFIG_HW_RANDOM is not set # CONFIG_NVRAM is not set -# CONFIG_RTC is not set +CONFIG_RTC=y # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set thanks -Xin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Glad to see the fix was that easy. I really though that this would require a lot more work then this to have this work :-). On Fri, 2005-06-10 at 02:45 +0800, Li, Xin B wrote:> For x86_64, we must have a RTC driver compiled in kernel. > I compiled a native x86_64 Linux kernel without any RTC driver support, > and the native Linux kernel also has the same time issue. > If we run hwclock, we get > Cannot access the Hardware Clock via any known method. > Use the --debug option to see the details of our search for an > access method. > If this command fails, /etc/rc.d/rc.sysinit can not set kernel time (by > calling syscall settimeofday()) correctly. > > And after adding CONFIG_RTC to xeno64 default config file, the time > issue is gone. > But for i386, this is not a must, for it has some other way to get the > RTC time. > > Following is the patch: > > # This is a BitKeeper generated diff -Nru style patch. > # > # ChangeSet > # 2005/06/08 23:59:01-07:00 xin@los-vmm64.sc.intel.com > # fix time issue bug on x86_64 > # Signed-off-by: Li B Xin <li.b.xin@intel.com> > # Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> > # > # linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 > # 2005/06/08 23:59:00-07:00 xin@los-vmm64.sc.intel.com +1 -1 > # fix time issue bug by adding RTC driver support. > # x86_64 must have a RTC driver support, or we can not run hwclock > successfully, so we can not set a correct time to kernel. > # Signed-off-by: Li B Xin <li.b.xin@intel.com> > # Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> > # > diff -Nru > a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 > b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 > --- a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 > 2005-06-09 00:02:32 -07:00 > +++ b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 > 2005-06-09 00:02:32 -07:00 > @@ -701,7 +701,7 @@ > # CONFIG_WATCHDOG is not set > # CONFIG_HW_RANDOM is not set > # CONFIG_NVRAM is not set > -# CONFIG_RTC is not set > +CONFIG_RTC=y > # CONFIG_GEN_RTC is not set > # CONFIG_DTLK is not set > # CONFIG_R3964 is not set > > > thanks > -Xin > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >-- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> For x86_64, we must have a RTC driver compiled in kernel. > I compiled a native x86_64 Linux kernel without any RTC > driver support, and the native Linux kernel also has the same > time issue. > If we run hwclock, we get > Cannot access the Hardware Clock via any known method. > Use the --debug option to see the details of our search > for an access method. > If this command fails, /etc/rc.d/rc.sysinit can not set > kernel time (by calling syscall settimeofday()) correctly. > > And after adding CONFIG_RTC to xeno64 default config file, > the time issue is gone. > But for i386, this is not a must, for it has some other way > to get the RTC time.This will only work for privileged guests -- unprivileged guests can not and should not be able to access the RTC directly. The options are to either have our own /dev/rtc driver, or to emulate reading the rtc in Xen for unprivilged guests (which is dead easy). Ian> Following is the patch: > > # This is a BitKeeper generated diff -Nru style patch. > # > # ChangeSet > # 2005/06/08 23:59:01-07:00 xin@los-vmm64.sc.intel.com > # fix time issue bug on x86_64 > # Signed-off-by: Li B Xin <li.b.xin@intel.com> > # Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> > # > # linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 > # 2005/06/08 23:59:00-07:00 xin@los-vmm64.sc.intel.com +1 -1 > # fix time issue bug by adding RTC driver support. > # x86_64 must have a RTC driver support, or we can not run hwclock > successfully, so we can not set a correct time to kernel. > # Signed-off-by: Li B Xin <li.b.xin@intel.com> > # Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> > # > diff -Nru > a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 > b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 > --- a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 > 2005-06-09 00:02:32 -07:00 > +++ b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 > 2005-06-09 00:02:32 -07:00 > @@ -701,7 +701,7 @@ > # CONFIG_WATCHDOG is not set > # CONFIG_HW_RANDOM is not set > # CONFIG_NVRAM is not set > -# CONFIG_RTC is not set > +CONFIG_RTC=y > # CONFIG_GEN_RTC is not set > # CONFIG_DTLK is not set > # CONFIG_R3964 is not set > > > thanks > -Xin > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt wrote:> > For x86_64, we must have a RTC driver compiled in > kernel. >> I compiled a native x86_64 Linux kernel without any RTC >> driver support, and the native Linux kernel also has the >> same >> time issue. >> If we run hwclock, we get >> Cannot access the Hardware Clock via any known method. >> Use the --debug option to see the details of our search >> for an access method. >> If this command fails, /etc/rc.d/rc.sysinit can not set >> kernel time (by calling syscall settimeofday()) >> correctly. >> >> And after adding CONFIG_RTC to xeno64 default config >> file, >> the time issue is gone. >> But for i386, this is not a must, for it has some other >> way >> to get the RTC time. > > This will only work for privileged guests -- unprivileged > guests can not and should not be able to access the RTC > directly. > > The options are to either have our own /dev/rtc driver, > or to emulate reading the rtc in Xen for unprivilged > guests (which is dead easy). > > IanSo, do we need this patch? I think it should be OK for xen0. -Xin> > >> Following is the patch: >> >> # This is a BitKeeper generated diff -Nru style patch. # >> # ChangeSet >> # 2005/06/08 23:59:01-07:00 xin@los-vmm64.sc.intel.com >> # fix time issue bug on x86_64 >> # Signed-off-by: Li B Xin <li.b.xin@intel.com> >> # Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> >> # # >> linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 >> # 2005/06/08 23:59:00-07:00 xin@los-vmm64.sc.intel.com >> +1 -1 # fix time issue bug by adding RTC driver >> support. # x86_64 must have a RTC driver support, or >> we can not run hwclock successfully, so we can not set a >> correct time to kernel. # Signed-off-by: Li B Xin >> <li.b.xin@intel.com> # Signed-off-by: Jun Nakajima >> <jun.nakajima@intel.com> # >> diff -Nru >> a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 >> b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 >> --- >> a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 >> 2005-06-09 00:02:32 -07:00 +++ >> b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 >> 2005-06-09 00:02:32 -07:00 @@ -701,7 +701,7 @@ # >> CONFIG_WATCHDOG is not set # CONFIG_HW_RANDOM is not >> set # CONFIG_NVRAM is not set -# CONFIG_RTC is not set >> +CONFIG_RTC=y >> # CONFIG_GEN_RTC is not set >> # CONFIG_DTLK is not set >> # CONFIG_R3964 is not set >> >> >> thanks >> -Xin >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 10 Jun 2005, at 08:58, Li, Xin B wrote:> So, do we need this patch? I think it should be OK for xen0. > -XinYeah, I think it''s the right thing to do. Emulating RTC accesses for domU''s will be easier than implementing a new RTC driver. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel