Skip to contentSkip to conversation

RTC: enable lost_tick_policy=slew as default (v2)

PATCH In review Marcelo Tosatti 3 participants 8 messages Dec 12, 2012 – Jul 9, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RTC: enable lost_tick_policy=slew as default (v2)

RTC interrupt reinjection has no known negative effect. Lack of RTC interrupt reinjection, though, has negative effects: time drift for Windows guests which use it as a timer source.

Based on that, enable lost_tick_policy=slew option as default.

v2: do not change default for older machines types (Paolo Bonzini)

hw/mc146818rtc.c +1 -1
index c79fca7..c9e007d 100644
@@ -884,7 +884,7 @@ ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
 static Property mc146818rtc_properties[] = {
     DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980),
     DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
-                               lost_tick_policy, LOST_TICK_DISCARD),
+                               lost_tick_policy, LOST_TICK_SLEW),
     DEFINE_PROP_END_OF_LIST(),
 };
 
hw/pc_piix.c +4 -0
index 19e342a..475bb4c 100644
@@ -295,6 +295,10 @@ static QEMUMachine pc_machine_v1_4 = {
             .driver   = "usb-tablet",\
             .property = "usb_version",\
             .value    = stringify(1),\
+        },{\
+            .driver   = "mc146818rtc",\
+            .property = "lost_tick_policy",\
+            .value    = "discard",\
         }
 
 static QEMUMachine pc_machine_v1_3 = {
Reviewed-by on v1 1/1
#1 lore raw

Il 12/12/2012 22:36, Marcelo Tosatti ha scritto:

Quoted 30 lines

RTC interrupt reinjection has no known negative effect. Lack of RTC interrupt reinjection, though, has negative effects: time drift for Windows guests which use it as a timer source.

Based on that, enable lost_tick_policy=slew option as default.

v2: do not change default for older machines types (Paolo Bonzini)

hw/mc146818rtc.c +1 -1
index c79fca7..c9e007d 100644
@@ -884,7 +884,7 @@ ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
 static Property mc146818rtc_properties[] = {
     DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980),
     DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
-                               lost_tick_policy, LOST_TICK_DISCARD),
+                               lost_tick_policy, LOST_TICK_SLEW),
     DEFINE_PROP_END_OF_LIST(),
 };
 
hw/pc_piix.c +0 -0
index 19e342a..475bb4c 100644

hw/pc_piix.c static QEMUMachine pc_machine_v1_4 = { · line 304

Quoted 10 lines
hw/pc_piix.c +4 -0
@@ -295,6 +295,10 @@ static QEMUMachine pc_machine_v1_4 = {
             .driver   = "usb-tablet",\
             .property = "usb_version",\
             .value    = stringify(1),\
+        },{\
+            .driver   = "mc146818rtc",\
+            .property = "lost_tick_policy",\
+            .value    = "discard",\
         }
 
 static QEMUMachine pc_machine_v1_3 = {
#2 lore raw
In reply to Marcelo Tosatti

Il 12/12/2012 22:36, Marcelo Tosatti ha scritto:

Quoted 31 lines

RTC interrupt reinjection has no known negative effect. Lack of RTC interrupt reinjection, though, has negative effects: time drift for Windows guests which use it as a timer source.

Based on that, enable lost_tick_policy=slew option as default.

v2: do not change default for older machines types (Paolo Bonzini)

hw/mc146818rtc.c +1 -1
index c79fca7..c9e007d 100644
@@ -884,7 +884,7 @@ ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
 static Property mc146818rtc_properties[] = {
     DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980),
     DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
-                               lost_tick_policy, LOST_TICK_DISCARD),
+                               lost_tick_policy, LOST_TICK_SLEW),
     DEFINE_PROP_END_OF_LIST(),
 };
 
hw/pc_piix.c +0 -0
index 19e342a..475bb4c 100644

hw/pc_piix.c static QEMUMachine pc_machine_v1_4 = { · line 304

Quoted 10 lines
hw/pc_piix.c +4 -0
@@ -295,6 +295,10 @@ static QEMUMachine pc_machine_v1_4 = {
             .driver   = "usb-tablet",\
             .property = "usb_version",\
             .value    = stringify(1),\
+        },{\
+            .driver   = "mc146818rtc",\
+            .property = "lost_tick_policy",\
+            .value    = "discard",\
         }
 
 static QEMUMachine pc_machine_v1_3 = {

Looks like this was never applied. Can you redo it for the new 1.5 machine (compatibility defines are now in hw/pc.h)?

Paolo

#3 lore raw
Quoted 39 lines · Paolo Bonzini

Il 12/12/2012 22:36, Marcelo Tosatti ha scritto:

Quoted 38 lines

RTC interrupt reinjection has no known negative effect. Lack of RTC interrupt reinjection, though, has negative effects: time drift for Windows guests which use it as a timer source.

Based on that, enable lost_tick_policy=slew option as default.

v2: do not change default for older machines types (Paolo Bonzini)

hw/mc146818rtc.c +1 -1
index c79fca7..c9e007d 100644
@@ -884,7 +884,7 @@ ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
 static Property mc146818rtc_properties[] = {
     DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980),
     DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
-                               lost_tick_policy, LOST_TICK_DISCARD),
+                               lost_tick_policy, LOST_TICK_SLEW),
     DEFINE_PROP_END_OF_LIST(),
 };
 
