vtimer: Drop vtimer virtual timer adjust
This patch drops the vtimer virtual timer adjust, cross version migration from openEuler qemu-4.0.1 to qemu-4.1.0 is not supported as a consequence. By default openEuler qemu-4.1.0 use kvm_adjvtime as the virtual timer. Signed-off-by: Ying Fang <fangying1@huawei.com>
This commit is contained in:
parent
3b892a3933
commit
6f41ba9021
@ -172,6 +172,7 @@ Patch0159: Revert-vtimer-compat-cross-version-migration-from-v4.patch
|
||||
Patch0160: ARM64-record-vtimer-tick-when-cpu-is-stopped.patch
|
||||
Patch0161: hw-arm-virt-add-missing-compat-for-kvm-no-adjvtime.patch
|
||||
Patch0162: migration-Compat-virtual-timer-adjust-for-v4.0.1-and.patch
|
||||
Patch0163: vtimer-Drop-vtimer-virtual-timer-adjust.patch
|
||||
|
||||
BuildRequires: flex
|
||||
BuildRequires: bison
|
||||
@ -522,6 +523,7 @@ getent passwd qemu >/dev/null || \
|
||||
- ARM64: record vtimer tick when cpu is stopped
|
||||
- hw/arm/virt: add missing compat for kvm-no-adjvtime
|
||||
- migration: Compat virtual timer adjust for v4.0.1 and v4.1.0
|
||||
- vtimer: Drop vtimer virtual timer adjust
|
||||
|
||||
* Fri May 22 2020 Huawei Technologies Co., Ltd. <fangying1@huawei.com>
|
||||
- ip_reass: Fix use after free
|
||||
|
||||
144
vtimer-Drop-vtimer-virtual-timer-adjust.patch
Normal file
144
vtimer-Drop-vtimer-virtual-timer-adjust.patch
Normal file
@ -0,0 +1,144 @@
|
||||
From b1782119bcfac96d8a541d8d60ee00f954d721db Mon Sep 17 00:00:00 2001
|
||||
From: Ying Fang <fangying1@huawei.com>
|
||||
Date: Wed, 27 May 2020 17:48:54 +0800
|
||||
Subject: [PATCH] vtimer: Drop vtimer virtual timer adjust
|
||||
|
||||
This patch drops the vtimer virtual timer adjust, cross version migration
|
||||
from openEuler qemu-4.0.1 to qemu-4.1.0 is not supported as a consequence.
|
||||
|
||||
By default openEuler qemu-4.1.0 use kvm_adjvtime as the virtual timer.
|
||||
|
||||
Signed-off-by: Ying Fang <fangying1@huawei.com>
|
||||
|
||||
diff --git a/cpus.c b/cpus.c
|
||||
index 6a28bdef..927a00aa 100644
|
||||
--- a/cpus.c
|
||||
+++ b/cpus.c
|
||||
@@ -1066,34 +1066,6 @@ void cpu_synchronize_all_pre_loadvm(void)
|
||||
}
|
||||
}
|
||||
|
||||
-#ifdef __aarch64__
|
||||
-static bool kvm_adjvtime_enabled(CPUState *cs)
|
||||
-{
|
||||
- ARMCPU *cpu = ARM_CPU(cs);
|
||||
- return cpu->kvm_adjvtime == true;
|
||||
-}
|
||||
-
|
||||
-static void get_vcpu_timer_tick(CPUState *cs)
|
||||
-{
|
||||
- CPUARMState *env = &ARM_CPU(cs)->env;
|
||||
- int err;
|
||||
- struct kvm_one_reg reg;
|
||||
- uint64_t timer_tick;
|
||||
-
|
||||
- reg.id = KVM_REG_ARM_TIMER_CNT;
|
||||
- reg.addr = (uintptr_t) &timer_tick;
|
||||
-
|
||||
- err = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®);
|
||||
- if (err < 0) {
|
||||
- error_report("get vcpu tick failed, ret = %d", err);
|
||||
- env->vtimer = 0;
|
||||
- return;
|
||||
- }
|
||||
- env->vtimer = timer_tick;
|
||||
- return;
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
static int do_vm_stop(RunState state, bool send_stop)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -1101,17 +1073,6 @@ static int do_vm_stop(RunState state, bool send_stop)
|
||||
if (runstate_is_running()) {
|
||||
cpu_disable_ticks();
|
||||
pause_all_vcpus();
|
||||
-#ifdef __aarch64__
|
||||
- /* vtimer adjust is used in openEuler qemu-4.0.1, however kvm_adjvtime
|
||||
- * is introduced in openEuler qemu-4.1.0. To maintain the compatibility
|
||||
- * and enable cross version migration, let's enable vtimer adjust only
|
||||
- * if kvm_adjvtime is not enabled, otherwise there may be conflicts
|
||||
- * between vtimer adjust and kvm_adjvtime.
|
||||
- */
|
||||
- if (first_cpu && !kvm_adjvtime_enabled(first_cpu)) {
|
||||
- get_vcpu_timer_tick(first_cpu);
|
||||
- }
|
||||
-#endif
|
||||
runstate_set(state);
|
||||
vm_state_notify(0, state);
|
||||
if (send_stop) {
|
||||
@@ -1957,46 +1918,11 @@ void cpu_resume(CPUState *cpu)
|
||||
qemu_cpu_kick(cpu);
|
||||
}
|
||||
|
||||
-#ifdef __aarch64__
|
||||
-
|
||||
-static void set_vcpu_timer_tick(CPUState *cs)
|
||||
-{
|
||||
- CPUARMState *env = &ARM_CPU(cs)->env;
|
||||
-
|
||||
- if (env->vtimer == 0) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- int err;
|
||||
- struct kvm_one_reg reg;
|
||||
- uint64_t timer_tick = env->vtimer;
|
||||
- env->vtimer = 0;
|
||||
-
|
||||
- reg.id = KVM_REG_ARM_TIMER_CNT;
|
||||
- reg.addr = (uintptr_t) &timer_tick;
|
||||
-
|
||||
- err = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®);
|
||||
- if (err < 0) {
|
||||
- error_report("Set vcpu tick failed, ret = %d", err);
|
||||
- return;
|
||||
- }
|
||||
- return;
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
void resume_all_vcpus(void)
|
||||
{
|
||||
CPUState *cpu;
|
||||
|
||||
qemu_clock_enable(QEMU_CLOCK_VIRTUAL, true);
|
||||
-#ifdef __aarch64__
|
||||
- /* Enable vtimer adjust only if kvm_adjvtime is not enabled, otherwise
|
||||
- * there may be conflicts between vtimer adjust and kvm_adjvtime.
|
||||
- */
|
||||
- if (first_cpu && !kvm_adjvtime_enabled(first_cpu)) {
|
||||
- set_vcpu_timer_tick(first_cpu);
|
||||
- }
|
||||
-#endif
|
||||
CPU_FOREACH(cpu) {
|
||||
cpu_resume(cpu);
|
||||
}
|
||||
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
|
||||
index aec6a214..86eb79cd 100644
|
||||
--- a/target/arm/cpu.h
|
||||
+++ b/target/arm/cpu.h
|
||||
@@ -262,8 +262,6 @@ typedef struct CPUARMState {
|
||||
uint64_t sp_el[4]; /* AArch64 banked stack pointers */
|
||||
|
||||
|
||||
- uint64_t vtimer; /* Timer tick when vcpu stop */
|
||||
-
|
||||
/* System control coprocessor (cp15) */
|
||||
struct {
|
||||
uint32_t c0_cpuid;
|
||||
diff --git a/target/arm/machine.c b/target/arm/machine.c
|
||||
index ec28b839..ee3c59a6 100644
|
||||
--- a/target/arm/machine.c
|
||||
+++ b/target/arm/machine.c
|
||||
@@ -814,7 +814,6 @@ const VMStateDescription vmstate_arm_cpu = {
|
||||
VMSTATE_UINT32(env.exception.syndrome, ARMCPU),
|
||||
VMSTATE_UINT32(env.exception.fsr, ARMCPU),
|
||||
VMSTATE_UINT64(env.exception.vaddress, ARMCPU),
|
||||
- VMSTATE_UINT64(env.vtimer, ARMCPU),
|
||||
VMSTATE_TIMER_PTR(gt_timer[GTIMER_PHYS], ARMCPU),
|
||||
VMSTATE_TIMER_PTR(gt_timer[GTIMER_VIRT], ARMCPU),
|
||||
{
|
||||
--
|
||||
2.23.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user