[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 1/2] arm/kvm: add support for MTE
From: |
Peter Maydell |
Subject: |
Re: [PATCH v6 1/2] arm/kvm: add support for MTE |
Date: |
Fri, 3 Mar 2023 16:11:38 +0000 |
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.
thanks
-- PMM
- Re: [PATCH v6 1/2] arm/kvm: add support for MTE, (continued)
- Re: [PATCH v6 1/2] arm/kvm: add support for MTE, Andrea Bolognani, 2023/03/01
- Re: [PATCH v6 1/2] arm/kvm: add support for MTE, Peter Maydell, 2023/03/02
- Re: [PATCH v6 1/2] arm/kvm: add support for MTE, Cornelia Huck, 2023/03/02
- Re: [PATCH v6 1/2] arm/kvm: add support for MTE, Peter Maydell, 2023/03/02
- Re: [PATCH v6 1/2] arm/kvm: add support for MTE, Cornelia Huck, 2023/03/03
- Re: [PATCH v6 1/2] arm/kvm: add support for MTE, Cornelia Huck, 2023/03/07
Re: [PATCH v6 1/2] arm/kvm: add support for MTE,
Peter Maydell <=