One of the two pending migration fix, and a small KVM patch.

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTzkG6AAoJEBvWZb6bTYbySkYP/R9ku5J4sqO1WokbjGwy8eH6
 y/oFnrhMnbBaGZ/vIQB8DvDQygPJUPHGnHl6oMH8q9yfBChCb7+j0GoBU+PSMC8p
 FgqMTGdJ/m3FDlEcsLnDuJYqcKiI3Ip+U+oTCl1m4AtVCogBkgARF6R6n+H0n5W7
 rQclDK/VKHOB1z9eePCNtr64NipEJlpzeGmyXLB/su6jlzTESlxC6G4Xns3ARVkb
 +t7s/hjqP4LK0imhlGlLCjnjoMb+HsVO4O4A08L/alKVFPpyxptYYuWVQzu/PX8J
 P8kEQSDeK+F8mRkwhrioeRrhKGFv06KWwTFAxgb+Mpo2avUlft/yfTuzoeQl/Ozx
 VFLrpjxThB+PE3Sq/kK1euHPB+alnibQLtKjNrC5jbTwzGPZwxRLo/N2yjGSfO77
 xeOGwMRSzZuhbhIRcYug2JRmpVVrhdyMIoG5SsbDnKj7JUsGwb9AN1GG7Pd+g2B5
 CfJlkCZ3fLekmq2BUDXLHGysXabZgkZb9uEplCKe8XBSW3tktmcfcPsEaKGtfz9S
 /mgriwu+vLoc3iIvsyPuE2uHJFpb+0J7NbJIjt97b6WyxcCyXlZ/fN22yf43q0M7
 iDmd+fOBYkG7yEQ5g3PEGWB6jFbIt2LGV9n+pFZ2xBqgTHDDsnsfnsuNkXwbXLly
 H/K9mI5RbPbajTrlXA6G
 =5T9q
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

One of the two pending migration fix, and a small KVM patch.

# gpg: Signature made Tue 22 Jul 2014 11:49:30 BST using RSA key ID 9B4D86F2
# gpg: Can't check signature: public key not found

* remotes/bonzini/tags/for-upstream:
  kvm-all: Use 'tmpcpu' instead of 'cpu' in sub-looping to avoid 'cpu' be NULL
  exec: fix migration with devices that use address_space_rw

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2014-07-22 12:03:44 +01:00
commit 25af8e6b61
3 changed files with 18 additions and 18 deletions

20
exec.c
View file

@ -1568,8 +1568,7 @@ static void notdirty_mem_write(void *opaque, hwaddr ram_addr,
default:
abort();
}
cpu_physical_memory_set_dirty_flag(ram_addr, DIRTY_MEMORY_MIGRATION);
cpu_physical_memory_set_dirty_flag(ram_addr, DIRTY_MEMORY_VGA);
cpu_physical_memory_set_dirty_range_nocode(ram_addr, size);
/* we remove the notdirty callback only if the code has been
flushed */
if (!cpu_physical_memory_is_clean(ram_addr)) {
@ -1978,8 +1977,7 @@ static void invalidate_and_set_dirty(hwaddr addr,
/* invalidate code */
tb_invalidate_phys_page_range(addr, addr + length, 0);
/* set dirty bit */
cpu_physical_memory_set_dirty_flag(addr, DIRTY_MEMORY_VGA);
cpu_physical_memory_set_dirty_flag(addr, DIRTY_MEMORY_MIGRATION);
cpu_physical_memory_set_dirty_range_nocode(addr, length);
}
xen_modified_memory(addr, length);
}
@ -2335,15 +2333,7 @@ void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
mr = qemu_ram_addr_from_host(buffer, &addr1);
assert(mr != NULL);
if (is_write) {
while (access_len) {
unsigned l;
l = TARGET_PAGE_SIZE;
if (l > access_len)
l = access_len;
invalidate_and_set_dirty(addr1, l);
addr1 += l;
access_len -= l;
}
invalidate_and_set_dirty(addr1, access_len);
}
if (xen_enabled()) {
xen_invalidate_map_cache_entry(buffer);
@ -2581,9 +2571,7 @@ void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val)
/* invalidate code */
tb_invalidate_phys_page_range(addr1, addr1 + 4, 0);
/* set dirty bit */
cpu_physical_memory_set_dirty_flag(addr1,
DIRTY_MEMORY_MIGRATION);
cpu_physical_memory_set_dirty_flag(addr1, DIRTY_MEMORY_VGA);
cpu_physical_memory_set_dirty_range_nocode(addr1, 4);
}
}
}

View file

@ -71,6 +71,17 @@ static inline void cpu_physical_memory_set_dirty_flag(ram_addr_t addr,
set_bit(addr >> TARGET_PAGE_BITS, ram_list.dirty_memory[client]);
}
static inline void cpu_physical_memory_set_dirty_range_nocode(ram_addr_t start,
ram_addr_t length)
{
unsigned long end, page;
end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS;
page = start >> TARGET_PAGE_BITS;
bitmap_set(ram_list.dirty_memory[DIRTY_MEMORY_MIGRATION], page, end - page);
bitmap_set(ram_list.dirty_memory[DIRTY_MEMORY_VGA], page, end - page);
}
static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start,
ram_addr_t length)
{

View file

@ -2077,12 +2077,13 @@ void kvm_remove_all_breakpoints(CPUState *cpu)
{
struct kvm_sw_breakpoint *bp, *next;
KVMState *s = cpu->kvm_state;
CPUState *tmpcpu;
QTAILQ_FOREACH_SAFE(bp, &s->kvm_sw_breakpoints, entry, next) {
if (kvm_arch_remove_sw_breakpoint(cpu, bp) != 0) {
/* Try harder to find a CPU that currently sees the breakpoint. */
CPU_FOREACH(cpu) {
if (kvm_arch_remove_sw_breakpoint(cpu, bp) == 0) {
CPU_FOREACH(tmpcpu) {
if (kvm_arch_remove_sw_breakpoint(tmpcpu, bp) == 0) {
break;
}
}