On 10/19/2012 07:36 PM, ron minnich wrote:
On Fri, Oct 19, 2012 at 4:28 PM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:You know there is a century field, right?Yeah. That's not the issue. The issue is that kvmtool takes the gmtime notion of a year, which is years since 1900, and just uses that in the year byte of CMOS. This is a pretty trivial fix which should work in all the cases I can think of for QEMU (and works very well for me at present). If I'm missing something, let me know. I'm just back from too much beer at latinosoft dinner so don't assume I'm thinking clearly.
What I'm saying is that you should also set the century byte (byte 0x32); there should also be a pointer to it in the ACPI FADT, but 0x32 is the standard location.
The statement "The CMOS standard is time since 2000" is rather misleading; RTC byte 0x09 is simply the low two BCD digits of the Gregorian year, and the century byte (normally 0x32) is the high two BCD digits.
So the right thing is something like: year = tm->tm_year + 1900; case RTC_YEAR: ioport__write8(data, bin2bcd(year % 100)); break; case RTC_CENTURY: ioport__write8(data, bin2bcd(year / 100)); break; -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf. -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html