qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

vhost+postcopy: Call wakeups

Cause the vhost-user client to be woken up whenever:
a) We place a page in postcopy mode
b) We get a fault and the page has already been received

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Dr. David Alan Gilbert and committed by
Michael S. Tsirkin
dedfb4b2 c07e3615

+11 -4
+10 -4
migration/postcopy-ram.c
··· 558 558 559 559 trace_postcopy_request_shared_page(pcfd->idstr, qemu_ram_get_idstr(rb), 560 560 rb_offset); 561 - /* TODO: Check bitmap to see if we already have the page */ 561 + if (ramblock_recv_bitmap_test_byte_offset(rb, aligned_rbo)) { 562 + trace_postcopy_request_shared_page_present(pcfd->idstr, 563 + qemu_ram_get_idstr(rb), rb_offset); 564 + return postcopy_wake_shared(pcfd, client_addr, rb); 565 + } 562 566 if (rb != mis->last_rb) { 563 567 mis->last_rb = rb; 564 568 migrate_send_rp_req_pages(mis, qemu_ram_get_idstr(rb), ··· 866 870 } 867 871 868 872 trace_postcopy_place_page(host); 869 - return 0; 873 + return postcopy_notify_shared_wake(rb, 874 + qemu_ram_block_host_offset(rb, host)); 870 875 } 871 876 872 877 /* ··· 890 895 891 896 return -e; 892 897 } 898 + return postcopy_notify_shared_wake(rb, 899 + qemu_ram_block_host_offset(rb, 900 + host)); 893 901 } else { 894 902 /* The kernel can't use UFFDIO_ZEROPAGE for hugepages */ 895 903 if (!mis->postcopy_tmp_zero_page) { ··· 909 917 return postcopy_place_page(mis, host, mis->postcopy_tmp_zero_page, 910 918 rb); 911 919 } 912 - 913 - return 0; 914 920 } 915 921 916 922 /*
+1
migration/trace-events
··· 199 199 postcopy_ram_incoming_cleanup_exit(void) "" 200 200 postcopy_ram_incoming_cleanup_join(void) "" 201 201 postcopy_request_shared_page(const char *sharer, const char *rb, uint64_t rb_offset) "for %s in %s offset 0x%"PRIx64 202 + postcopy_request_shared_page_present(const char *sharer, const char *rb, uint64_t rb_offset) "%s already %s offset 0x%"PRIx64 202 203 postcopy_wake_shared(uint64_t client_addr, const char *rb) "at 0x%"PRIx64" in %s" 203 204 204 205 save_xbzrle_page_skipping(void) ""