qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: 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>,
	Juan Quintela <quintela@redhat.com>,
	Gavin Shan <gshan@redhat.com>
Subject: Re: [PATCH v4 1/2] arm/kvm: add support for MTE
Date: Tue, 17 Jan 2023 17:59:32 +0100	[thread overview]
Message-ID: <877cxl85cb.fsf@redhat.com> (raw)
In-Reply-To: <Y8bR7xrsCMr5z6xI@work-vm>

On Tue, Jan 17 2023, "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:

> * Peter Maydell (peter.maydell@linaro.org) wrote:
>> On Wed, 11 Jan 2023 at 16:13, Cornelia Huck <cohuck@redhat.com> 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               | 133 +++++++++++++++++++++++++++++++
>> >  target/arm/internals.h           |   1 +
>> >  target/arm/kvm64.c               |   5 ++
>> >  target/arm/kvm_arm.h             |  12 +++
>> >  target/arm/monitor.c             |   1 +
>> >  9 files changed, 181 insertions(+), 13 deletions(-)
>> >
>> > diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst
>> > index 00c444042ff5..e278650c837e 100644
>> > --- a/docs/system/arm/cpu-features.rst
>> > +++ b/docs/system/arm/cpu-features.rst
>> > @@ -443,3 +443,24 @@ As with ``sve-default-vector-length``, if the default length is larger
>> >  than the maximum vector length enabled, the actual vector length will
>> >  be reduced.  If this property is set to ``-1`` then the default vector
>> >  length is set to the maximum possible length.
>> > +
>> > +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.
>> > +
>> > +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 iff tag memory is available; i.e. it
>> > +  preserves the behaviour prior to introduction of the feature.
>> > +
>> > +* When KVM is used, MTE will default to off, so that migration will not
>> > +  unintentionally be blocked.
>> > +
>> > +* Other accelerators currently don't support MTE.
>> 
>> Minor nits for the documentation:
>> we should expand out "if and only if" -- not everybody recognizes
>> "iff", especially if they're not native English speakers or not
>> mathematicians.
>> 
>> Should we write specifically that in a future QEMU version KVM
>> might change to defaulting to "on if available" when migration
>> support is implemented?
>
> Please make sure if you do something like that, that the failure
> is obious; 'on if available' gets messy for things like libvirt
> and higher level tools detecting features that are available and
> machines they can migrate to.

I guess we can just keep the door open but decline walking through it if
we fail to come up with a good solution...



  reply	other threads:[~2023-01-17 17:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 16:13 [PATCH v4 0/2] arm: enable MTE for QEMU + kvm Cornelia Huck
2023-01-11 16:13 ` [PATCH v4 1/2] arm/kvm: add support for MTE Cornelia Huck
2023-01-17 16:16   ` Peter Maydell
2023-01-17 16:50     ` Dr. David Alan Gilbert
2023-01-17 16:59       ` Cornelia Huck [this message]
2023-01-17 17:11         ` Dr. David Alan Gilbert
2023-01-17 17:01       ` Peter Maydell
2023-01-17 17:53         ` Dr. David Alan Gilbert
2023-01-17 16:52     ` Cornelia Huck
2023-01-17 19:37   ` Richard Henderson
2023-01-18 17:37     ` Cornelia Huck
2023-01-23 13:50   ` Eric Auger
2023-01-26 11:47     ` Cornelia Huck
2023-01-26 12:15       ` Cornelia Huck
2023-01-11 16:13 ` [PATCH v4 2/2] qtests/arm: add some mte tests Cornelia Huck
2023-01-17  7:21   ` Philippe Mathieu-Daudé
2023-01-23 14:29   ` Eric Auger
2023-01-26 10:57     ` 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=877cxl85cb.fsf@redhat.com \
    --to=cohuck@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=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --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 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).