From: Cornelia Huck <cohuck@redhat.com>
To: 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>,
"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: Fri, 03 Mar 2023 17:18:58 +0100 [thread overview]
Message-ID: <87356l24gd.fsf@redhat.com> (raw)
In-Reply-To: <CAFEAcA8FD75dXcPEyZOfF7cxbgynWTdDOJV7K7fYfAbRsPDdmg@mail.gmail.com>
On Fri, Mar 03 2023, Peter Maydell <peter.maydell@linaro.org> wrote:
> On Tue, 28 Feb 2023 at 15:02, 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 | 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(-)
>
>
>
>> +static inline bool arm_machine_has_tag_memory(void)
>> +{
>> +#ifndef CONFIG_USER_ONLY
>> + Object *obj = object_dynamic_cast(qdev_get_machine(), TYPE_VIRT_MACHINE);
>> +
>> + /* so far, only the virt machine has support for tag memory */
>> + if (obj) {
>> + VirtMachineState *vms = VIRT_MACHINE(obj);
>> +
>> + return vms->mte;
>> + }
>
> Code inside target/arm shouldn't be fishing around inside
> the details of the board model like this. For TCG I think that
> at this point (i.e. at realize) you should be able to tell if
> the board has set up tag memory, because it will have set
> cpu->tag_memory to non-NULL.
I agree that we shouldn't need to poke into the machine innards here,
but I found that it was actually too early to check for cpu->tag_memory --
details have unfortunately been flushed out of my cache already, can try
to repopulate.
next prev parent reply other threads:[~2023-03-03 16:19 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
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 [this message]
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=87356l24gd.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=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 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).