hw/pc_piix.c +4 -0
index 19e342a..475bb4c 100644
@@ -295,6 +295,10 @@ static QEMUMachine pc_machine_v1_4 = {
             .driver   = "usb-tablet",\
             .property = "usb_version",\
             .value    = stringify(1),\
+        },{\
+            .driver   = "mc146818rtc",\
+            .property = "lost_tick_policy",\
+            .value    = "discard",\
         }
 
Quoted 8 lines

hw/pc_piix.c static QEMUMachine pc_machine_v1_4 = { · line 304

Quoted 3 lines
hw/pc_piix.c +0 -0
 static QEMUMachine pc_machine_v1_3 = {

Looks like this was never applied. Can you redo it for the new 1.5 machine (compatibility defines are now in hw/pc.h)?

Paolo

Anthony mentioned that this

http://article.gmane.org/gmane.comp.emulators.qemu/160699

Is the proper way to do it.

#4 lore raw
Quoted 47 lines · Marcelo Tosatti
Quoted 46 lines · Paolo Bonzini

Il 12/12/2012 22:36, Marcelo Tosatti ha scritto:

Quoted 31 lines

RTC interrupt reinjection has no known negative effect. Lack of RTC interrupt reinjection, though, has negative effects: time drift for Windows guests which use it as a timer source.

Based on that, enable lost_tick_policy=slew option as default.

v2: do not change default for older machines types (Paolo Bonzini)

hw/mc146818rtc.c +1 -1
index c79fca7..c9e007d 100644
@@ -884,7 +884,7 @@ ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
 static Property mc146818rtc_properties[] = {
     DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980),
     DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
-                               lost_tick_policy, LOST_TICK_DISCARD),
+                               lost_tick_policy, LOST_TICK_SLEW),
     DEFINE_PROP_END_OF_LIST(),
 };
 
hw/pc_piix.c +0 -0
index 19e342a..475bb4c 100644

hw/pc_piix.c static QEMUMachine pc_machine_v1_4 = { · line 304

Quoted 10 lines
hw/pc_piix.c +4 -0
@@ -295,6 +295,10 @@ static QEMUMachine pc_machine_v1_4 = {
             .driver   = "usb-tablet",\
             .property = "usb_version",\
             .value    = stringify(1),\
+        },{\
+            .driver   = "mc146818rtc",\
+            .property = "lost_tick_policy",\
+            .value    = "discard",\
         }
 
 static QEMUMachine pc_machine_v1_3 = {

Looks like this was never applied. Can you redo it for the new 1.5 machine (compatibility defines are now in hw/pc.h)?

Quoted 7 lines
Quoted 1 line

Paolo

Anthony mentioned that this

http://article.gmane.org/gmane.comp.emulators.qemu/160699

Is the proper way to do it.

That breaks too. I don't have a solution but I also don't remember what the exact failures are.

I'm planning on running this patch through testing again so I can provide better feedback.

Regards,

Anthony Liguori

#5 lore raw

Il 08/03/2013 18:53, Anthony Liguori ha scritto:

Quoted 8 lines
Quoted 5 lines

Anthony mentioned that this

http://article.gmane.org/gmane.comp.emulators.qemu/160699

Is the proper way to do it.

That breaks too. I don't have a solution but I also don't remember what the exact failures are.

What about a more generic version of that? Adding a priority field to global properties, so that -global can have a higher priority than the default (used by machine types)?

Paolo

#6 lore raw
Quoted 7 lines · Paolo Bonzini

Il 08/03/2013 18:53, Anthony Liguori ha scritto:

Quoted 6 lines
Quoted 5 lines

Anthony mentioned that this

http://article.gmane.org/gmane.comp.emulators.qemu/160699

Is the proper way to do it.

Quoted 8 lines
Quoted 2 lines

That breaks too. I don't have a solution but I also don't remember what the exact failures are.

What about a more generic version of that? Adding a priority field to global properties, so that -global can have a higher priority than the default (used by machine types)?

Paolo

What exactly is the problem with

http://lists.gnu.org/archive/html/qemu-devel/2012-12/msg01733.html

Again? Should it just be resubmitted ?

#7 lore raw
Quoted 15 lines · Marcelo Tosatti
Quoted 14 lines · Paolo Bonzini

Il 08/03/2013 18:53, Anthony Liguori ha scritto:

Quoted 8 lines
Quoted 5 lines

Anthony mentioned that this

http://article.gmane.org/gmane.comp.emulators.qemu/160699

Is the proper way to do it.

That breaks too. I don't have a solution but I also don't remember what the exact failures are.

What about a more generic version of that? Adding a priority field to global properties, so that -global can have a higher priority than the default (used by machine types)?

Quoted 7 lines
Quoted 1 line

Paolo

What exactly is the problem with

http://lists.gnu.org/archive/html/qemu-devel/2012-12/msg01733.html

Again? Should it just be resubmitted ?

Breaks the -rtc option which also uses globals.

Try qemu -M pc-1.4 -rtc driftfix=slew

Or qemu -M pc-1.4 -rtc-td-hack

Regards,

Anthony Liguori