qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] f9d8f6: cpu: initialize cpu->exception_index


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] f9d8f6: cpu: initialize cpu->exception_index on reset
Date: Sat, 20 Dec 2014 13:30:06 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: f9d8f6673591f30028e281e8ff6d5790adc2de83
      
https://github.com/qemu/qemu/commit/f9d8f6673591f30028e281e8ff6d5790adc2de83
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-12-20 (Sat, 20 Dec 2014)

  Changed paths:
    M cpus.c
    M qom/cpu.c

  Log Message:
  -----------
  cpu: initialize cpu->exception_index on reset

This unbreaks linux-user (broken by e511b4d, cpu-exec: reset exception_index
correctly, 2014-11-26).

Reported-by: Eduardo Habkost <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Tested-by: Laurent Desnogues <address@hidden>
Tested-by: Eduardo Habkost <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>


  Commit: adee64249ee37e822d578e65a765750e7f2081f6
      
https://github.com/qemu/qemu/commit/adee64249ee37e822d578e65a765750e7f2081f6
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-12-20 (Sat, 20 Dec 2014)

  Changed paths:
    M exec.c

  Log Message:
  -----------
  exec: change default exception_index value for migration to -1

In QEMU 2.2 the exception_index value was added to the migration stream
through a subsection.  The default was set to 0, which is wrong and
should have been -1.

However, 2.2 does not have commit e511b4d (cpu-exec: reset exception_index
correctly, 2014-11-26), hence in 2.2 the exception_index is never used
and is set to -1 on the next call to cpu_exec.  So we can change the
migration stream to make the default -1.  The effects are:

- 2.2.1 -> 2.2.0: cpu->exception_index set incorrectly to 0 if it
were -1 on the source; then reset to -1 in cpu_exec.  This is TCG
only; KVM does not use exception_index.

- 2.2.0 -> 2.2.1: cpu->exception_index set incorrectly to -1 if it
were 0 on the source; but it would be reset to -1 in cpu_exec anyway.
This is TCG only; KVM does not use exception_index.

- 2.2.1 -> 2.1: two bugs fixed: 1) can migrate backwards if
cpu->exception_index is set to -1; 2) should not migrate backwards
(but 2.2.0 allows it) if cpu->exception_index is set to 0

- 2.2.0 -> 2.3.0: 2.2.0 will send the subsection unnecessarily if
exception_index is -1, but that is not a problem.  2.3.0 will set
cpu->exception_index to -1 if it is 0 on the source, but this would
be anyway a problem for 2.2.0 -> 2.2.x migration (due to lack of
commit e511b4d in 2.2.x) so we can ignore it

- 2.2.1 -> 2.3.0: everything works.

In addition, play it safe and never send the subsection unless TCG
is in use.  KVM does not use exception_index (PPC KVM stores values
in it for use in the subsequent call to ppc_cpu_do_interrupt, but
does not need it as soon as kvm_handle_debug returns).  Xen and
qtest do not run any code for the CPU at all.

Reported-by: Igor Mammedov <address@hidden>
Tested-by: Laurent Desnogues <address@hidden>
Tested-by: Eduardo Habkost <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/b574f602680d...adee64249ee3

reply via email to

[Prev in Thread] Current Thread [Next in Thread]