On 2/7/21 7:20 PM, Haibo Xu wrote: > + if (kvm_physical_memory_addr_from_host(kvm_state, addr, &ipa)) { > + /* Buffer for the page tags(one byte per tag) */ > + tag_buf = g_try_malloc0(size); > + if (!tag_buf) { > + error_report("%s: Error allocating MTE tag_buf", __func__); > + return 0; > + } > + > + if (kvm_arm_mte_get_tags(ipa, TARGET_PAGE_SIZE, tag_buf) < 0) { > + error_report("%s: Can't get MTE tags from guest", __func__); > + g_free(tag_buf); > + return 0; > + } > + > + qemu_put_buffer(f, tag_buf, size); > + > + g_free(tag_buf); > + > + return size; > + }
So, in patch 2 you disabled the allocation of tag-memory. Now you're allocating new memory (admittedly quite a small amount -- 1/16th of a page, small enough to just be a local variable). Why don't you allocate tag-memory, copy the data into it, and then let migration proceed as normal. Then you don't have to have a random data block that happens to follow each ram page. I'm concerned that what you're doing here makes it impossible to migrate between kvm and tcg. r~