From: Cornelia Huck <cohuck@redhat.com>
To: Andrea Bolognani <abologna@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org, kvm@vger.kernel.org,
"Eric Auger" <eauger@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Gavin Shan" <gshan@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>
Subject: Re: [PATCH v6 1/2] arm/kvm: add support for MTE
Date: Wed, 01 Mar 2023 11:17:40 +0100 [thread overview]
Message-ID: <874jr4dbcr.fsf@redhat.com> (raw)
In-Reply-To: <CABJz62OHjrq_V1QD4g4azzLm812EJapPEja81optr8o7jpnaHQ@mail.gmail.com>
On Tue, Feb 28 2023, Andrea Bolognani <abologna@redhat.com> wrote:
> On Tue, Feb 28, 2023 at 04:02:15PM +0100, Cornelia Huck wrote:
>> Introduce a new cpu feature flag to control MTE support. To preserve
>> backwards compatibility for tcg, MTE will continue to be enabled as
>> long as tag memory has been provided.
>>
>> If MTE has been enabled, we need to disable migration, as we do not
>> yet have a way to migrate the tags as well. Therefore, MTE will stay
>> off with KVM unless requested explicitly.
>>
>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>> ---
>> docs/system/arm/cpu-features.rst | 21 ++++++
>> hw/arm/virt.c | 2 +-
>> target/arm/cpu.c | 18 ++---
>> target/arm/cpu.h | 1 +
>> target/arm/cpu64.c | 110 +++++++++++++++++++++++++++++++
>> target/arm/internals.h | 1 +
>> target/arm/kvm.c | 29 ++++++++
>> target/arm/kvm64.c | 5 ++
>> target/arm/kvm_arm.h | 19 ++++++
>> target/arm/monitor.c | 1 +
>> 10 files changed, 194 insertions(+), 13 deletions(-)
>
> I've given a quick look with libvirt integration in mind, and
> everything seem fine.
>
> Specifically, MTE is advertised in the output of qom-list-properties
> both for max-arm-cpu and the latest virt-X.Y-machine, which means
> that libvirt can easily and reliably figure out whether MTE support
> is available.
Great, thanks for having a look!
>
>> +MTE CPU Property
>> +================
>> +
>> +The ``mte`` property controls the Memory Tagging Extension. For TCG, it requires
>> +presence of tag memory (which can be turned on for the ``virt`` machine via
>> +``mte=on``). For KVM, it requires the ``KVM_CAP_ARM_MTE`` capability; until
>> +proper migration support is implemented, enabling MTE will install a migration
>> +blocker.
>
> Is it okay to use -machine virt,mte=on unconditionally for both KVM
> and TCG guests when MTE support is requested, or will that not work
> for the former?
QEMU will error out if you try this with KVM (basically, same behaviour
as before.) Is that a problem for libvirt, or merely a bit inconvinient?
>
>> +If not specified explicitly via ``on`` or ``off``, MTE will be available
>> +according to the following rules:
>> +
>> +* When TCG is used, MTE will be available if and only if tag memory is available;
>> + i.e. it preserves the behaviour prior to the introduction of the feature.
>> +
>> +* When KVM is used, MTE will default to off, so that migration will not
>> + unintentionally be blocked. This might change in a future QEMU version.
>
> If and when this changes, we should ensure that the new default
> behavior doesn't affect existing machine types, otherwise we will
> break guest ABI for existing VMs.
Nod, such a change would need proper compat handling. It's not quite
clear yet if we'll ever flip it, though.
next prev parent reply other threads:[~2023-03-01 10:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-28 15:02 [PATCH v6 0/2] arm: enable MTE for QEMU + kvm Cornelia Huck
2023-02-28 15:02 ` [PATCH v6 1/2] arm/kvm: add support for MTE Cornelia Huck
2023-02-28 17:34 ` Andrea Bolognani
2023-03-01 10:17 ` Cornelia Huck [this message]
2023-03-01 13:51 ` Andrea Bolognani
2023-03-01 14:15 ` Cornelia Huck
2023-03-01 14:54 ` Andrea Bolognani
2023-03-02 13:26 ` Cornelia Huck
2023-03-02 13:39 ` Andrea Bolognani
2023-03-02 13:46 ` Peter Maydell
2023-03-02 14:28 ` Cornelia Huck
2023-03-02 16:00 ` Peter Maydell
2023-03-03 16:30 ` Cornelia Huck
2023-03-07 17:05 ` Cornelia Huck
2023-03-03 16:11 ` Peter Maydell
2023-03-03 16:18 ` Cornelia Huck
2023-02-28 15:02 ` [PATCH v6 2/2] qtests/arm: add some mte tests Cornelia Huck
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=874jr4dbcr.fsf@redhat.com \
--to=cohuck@redhat.com \
--cc=abologna@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eauger@redhat.com \
--cc=gshan@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lvivier@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.