[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 4/5] Add migration support for KVM guest with MTE
From: |
Richard Henderson |
Subject: |
Re: [RFC PATCH 4/5] Add migration support for KVM guest with MTE |
Date: |
Tue, 16 Feb 2021 07:31:27 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
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~
- [RFC PATCH 0/5] target/arm: Add MTE support to KVM guest, Haibo Xu, 2021/02/07
- [RFC PATCH 3/5] Add APIs to get/set MTE tags, Haibo Xu, 2021/02/07
- [RFC PATCH 5/5] Enable the MTE support for KVM guest, Haibo Xu, 2021/02/07
- [RFC PATCH 1/5] Update Linux headers with new MTE support, Haibo Xu, 2021/02/07
- [RFC PATCH 2/5] Add basic MTE support to KVM guest, Haibo Xu, 2021/02/07
- Re: [RFC PATCH 0/5] target/arm: Add MTE support to KVM guest, Peter Maydell, 2021/02/16