mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
arm/kvm: add support for MTE
Extend the 'mte' property for the virt machine to cover KVM as
well. For KVM, we don't allocate tag memory, but instead enable
the capability.
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.
[gankulkarni: This patch is rework of commit b320e21c48
which broke TCG since it made the TCG -cpu max
report the presence of MTE to the guest even if the board hadn't
enabled MTE by wiring up the tag RAM. This meant that if the guest
then tried to use MTE QEMU would segfault accessing the
non-existent tag RAM.]
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Signed-off-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
Message-id: 20241008114302.4855-1-gankulkarni@os.amperecomputing.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
fdf250e5a3
commit
918d0de072
5 changed files with 134 additions and 35 deletions
|
@ -2390,14 +2390,22 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
|
|||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
/*
|
||||
* If we do not have tag-memory provided by the machine,
|
||||
* reduce MTE support to instructions enabled at EL0.
|
||||
* If we run with TCG and do not have tag-memory provided by
|
||||
* the machine, then reduce MTE support to instructions enabled at EL0.
|
||||
* This matches Cortex-A710 BROADCASTMTE input being LOW.
|
||||
*/
|
||||
if (cpu->tag_memory == NULL) {
|
||||
if (tcg_enabled() && cpu->tag_memory == NULL) {
|
||||
cpu->isar.id_aa64pfr1 =
|
||||
FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If MTE is supported by the host, however it should not be
|
||||
* enabled on the guest (i.e mte=off), clear guest's MTE bits."
|
||||
*/
|
||||
if (kvm_enabled() && !cpu->kvm_mte) {
|
||||
FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue