Skip to contentSkip to conversation

target-i386: remove cpu reset callback

PATCH In review liguang 2 participants 5 messages Apr 10, 2013

lore
Share & tools
lore

liguang

author
#0 lore raw

PATCH 1/2 target-i386: remove cpu reset callback

we should remove it now, if not, cpu reset
will do 2 times.

---
 target-i386/cpu.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
target-i386/cpu.c +0 -9
index 356378c..6e13053 100644
@@ -2024,13 +2024,6 @@ bool cpu_is_bsp(X86CPU *cpu)
 {
     return cpu_get_apic_base(cpu->env.apic_state) & MSR_IA32_APICBASE_BSP;
 }
-
-/* TODO: remove me, when reset over QOM tree is implemented */
-static void x86_cpu_machine_reset_cb(void *opaque)
-{
-    X86CPU *cpu = opaque;
-    cpu_reset(CPU(cpu));
-}
 #endif
 
 static void mce_init(X86CPU *cpu)
@@ -2140,8 +2133,6 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
     }
 
 #ifndef CONFIG_USER_ONLY
-    qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
-
     if (cpu->env.cpuid_features & CPUID_APIC || smp_cpus > 1) {
         x86_cpu_apic_init(cpu, &local_err);
         if (local_err != NULL) {
Signature · 1 line
1.7.2.5
author
#1 lore raw

PATCH 2/2 target-i386: fix 2 malformed indents

---
 target-i386/cpu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
target-i386/cpu.c +2 -2
index 6e13053..9806a60 100644
@@ -2108,7 +2108,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
         env->cpuid_vendor3 == CPUID_VENDOR_AMD_3) {
         env->cpuid_ext2_features &= ~CPUID_EXT2_AMD_ALIASES;
         env->cpuid_ext2_features |= (env->cpuid_features
-           & CPUID_EXT2_AMD_ALIASES);
+                                     & CPUID_EXT2_AMD_ALIASES);
     }
 
     if (!kvm_enabled()) {
@@ -2116,7 +2116,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
         env->cpuid_ext_features &= TCG_EXT_FEATURES;
         env->cpuid_ext2_features &= (TCG_EXT2_FEATURES
 #ifdef TARGET_X86_64
-            | CPUID_EXT2_SYSCALL | CPUID_EXT2_LM
+                                     | CPUID_EXT2_SYSCALL | CPUID_EXT2_LM
 #endif
             );
         env->cpuid_ext3_features &= TCG_EXT3_FEATURES;
Signature · 1 line
1.7.2.5
#2 lore raw
In reply to liguang
Quoted 2 lines · On Wed, 10 Apr 2013 16:02:28 +0800 liguang <[email protected]> wrote:

we should remove it now, if not, cpu reset
will do 2 times.

Currently CPU is bus-less device so there isn't anything to reset it during reboot except callback.
This patch will break reboot path, just try guest reboot from inside guest.

Quoted 32 lines
---
 target-i386/cpu.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
target-i386/cpu.c +0 -9
index 356378c..6e13053 100644
@@ -2024,13 +2024,6 @@ bool cpu_is_bsp(X86CPU *cpu)
 {
     return cpu_get_apic_base(cpu->env.apic_state) & MSR_IA32_APICBASE_BSP;
 }
-
-/* TODO: remove me, when reset over QOM tree is implemented */
-static void x86_cpu_machine_reset_cb(void *opaque)
-{
-    X86CPU *cpu = opaque;
-    cpu_reset(CPU(cpu));
-}
 #endif
 
 static void mce_init(X86CPU *cpu)
@@ -2140,8 +2133,6 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
 **errp) }
 
 #ifndef CONFIG_USER_ONLY
-    qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
-
     if (cpu->env.cpuid_features & CPUID_APIC || smp_cpus > 1) {
         x86_cpu_apic_init(cpu, &local_err);
         if (local_err != NULL) {
author
#3 lore raw
Quoted 8 lines · 在 2013-04-10三的 10:34 +0200,Igor Mammedov写道:
Quoted 2 lines · On Wed, 10 Apr 2013 16:02:28 +0800 liguang <[email protected]> wrote:

we should remove it now, if not, cpu reset
will do 2 times.

Currently CPU is bus-less device so there isn't anything to reset it during reboot except callback.
This patch will break reboot path, just try guest reboot from inside guest.

Yes, thanks!
and, should we care as I found
cpu reset will do more than 1 times
during boot?

Quoted 35 lines
Quoted 34 lines
---
 target-i386/cpu.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
target-i386/cpu.c +0 -9
index 356378c..6e13053 100644
@@ -2024,13 +2024,6 @@ bool cpu_is_bsp(X86CPU *cpu)
 {
     return cpu_get_apic_base(cpu->env.apic_state) & MSR_IA32_APICBASE_BSP;
 }
-
-/* TODO: remove me, when reset over QOM tree is implemented */
-static void x86_cpu_machine_reset_cb(void *opaque)
-{
-    X86CPU *cpu = opaque;
-    cpu_reset(CPU(cpu));
-}
 #endif
 
 static void mce_init(X86CPU *cpu)
@@ -2140,8 +2133,6 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
 **errp) }
 
 #ifndef CONFIG_USER_ONLY
-    qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
-
     if (cpu->env.cpuid_features & CPUID_APIC || smp_cpus > 1) {
         x86_cpu_apic_init(cpu, &local_err);
         if (local_err != NULL) {
#4 lore raw
Quoted 11 lines · On Wed, 10 Apr 2013 16:52:01 +0800 li guang <[email protected]> wrote:
Quoted 9 lines · 在 2013-04-10三的 10:34 +0200,Igor Mammedov写道:
Quoted 2 lines · On Wed, 10 Apr 2013 16:02:28 +0800 liguang <[email protected]> wrote:

we should remove it now, if not, cpu reset
will do 2 times.

Currently CPU is bus-less device so there isn't anything to reset it during reboot except callback.
This patch will break reboot path, just try guest reboot from inside guest.

Quoted 4 lines

Yes, thanks!
and, should we care as I found
cpu reset will do more than 1 times
during boot?

reset in realize() is fro the sake of hot-plug and it doesn't hurt. Removing callback could be considered once CPU is attached to ICC bus, but I haven't looked in that direction yet.

Quoted 37 lines
Quoted 35 lines
Quoted 34 lines
---
 target-i386/cpu.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
target-i386/cpu.c +0 -9
index 356378c..6e13053 100644
@@ -2024,13 +2024,6 @@ bool cpu_is_bsp(X86CPU *cpu)
 {
     return cpu_get_apic_base(cpu->env.apic_state) &
 MSR_IA32_APICBASE_BSP; }
-
-/* TODO: remove me, when reset over QOM tree is implemented */
-static void x86_cpu_machine_reset_cb(void *opaque)
-{
-    X86CPU *cpu = opaque;
-    cpu_reset(CPU(cpu));
-}
 #endif
 
 static void mce_init(X86CPU *cpu)
@@ -2140,8 +2133,6 @@ static void x86_cpu_realizefn(DeviceState *dev,
 Error **errp) }
 
 #ifndef CONFIG_USER_ONLY
-    qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
-
     if (cpu->env.cpuid_features & CPUID_APIC || smp_cpus > 1) {
         x86_cpu_apic_init(cpu, &local_err);
         if (local_err != NULL) {