On Thu, 29 May 2008, Marcelo Tosatti wrote: > KVM wishes to allow direct guest access to the ACPI pmtimer. In that > case QEMU/KVM has to read the current value for migration, so the proper > syncing can be done on the destination.
I don't understand from the above which problem you are trying to solve. Which pmtimer is read out, the one of the host (physical hardware) or the one of the guest (emulated hardware) ? What is synced at the destination ? > This patch will not register the device if the chipset has an unreliable > timer. Can we please keep that code inside of drivers/clocksource/acpi_pm.c without creating a new disconnected file in drivers/char ? Btw, depending on the use case we might as well have a sysfs entry for that. > +static ssize_t pmtimer_read(struct file *file, char __user *buf, size_t > count, > + loff_t *ppos) > +{ > + int ret; > + __u32 value; > + > + ret = -EINVAL; > + if (count < sizeof(u32)) > + goto out; return -EINVAL; > + > + value = inl(pmtmr_ioport) & ACPI_PM_MASK; > + > + ret = -EFAULT; > + if (put_user(value, (u32 __user *)buf)) > + goto out; return -EFAULT; > + ret = sizeof(value); return sizeof(value); > +out: > + return ret; > +} > Index: kvm/drivers/clocksource/acpi_pm.c > =================================================================== > --- kvm.orig/drivers/clocksource/acpi_pm.c > +++ kvm/drivers/clocksource/acpi_pm.c > @@ -30,6 +30,8 @@ > */ > u32 pmtmr_ioport __read_mostly; > > +static int reliable_pmtimer; > + > static inline u32 read_pmtmr(void) > { > /* mask the output to 24 bits */ > @@ -208,10 +210,21 @@ pm_good: > if (verify_pmtmr_rate() != 0) > return -ENODEV; > > + if (clocksource_acpi_pm.read == acpi_pm_read) > + reliable_pmtimer = 1; > + > return clocksource_register(&clocksource_acpi_pm); > } > > +int pmtimer_is_reliable(void) > +{ > + return reliable_pmtimer; return clocksource_acpi_pm.read == acpi_pm_read; So we don't need reliable_pmtimer at all. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html