]> git.proxmox.com Git - qemu.git/commitdiff
target-alpha: Move alarm to vm_clock
authorRichard Henderson <rth@twiddle.net>
Tue, 16 Jul 2013 13:45:57 +0000 (06:45 -0700)
committerRichard Henderson <rth@twiddle.net>
Thu, 18 Jul 2013 13:44:55 +0000 (06:44 -0700)
Basing the alarm off the rtc_clock was silly.  It leads to horrible
spinning in the guest after being suspended and resumed, as it tries
to catch up with lost ticks.

This requires adding an accessor for reading the vm_clock too.

Signed-off-by: Richard Henderson <rth@twiddle.net>
hw/alpha/typhoon.c
target-alpha/helper.h
target-alpha/sys_helper.c
target-alpha/translate.c

index 3d7a1cd8e84a839ede6c6b2ff7c1f5b426593a88..b7fb04406c34b5c4cbeda2dc78ee41cf1d63f7c9 100644 (file)
@@ -693,7 +693,7 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,
         AlphaCPU *cpu = cpus[i];
         s->cchip.cpu[i] = cpu;
         if (cpu != NULL) {
-            cpu->alarm_timer = qemu_new_timer_ns(rtc_clock,
+            cpu->alarm_timer = qemu_new_timer_ns(vm_clock,
                                                  typhoon_alarm_timer,
                                                  (void *)((uintptr_t)s + i));
         }
index 3321fde916863615db10fe546dab82a083e18932..0e425cfc0840a08ac4c44b507ee5b92f227e4725 100644 (file)
@@ -114,7 +114,8 @@ DEF_HELPER_FLAGS_2(tbis, TCG_CALL_NO_RWG, void, env, i64)
 
 DEF_HELPER_1(halt, void, i64);
 
-DEF_HELPER_FLAGS_0(get_time, TCG_CALL_NO_RWG, i64)
+DEF_HELPER_FLAGS_0(get_vmtime, TCG_CALL_NO_RWG, i64)
+DEF_HELPER_FLAGS_0(get_walltime, TCG_CALL_NO_RWG, i64)
 DEF_HELPER_FLAGS_2(set_alarm, TCG_CALL_NO_RWG, void, env, i64)
 #endif
 
index 339501af90fc80b64a117e36fff8470c96a7da09..bd94597d363dfffce314c71fd27fd90a5fc49f04 100644 (file)
@@ -70,7 +70,12 @@ void helper_halt(uint64_t restart)
     }
 }
 
-uint64_t helper_get_time(void)
+uint64_t helper_get_vmtime(void)
+{
+    return qemu_get_clock_ns(vm_clock);
+}
+
+uint64_t helper_get_walltime(void)
 {
     return qemu_get_clock_ns(rtc_clock);
 }
index dd7f0fbf9420add1bc9cc34e4873a8678753bbbd..5558b728dd104dd8ad4ffa1b876c332e87b1b39d 100644 (file)
@@ -1634,15 +1634,19 @@ static ExitStatus gen_mfpr(int ra, int regno)
         return NO_EXIT;
     }
 
-    if (regno == 250) {
-        /* WALL_TIME */
+    /* Special help for VMTIME and WALLTIME.  */
+    if (regno == 250 || regno == 249) {
+       void (*helper)(TCGv) = gen_helper_get_walltime;
+       if (regno == 249) {
+               helper = gen_helper_get_vmtime;
+       }
         if (use_icount) {
             gen_io_start();
-            gen_helper_get_time(cpu_ir[ra]);
+            helper(cpu_ir[ra]);
             gen_io_end();
             return EXIT_PC_STALE;
         } else {
-            gen_helper_get_time(cpu_ir[ra]);
+            helper(cpu_ir[ra]);
             return NO_EXIT;
         }
     }