All of lore.kernel.org
 help / color / mirror / Atom feed
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: Thu, 02 Mar 2023 14:26:06 +0100	[thread overview]
Message-ID: <87fsanmgi9.fsf@redhat.com> (raw)
In-Reply-To: <CABJz62PbzFMB3ifg7OvTXe34TS5b3xDHJk8XGs-inA5t5UEAtA@mail.gmail.com>

On Wed, Mar 01 2023, Andrea Bolognani <abologna@redhat.com> wrote:

> On Wed, Mar 01, 2023 at 03:15:17PM +0100, Cornelia Huck wrote:
>> On Wed, Mar 01 2023, Andrea Bolognani <abologna@redhat.com> wrote:
>> > I'm actually a bit confused. The documentation for the mte property
>> > of the virt machine type says
>> >
>> >   mte
>> >     Set on/off to enable/disable emulating a guest CPU which implements
>> >     the Arm Memory Tagging Extensions. The default is off.
>> >
>> > So why is there a need to have a CPU property in addition to the
>> > existing machine type property?
>>
>> I think the state prior to my patches is actually a bit confusing: the
>> user needs to set a machine type property (causing tag memory to be
>> allocated), which in turn enables a cpu feature. Supporting the machine
>> type property for KVM does not make much sense IMHO: we don't allocate
>> tag memory for KVM (in fact, that would not work). We have to keep the
>> previous behaviour, and explicitly instructing QEMU to create cpus with
>> a certain feature via a cpu property makes the most sense to me.
>
> I agree that a CPU feature makes more sense.
>
>> We might want to tweak the documentation for the machine property to
>> indicate that it creates tag memory and only implicitly enables mte but
>> is a pre-req for it -- thoughts?
>
> I wonder if it would be possible to flip things around, so that the
> machine property is retained with its existing behavior for backwards
> compatibility, but both for KVM and for TCG the CPU property can be
> used on its own?
>
> Basically, keeping the default of machine.mte to off when cpu.mte is
> not specified, but switching it to on when it is. This way, you'd be
> able to simply use
>
>   -machine virt -cpu xxx,mte=on
>
> to enable MTE, regardless of whether you're using KVM or TCG, instead
> of requiring the above for KVM and
>
>   -machine virt,mte=on -cpu xxx
>
> for TCG.

The machine prop is a bool; that means that we cannot distinguish
between "user did not set mte at all" and "user explicitly set
mte=off" -- I think we want

  -machine virt,mte=off -cpu xxx,mte=on

to generate an error, but that would still imply that we'd need to error
out for

  -machine virt -cpu xxx,mte=on

as well.

We could make the machine prop OnOffAuto, but that looks like overkill
to me.

>
> Note that, from libvirt's point of view, there's no advantage to
> doing things that way instead of what you already have. Handling the
> additional machine property is a complete non-issue. But it would
> make things nicer for people running QEMU directly, I think.

I'm tempted to simply consider this to be another wart of the QEMU
command line :)


  reply	other threads:[~2023-03-02 13:26 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
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 [this message]
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=87fsanmgi9.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.