Bug 1461241
Summary: | [P9] Guest system time continue when stop the guest in hmp | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Xujun Ma <xuma> |
Component: | qemu-kvm | Assignee: | David Gibson <dgibson> |
Status: | CLOSED CANTFIX | QA Contact: | Xujun Ma <xuma> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.4-Alt | CC: | knoel, lvivier, qzhang, rbalakri, virt-maint, xuma |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | ppc64le | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-06-15 02:27:23 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Xujun Ma
2017-06-14 03:05:18 UTC
looks like BZ1264258, but it has been fixed by (included since v2.9.0): commit 42043e4f1241eeb77f87f5816b5cf0b6e9583ed7 Author: Laurent Vivier <lvivier> Date: Fri Jan 27 13:24:58 2017 +0100 spapr: clock should count only if vm is running This is a port to ppc of the i386 commit: 00f4d64 kvmclock: clock should count only if vm is running We remove timebase_post_load function, and use the VM state change handler to save and restore the guest_timebase (on stop and continue). We keep timebase_pre_save to reduce the clock difference on migration like in: 6053a86 kvmclock: reduce kvmclock difference on migration Time base offset has originally been introduced by commit 98a8b52 spapr: Add support for time base offset migration So while VM is paused, the time is stopped. This allows to have the same result with date (based on Time Base Register) and hwclock (based on "get-time-of-day" RTAS call). Moreover in TCG mode, the Time Base is always paused, so this patch also adjust the behavior between TCG and KVM. VM state field "time_of_the_day_ns" is now useless but we keep it to be able to migrate to older version of the machine. As vmstate_ppc_timebase structure (with timebase_pre_save() and timebase_post_load() functions) was only used by vmstate_spapr, we register the VM state change handler only in ppc_spapr_init(). Signed-off-by: Laurent Vivier <lvivier> Signed-off-by: David Gibson <david.id.au> Could you provide your qemu-kvm version? you should use "clock=vm" if you want the clock stops. See manual: By default the RTC is driven by the host system time. This allows using of the RTC as accurate reference clock inside the guest, specifically if the host time is smoothly following an accurate external reference clock, e.g. via NTP. If you want to isolate the guest time from the host, you can set clock to "rt" instead. To even prevent it from progressing during suspension, you can set it to "vm". Could you check with x86_64? (In reply to Laurent Vivier from comment #2) > looks like BZ1264258, but it has been fixed by (included since v2.9.0): > > commit 42043e4f1241eeb77f87f5816b5cf0b6e9583ed7 > Author: Laurent Vivier <lvivier> > Date: Fri Jan 27 13:24:58 2017 +0100 > > spapr: clock should count only if vm is running > > This is a port to ppc of the i386 commit: > 00f4d64 kvmclock: clock should count only if vm is running > > We remove timebase_post_load function, and use the VM state > change handler to save and restore the guest_timebase (on stop > and continue). > > We keep timebase_pre_save to reduce the clock difference on > migration like in: > 6053a86 kvmclock: reduce kvmclock difference on migration > > Time base offset has originally been introduced by commit > 98a8b52 spapr: Add support for time base offset migration > > So while VM is paused, the time is stopped. This allows to have > the same result with date (based on Time Base Register) and > hwclock (based on "get-time-of-day" RTAS call). > > Moreover in TCG mode, the Time Base is always paused, so this > patch also adjust the behavior between TCG and KVM. > > VM state field "time_of_the_day_ns" is now useless but we keep > it to be able to migrate to older version of the machine. > > As vmstate_ppc_timebase structure (with timebase_pre_save() and > timebase_post_load() functions) was only used by vmstate_spapr, > we register the VM state change handler only in ppc_spapr_init(). > > Signed-off-by: Laurent Vivier <lvivier> > Signed-off-by: David Gibson <david.id.au> > > Could you provide your qemu-kvm version? qemu-kvm-rhev-2.9.0-7.el7.ppc64le (In reply to Laurent Vivier from comment #3) > you should use "clock=vm" if you want the clock stops. As I know,It will make rtc time stop,not system time. > > See manual: > > By default the RTC is driven by the host system time. This allows > using of the RTC as accurate reference clock inside the guest, > specifically if the host time is smoothly following an accurate > external reference clock, e.g. via NTP. If you want to isolate > the > guest time from the host, you can set clock to "rt" instead. To > even prevent it from progressing during suspension, you can set it > to "vm". > > Could you check with x86_64? I have tested it on power8 host and x86 platform,and no this problem,so I think it's a power9 only bug. Xujun, You're right that clock=vm should affect the RTC and not system time. I believe this bug is a side effect of the workaround for bug 1451884. Stopping the guest's clock requires adjusting its timebase offset. But on POWER9 DD1, adjustimg the timebase offset can crash the host, so it is disabled. There is nothing we can do to fix this until we get updated CPUs. |