From: Juan Quintela <quintela@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org, kvm@vger.kernel.org,
"Eric Auger" <eauger@redhat.com>, "Gavin Shan" <gshan@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Andrea Bolognani" <abologna@redhat.com>
Subject: Re: [PATCH v7 1/1] arm/kvm: add support for MTE
Date: Tue, 02 May 2023 12:17:17 +0200 [thread overview]
Message-ID: <871qjzujf6.fsf@secure.mitica> (raw)
In-Reply-To: <871qjzcdgi.fsf@redhat.com> (Cornelia Huck's message of "Tue, 02 May 2023 11:03:25 +0200")
Cornelia Huck <cohuck@redhat.com> wrote:
> On Mon, May 01 2023, Richard Henderson <richard.henderson@linaro.org> wrote:
>
>> On 4/28/23 18:50, Juan Quintela wrote:
>>> Pardon my ignorance here, but to try to help with migration. How is
>>> this mte tag stored?
>>> - 1 array of 8bits per page of memory
>>> - 1 array of 64bits per page of memory
>>> - whatever
>>>
>>> Lets asume that it is 1 byte per page. For the explanation it don't
>>> matter, only matters that it is an array of things that are one for each
>>> page.
>>
>> Not that it matters, as you say, but for concreteness, 1 4-bit tag per 16 bytes, packed,
>> so 128 bytes per 4k page.
>>
>>> So my suggestion is just to send another array:
>>>
>>> - 1 array of page addresses
>>> - 1 array of page tags that correspond to the previous one
>>> - 1 array of pages that correspond to the previous addresses
>>>
>>> You put compatiblity marks here and there checking that you are using
>>> mte (and the same version) in both sides and you call that a day.
>>
>> Sounds reasonable.
>
> Yes, something like that sounds reasonable as an interface.
Ok.
>>> Notice that this requires the series (still not upstream but already on
>>> the list) that move the zero page detection to the multifd thread,
>>> because I am assuming that zero pages also have tags (yes, it was not a
>>> very impressive guess).
>>
>> Correct. "Proper" zero detection would include checking the tags as well.
>> Zero tags are what you get from the kernel on a new allocation.
That was a different thing.
On precopy, we handle zero page one way and non_zero page other way.
On upstream multifd, we detect and send zero page on the migration
thread, and everything else on the migration threads.
With my patches (on list) it send both zero and non-zero pages through
multifd. My proposal will be that we send the 128bytes/page for every
page, included zero pages. Here I mean zero page a page that is full of
zeros, independently of the tag.
>> A page can be dirtied by changing nothing but a tag.
I hope/expect that the dirty bitmap reflects that.
>> So we cannot of course send tags "early", they must come with the data.
>> I'm not 100% sure I understood your question here.
>
> Last time MTE migration came up, we thought that we would need to go
> with an uffd extension (page + extra data) to handle the postcopy case
> properly (i.e. use some kind of array for precopy, and that interface
> extension for postcopy.) TBH, I'm not sure if multifd makes any
> difference here.
uffd is a completely different beast, and I agree with you. I was
meaning here the precopy/multifd case.
>>> Another question, if you are using MTE, all pages have MTE, right?
>>> Or there are other exceptions?
>>
>> No such systems are built yet, so we won't know what corner cases the host system will
>> have to cope with, but I believe as written so far all pages must have tags when MTE is
>> enabled by KVM.
>
> Has anyone been able to access a real system with MTE? (All the systems
> where I had hoped that MTE would be available didn't have MTE in the end
> so far, so I'd be interested to hear if anybody else already got to play
> with one.) Honestly, I don't want to even try to test migration if I only
> have access to MTE on the FVP...
So here we are.
I have seen the future. And it is very blurred. O:-)
Later, Juan.
next prev parent reply other threads:[~2023-05-02 10:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 9:55 [PATCH v7 0/1] arm: enable MTE for QEMU + kvm Cornelia Huck
2023-04-28 9:55 ` [PATCH v7 1/1] arm/kvm: add support for MTE Cornelia Huck
2023-04-28 17:50 ` Juan Quintela
2023-05-01 9:37 ` Richard Henderson
2023-05-02 9:03 ` Cornelia Huck
2023-05-02 10:17 ` Juan Quintela [this message]
2023-05-02 10:58 ` Richard Henderson
2023-05-04 15:01 ` Cornelia Huck
2023-05-05 15:14 ` Richard Henderson
2023-05-16 13:48 ` Peter Maydell
2023-05-16 20:31 ` Richard Henderson
2023-05-18 10:09 ` [PATCH v7 0/1] arm: enable MTE for QEMU + kvm Peter Maydell
2023-05-22 12:04 ` Cornelia Huck
2023-05-29 10:15 ` Andrea Bolognani
2023-05-29 10:27 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871qjzujf6.fsf@secure.mitica \
--to=quintela@redhat.com \
--cc=abologna@redhat.com \
--cc=cohuck@redhat.com \
--cc=eauger@redhat.com \
--cc=gshan@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).