Mitigation of "failed to load cpu:cpreg_vmstate_array_len" migration failures
v8 cover Mitigation of "failed to load cpu:cpreg_vmstate_array_len" migration failures
This series applies on top of
[PATCH v3 0/7] Improve traces on migration failure due to cpreg number mismatch
It introduces an infrastructure to explicitly tolerate some mismatches between cpu cpreg indexes/values on migration.
We especially handle failures due to an attempt to migrate more registers than exposed on the destination.
Once the infrastructure is in place we can handle the following known issues:
KVM:
- removal of unconditionnal exposure of TCR2_EL1, PIRE0_EL1, PIR_EL1 from v6.13 onwards. Causes forward migration failure.
- unconditionnal exposure of KVM_REG_ARM_VENDOR_HYP_BMAP_2 FW pseudo register from v6.16 onwards. Causes backward migration failure.
TCG:
- We can eventually remove AArch32 DBGDTRTX register which was erroneously defined.
Both series are available at:
https://github.com/eauger/qemu/tree/cpreg_vmstate_array_len_traces_v3_mitig_v2
History:
v7 -> v8:
- rebase on top of v3 dep
- removal of target/arm/machine: Fix detection of unknown incoming cpregs which is integrated in prerequisite series
v6 -> v7
- complete rework after Peter's comments in
(https://lore.kernel.org/all/[email protected]/)
Especially it does not use properties at all. Do not feature hidden regs Also the initial series was split into 2.
Eric Auger (6):
target/arm/cpu: Introduce the infrastructure for cpreg migration
tolerances
target/arm/machine: Take account cpreg mig tolerances in case of
mismatch
target/arm/cpu64: Mitigate migration failures due to spurious TCR_EL1,
PIRE0_EL1 and PIR_EL1
target/arm/cpu64: Define cpreg migration tolerance for
KVM_REG_ARM_VENDOR_HYP_BMAP_2
target/arm/helper: Define cpreg migration tolerance for DGBDTR_EL0 Revert "target/arm: Reinstate bogus AArch32 DBGDTRTX register for
migration compat"
target/arm/cpu.h | 32 +++++++++++++++++ target/arm/cpu.c | 75 +++++++++++++++++++++++++++++++++++++++ target/arm/cpu64.c | 34 ++++++++++++++++++ target/arm/debug_helper.c | 29 --------------- target/arm/helper.c | 5 +++ target/arm/machine.c | 30 ++++++++++------ target/arm/trace-events | 2 ++ 7 files changed, 168 insertions(+), 39 deletions(-)
Signature · 1 line
2.53.0
PATCH v8 1/6 target/arm/cpu: Introduce the infrastructure for cpreg migration tolerances
We introduce a datatype for a tolerance with respect to a given cpreg migration issue. The tolerance applies to a given cpreg kvm index, and can be of different types:
- ToleranceNotOnBothEnds (cpreg index is allowed to be only on one end)
- ToleranceDiffInMask (value differences are allowed only within a mask)
- ToleranceFieldLT (incoming field value must be less than a given value)
- ToleranceFieldGT (incoming field value must be greater than a given value)
A QLIST of such tolerances can be populated using a new helper:arm_register_cpreg_mig_tolerance() and arm_cpu_cpreg_has_mig_tolerance() allows to check whether a tolerance exists for a given kvm index.
callers for those helpers will be introduced in subsequent patches.
--- target/arm/cpu.h | 32 +++++++++++++++++++++ target/arm/cpu.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+)
target/arm/cpu.h +32 -0
@@ -843,6 +843,21 @@ struct ARMELChangeHook {QLIST_ENTRY (ARMELChangeHook) node; }; +typedef enum { + ToleranceNotOnBothEnds, + ToleranceDiffInMask, + ToleranceFieldLT, + ToleranceFieldGT, +}ARMCPUCPREGMigToleranceType ; + +typedef struct ARMCPUCPREGMigTolerance { +uint64_t kvmidx; +uint64_t mask; +uint64_t value; +ARMCPUCPREGMigToleranceType type; +QLIST_ENTRY (ARMCPUCPREGMigTolerance) node; +}ARMCPUCPREGMigTolerance ; +/* These values map onto the return values for * QEMU_PSCI_0_2_FN_AFFINITY_INFO */ typedef enum ARMPSCIState {
@@ -1139,6 +1154,7 @@ struct ArchCPU { QLIST_HEAD(, ARMELChangeHook) pre_el_change_hooks; QLIST_HEAD(, ARMELChangeHook) el_change_hooks; + QLIST_HEAD(, ARMCPUCPREGMigTolerance) cpreg_mig_tolerances;int32_t node_id;/* NUMA node this CPU belongs to */
@@ -2632,6 +2648,22 @@ void arm_register_pre_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook,void arm_register_el_change_hook (ARMCPU *cpu,ARMELChangeHookFn *hook,void *opaque); +/** +* arm_register_cpreg_mig_tolerance: +* Register a migration tolerance wrt one given cpreg identified by its +* @kvmidx. Only one tolerance can be registered by kvm reg idx. +*/ +void arm_register_cpreg_mig_tolerance (ARMCPU *cpu,uint64_t kvmidx, +uint64_t mask,uint64_t value, +ARMCPUCPREGMigToleranceType type); + +/** +* arm_cpu_cpreg_has_mig_tolerance: +* Check whether a tolerance of type @type exists for a given @kvmidx +*/ +bool arm_cpu_cpreg_has_mig_tolerance (ARMCPU *cpu,uint64_t kvmidx, +uint64_t vmstate_value,uint64_t local_value, +ARMCPUCPREGMigToleranceType type);/** * arm_rebuild_hflags: * Rebuild the cached TBFLAGS for arbitrary changed processor state.
target/arm/cpu.c +75 -0
99 lines not on this page · raw message
Signature · 1 line
2.53.0
Re: [PATCH v8 1/6] target/arm/cpu: Introduce the infrastructure for cpreg migration tolerances
Quoted 4 lines · Eric Auger
We introduce a datatype for a tolerance with respect to a given cpreg migration issue. The tolerance applies to a given cpreg kvm index, and can be of different types:
- ToleranceNotOnBothEnds (cpreg index is allowed to be only on one end)
^
available/present?Quoted 57 lines
- ToleranceDiffInMask (value differences are allowed only within a mask)
- ToleranceFieldLT (incoming field value must be less than a given value)
- ToleranceFieldGT (incoming field value must be greater than a given value)A QLIST of such tolerances can be populated using a new helper:
arm_register_cpreg_mig_tolerance()andarm_cpu_cpreg_has_mig_tolerance()allows to check whether a tolerance exists for a given kvm index.callers for those helpers will be introduced in subsequent patches.
Signed-off-by Eric Auger <[email protected]>---
target/arm/cpu.h| 32 +++++++++++++++++++++target/arm/cpu.c| 75 ++++++++++++++++++++++++++++++++++++++++++++++++2 files changed, 107 insertions(+)target/arm/cpu.h +16
-0@@ -843,6 +843,21 @@ struct ARMELChangeHook {QLIST_ENTRY (ARMELChangeHook) node; }; +typedef enum { + ToleranceNotOnBothEnds, + ToleranceDiffInMask, + ToleranceFieldLT, + ToleranceFieldGT, +}ARMCPUCPREGMigToleranceType ; + +typedef struct ARMCPUCPREGMigTolerance { +uint64_t kvmidx; +uint64_t mask; +uint64_t value; +ARMCPUCPREGMigToleranceType type; +QLIST_ENTRY (ARMCPUCPREGMigTolerance) node; +}ARMCPUCPREGMigTolerance ; +/* These values map onto the return values for * QEMU_PSCI_0_2_FN_AFFINITY_INFO */ typedef enum ARMPSCIState {@@ -1139,6 +1154,7 @@ struct ArchCPU { QLIST_HEAD(, ARMELChangeHook) pre_el_change_hooks; QLIST_HEAD(, ARMELChangeHook) el_change_hooks; + QLIST_HEAD(, ARMCPUCPREGMigTolerance) cpreg_mig_tolerances;int32_t node_id;/* NUMA node this CPU belongs to */ @@ -2632,6 +2648,22 @@ void arm_register_pre_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook,void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, void
*opaque);target/arm/cpu.h +3
-0+/** +* arm_register_cpreg_mig_tolerance: +* Register a migration tolerance wrt one given cpreg identified by its
target/arm/cpu.h void arm_register_pre_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, · line 2663
Quoted 10 lines
target/arm/cpu.h +10
-0+* @kvmidx. Only one tolerance can be registered by kvm reg idx. +*/ +void arm_register_cpreg_mig_tolerance (ARMCPU *cpu,uint64_t kvmidx, +uint64_t mask,uint64_t value, +ARMCPUCPREGMigToleranceType type); + +/** +* arm_cpu_cpreg_has_mig_tolerance: +* Check whether a tolerance of type @type exists for a given @kvmidx +*/
This function does more than the name and description suggests - it not only checks if the tolerance exists but also if it applies..
arm_cpu_cpreg_mig_tolerated ?
Quoted 47 lines
target/arm/cpu.h +3
-0+bool arm_cpu_cpreg_has_mig_tolerance (ARMCPU *cpu,uint64_t kvmidx, +uint64_t vmstate_value,uint64_t local_value, +ARMCPUCPREGMigToleranceType type);/**
*arm_rebuild_hflags:
* Rebuild the cached TBFLAGS for arbitrary changed processor state.target/arm/cpu.c +33
-0@@ -181,6 +181,75 @@ void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook,QLIST_INSERT_HEAD (&cpu->el_change_hooks, entry, node); } +void arm_register_cpreg_mig_tolerance (ARMCPU *cpu,uint64_t kvmidx, +uint64_t mask,uint64_t value, +ARMCPUCPREGMigToleranceType type) +{ +ARMCPUCPREGMigTolerance *t, *entry; + +/* make sure the kvmidx has not tolerance already registered */ + QLIST_FOREACH(t, &cpu->cpreg_mig_tolerances, node) { +if (t->kvmidx == kvmidx) { +g_assert_not_reached (); + } + } + entry =g_new0 (ARMCPUCPREGMigTolerance,1 ); + + entry->kvmidx = kvmidx; + entry->mask = mask; + entry->value = value; + entry->type = type; + +QLIST_INSERT_HEAD (&cpu->cpreg_mig_tolerances, entry, node); +} + +bool arm_cpu_cpreg_has_mig_tolerance (ARMCPU *cpu,uint64_t kvmidx, +uint64_t vmstate_value,uint64_t local_value, +ARMCPUCPREGMigToleranceType type) +{ +ARMCPUCPREGMigTolerance *t; +uint64_t diff, diff_outside_mask, field; +bool found = false; + + QLIST_FOREACH(t, &cpu->cpreg_mig_tolerances, node) { +if (t->kvmidx == kvmidx) { + found = true;
target/arm/cpu.c void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, · line 226
Quoted 10 lines
target/arm/cpu.c +10
-0+break ; + } + } +if (!found) { +return false; + } + +/* we found one tolerance associated to the @kvmidx */ + +if (type == ToleranceNotOnBothEnds) {
This should use t->type and type can be removed as an argument.
Quoted 13 lines
target/arm/cpu.c +13
-0+return true; + } + +/* Need to check mask */ + diff = vmstate_value ^ local_value; + diff_outside_mask = diff & ~t->mask; + +if (diff_outside_mask) { +/* there are differences outside of the mask */ +return false; + } +if (type == ToleranceDiffInMask) { +/* differences only in the field, tolerance granted */
target/arm/cpu.c void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, · line 249
Quoted 10 lines
target/arm/cpu.c +10
-0+return true; + } +/* need to compare field value against authorized ones */ + field = vmstate_value & t->mask; +if (type == ToleranceFieldLT && (field < t->value)) { +return true; + } +if (type == ToleranceFieldGT && (field > t->value)) { +return true; + }
Ah, so this is only compared with a static value not with the local_value. Would there be a need for a more sophisticated check than ToleranceDiffInMask?
We could instead of having the type per ARMCPUCPREGMigTolerance register a callback that makes the decision. The 4 types would be 4 pre-defined callbacks and if a user needs something more sophisticated it can create a custom callback.
But yea, that's just an idea - not sure if we'll ever need something like this..
Quoted 37 lines
target/arm/cpu.c +9
-0+return false; +} +static void cp_reg_reset (gpointer key,gpointer value,gpointer opaque) {/* Reset a single ARMCPRegInfo register */ @@ -1106,6 +1175,7 @@ static void arm_cpu_initfn(Object *obj)QLIST_INIT (&cpu->pre_el_change_hooks);QLIST_INIT (&cpu->el_change_hooks); +QLIST_INIT (&cpu->cpreg_mig_tolerances);#ifdef CONFIG_USER_ONLY # ifdef TARGET_AARCH64 @@ -1550,6 +1620,7 @@ static void arm_cpu_finalizefn(Object *obj) {ARMCPU *cpu =ARM_CPU (obj);ARMELChangeHook *hook, *next; +ARMCPUCPREGMigTolerance *t, *n;g_hash_table_destroy (cpu->cp_regs);@@ -1561,6 +1632,10 @@ static void arm_cpu_finalizefn(Object *obj)QLIST_REMOVE (hook, node);g_free (hook); } + QLIST_FOREACH_SAFE(t, &cpu->cpreg_mig_tolerances, node, n) { +QLIST_REMOVE (t, node); +g_free (t); + }#ifndef CONFIG_USER_ONLY if (cpu->pmu_timer) {timer_free (cpu->pmu_timer);Signature · 1 line
2.53.0
Re: [PATCH v8 1/6] target/arm/cpu: Introduce the infrastructure for cpreg migration tolerances
Hi Sebastian,
Quoted 84 lines · Sebastian Ott
Quoted 4 lines · Eric Auger
We introduce a datatype for a tolerance with respect to a given cpreg migration issue. The tolerance applies to a given cpreg kvm index, and can be of different types:
- ToleranceNotOnBothEnds (cpreg index is allowed to be only on one end)^ available/present?
Quoted 67 lines
- ToleranceDiffInMask (value differences are allowed only within a mask)
- ToleranceFieldLT (incoming field value must be less than a given value)
- ToleranceFieldGT (incoming field value must be greater than a given value)A QLIST of such tolerances can be populated using a new helper:
arm_register_cpreg_mig_tolerance()andarm_cpu_cpreg_has_mig_tolerance()allows to check whether a tolerance exists for a given kvm index.callers for those helpers will be introduced in subsequent patches.
Signed-off-by Eric Auger <[email protected]>---
target/arm/cpu.h| 32 +++++++++++++++++++++target/arm/cpu.c| 75 ++++++++++++++++++++++++++++++++++++++++++++++++2 files changed, 107 insertions(+)target/arm/cpu.h +16
-0@@ -843,6 +843,21 @@ struct ARMELChangeHook { QLIST_ENTRY(ARMELChangeHook) node; }; +typedef enum { + ToleranceNotOnBothEnds, + ToleranceDiffInMask, + ToleranceFieldLT, + ToleranceFieldGT, +}ARMCPUCPREGMigToleranceType ; + +typedef struct ARMCPUCPREGMigTolerance { + uint64_t kvmidx; + uint64_t mask; + uint64_t value; + ARMCPUCPREGMigToleranceType type; + QLIST_ENTRY(ARMCPUCPREGMigTolerance) node; +}ARMCPUCPREGMigTolerance ; +/* These values map onto the return values for * QEMU_PSCI_0_2_FN_AFFINITY_INFO */ typedef enum ARMPSCIState {@@ -1139,6 +1154,7 @@ struct ArchCPU { QLIST_HEAD(, ARMELChangeHook) pre_el_change_hooks; QLIST_HEAD(, ARMELChangeHook) el_change_hooks; + QLIST_HEAD(, ARMCPUCPREGMigTolerance) cpreg_mig_tolerances;
int32_tnode_id; /* NUMA node this CPU belongs to */target/arm/cpu.h +0
-0@@ -2632,6 +2648,22 @@ void arm_register_pre_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook,void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, void
*opaque);target/arm/cpu.h +8
-0+/** +* arm_register_cpreg_mig_tolerance: +* Register a migration tolerance wrt one given cpreg identified by its +* @kvmidx. Only one tolerance can be registered by kvm reg idx. +*/ +void arm_register_cpreg_mig_tolerance (ARMCPU *cpu,uint64_t kvmidx, + uint64_t mask, uint64_t value, + ARMCPUCPREGMigToleranceTypetype);
target/arm/cpu.h void arm_register_pre_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, · line 2663
Quoted 5 lines
target/arm/cpu.h +5
-0+ +/** +* arm_cpu_cpreg_has_mig_tolerance: +* Check whether a tolerance of type @type exists for a given @kvmidx +*/ This function does more than the name and description suggests - it not only checks if the tolerance exists but also if it applies..
Quoted 1 line
arm_cpu_cpreg_mig_tolerated?
Well it is supposed to really check a tolerance exists (and thus applies), of a given type, for a given kvmidx.
But I admit the check of ->type versus type is missing below.
Quoted 55 lines
Quoted 55 lines
+bool arm_cpu_cpreg_has_mig_tolerance(ARMCPU *cpu,
uint64_tkvmidx, +uint64_tvmstate_value,uint64_tlocal_value,
+ ARMCPUCPREGMigToleranceType type); /**
*arm_rebuild_hflags:
* Rebuild the cached TBFLAGS for arbitrary changed processor state.target/arm/cpu.c +37
-0@@ -181,6 +181,75 @@ void arm_register_el_change_hook(ARMCPU *cpu,ARMELChangeHookFn *hook, QLIST_INSERT_HEAD(&cpu->el_change_hooks, entry, node); } +void arm_register_cpreg_mig_tolerance (ARMCPU *cpu,uint64_t kvmidx, + uint64_t mask, uint64_t value, + ARMCPUCPREGMigToleranceType type) +{ + ARMCPUCPREGMigTolerance *t, *entry; + + /* make sure the kvmidx has not tolerance already registered */ + QLIST_FOREACH(t, &cpu->cpreg_mig_tolerances, node) { + if (t->kvmidx == kvmidx) { + g_assert_not_reached(); + } + } + entry = g_new0(ARMCPUCPREGMigTolerance, 1); + + entry->kvmidx = kvmidx; + entry->mask = mask; + entry->value = value; + entry->type = type; + + QLIST_INSERT_HEAD(&cpu->cpreg_mig_tolerances, entry, node); +} + +bool arm_cpu_cpreg_has_mig_tolerance (ARMCPU *cpu,uint64_t kvmidx, + uint64_t vmstate_value,uint64_t local_value, + ARMCPUCPREGMigToleranceType type) +{ + ARMCPUCPREGMigTolerance *t; + uint64_t diff, diff_outside_mask, field; + bool found = false; + + QLIST_FOREACH(t, &cpu->cpreg_mig_tolerances, node) { + if (t->kvmidx == kvmidx) { + found = true; + break; + } + } + if (!found) {
Quoted 8 lines
target/arm/cpu.c void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, · line 226
Quoted 6 lines
target/arm/cpu.c +6
-0+ return false; + } + + /* we found one tolerance associated to the @kvmidx */ + + if (type == ToleranceNotOnBothEnds) {This should use
t->typeand type can be removed as an argument.
Actually if we found a tolerance registered for this regidx, I should test the @type matches the registered tolerance once. This is missing.
Quoted 30 lines
Quoted 14 lines
target/arm/cpu.c +13
-0+ return true; + } + + /* Need to check mask */ + diff = vmstate_value ^ local_value; + diff_outside_mask = diff & ~t->mask; + + if (diff_outside_mask) { + /* there are differences outside of the mask */ + return false; + } + if (type == ToleranceDiffInMask) { + /* differences only in the field, tolerance granted */target/arm/cpu.c void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, · line 249
Quoted 10 lines
target/arm/cpu.c +10
-0+ return true; + } + /* need to compare field value against authorized ones */ + field = vmstate_value & t->mask; + if (type == ToleranceFieldLT && (field < t->value)) { + return true; + } + if (type == ToleranceFieldGT && (field > t->value)) { + return true; + }Ah, so this is only compared with a static value not with the
local_value.
Would there be a need for a more sophisticated check than ToleranceDiffInMask?
Quoted 5 lines
We could instead of having the type per ARMCPUCPREGMigTolerance register a
callback that makes the decision. The 4 types would be 4 pre-defined callbacks and if a user needs something more sophisticated it can create a custom callback.
The goal is to tolerate some differences in a fields versus a given static value. For instance if we know a field value was corrected in the kernel.
This we have no example of such usage, it is a bit difficult to provide a comprehensive infra. Maybe I should even remove that code until we get the need.
Quoted 35 lines
But yea, that's just an idea - not sure if we'll ever need something like this..
Quoted 31 lines
target/arm/cpu.c +3
-0+ return false; +} +static void cp_reg_reset (gpointer key,gpointer value,gpointer opaque){
/* Reset a single ARMCPRegInfo register */target/arm/cpu.c +6
-0@@ -1106,6 +1175,7 @@ static void arm_cpu_initfn(Object *obj) QLIST_INIT(&cpu->pre_el_change_hooks); QLIST_INIT(&cpu->el_change_hooks); + QLIST_INIT(&cpu->cpreg_mig_tolerances);#ifdef CONFIG_USER_ONLY # ifdef TARGET_AARCH64 @@ -1550,6 +1620,7 @@ static void arm_cpu_finalizefn(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); ARMELChangeHook *hook, *next; + ARMCPUCPREGMigTolerance *t, *n; g_hash_table_destroy(cpu->cp_regs);@@ -1561,6 +1632,10 @@ static void arm_cpu_finalizefn(Object *obj) QLIST_REMOVE(hook, node); g_free(hook); } + QLIST_FOREACH_SAFE(t, &cpu->cpreg_mig_tolerances, node, n) { + QLIST_REMOVE(t, node); + g_free(t); + }#ifndef CONFIG_USER_ONLY
Quoted 9 lines
Quoted 6 lines
target/arm/cpu.c +0
-0if (cpu->pmu_timer) { timer_free(cpu->pmu_timer);--
2.53.0Reviewed-by Sebastian Ott <[email protected]>
Thank you for the review
Eric
PATCH v8 2/6 target/arm/machine: Take account cpreg mig tolerances in case of mismatch
In reply to Eric AugerIf there is a mismatch between the cpreg indexes found on both ends, check whether a tolerance was registered for the given kvmidx. If any, silence warning/errors.
Create dedicated helper functions that print the name of the culprit reg and analyze whether a tolerance is set. According set the level of traces and analyze whether the migration must eventually fail.
--- target/arm/machine.c | 30 ++++++++++++++++++++---------- target/arm/trace-events | 2 ++ 2 files changed, 22 insertions(+), 10 deletions(-)
target/arm/machine.c +20 -10
@@ -1065,24 +1065,34 @@ static void handle_cpreg_missing_in_incoming_stream(ARMCPU *cpu, uint64_t kvmidx { g_autofree gchar *name = print_register_name(kvmidx); -warn_report ("%s: %s " -"expected by the destination but not in the incoming stream: " -"skip it" , __func__, name); +if (!arm_cpu_cpreg_has_mig_tolerance (cpu, kvmidx, +0 ,0 , ToleranceNotOnBothEnds)) { +warn_report ("%s: %s " +"expected by the destination but not in the incoming stream: " +"skip it" , __func__, name); + }else { +trace_tolerate_cpreg_missing_in_incoming_stream (name); + } }/* -* Handle the situation where @kvmidx is in the incoming stream -* but not on destination. This currently fails the migration but -* we plan to accomodate some exceptions, hence the boolean returned value. +* Handle the situation where @kvmidx is in the incoming +* stream but not on destination. This fails the migration if +* no cpreg mig tolerance is set for this @kvmidx */ static bool handle_cpreg_only_in_incoming_stream (ARMCPU *cpu,uint64_t kvmidx) { g_autofree gchar *name = print_register_name(kvmidx); -bool fail = true; - -error_report ("%s: %s in the incoming stream but unknown on the " -"destination: fail migration" , __func__, name); +bool fail = false; +if (!arm_cpu_cpreg_has_mig_tolerance (cpu, kvmidx, +0 ,0 , ToleranceNotOnBothEnds)) { +error_report ("%s: %s in the incoming stream but unknown on the " +"destination: fail migration" , __func__, name); + fail = true; + }else { +trace_tolerate_cpreg_only_in_incoming_stream (name); + }return fail; }
target/arm/trace-events +2 -0
@@ -29,3 +29,5 @@ arm_psci_call(uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3, uint32_t cpuid # machine.c cpu_post_load(uint32_t cpreg_vmstate_array_len, uint32_t cpreg_array_len) "cpreg_vmstate_array_len=%d cpreg_array_len=%d" +tolerate_cpreg_missing_in_incoming_stream(char *name) "%s is missing in incoming stream but this is explicitly tolerated" +tolerate_cpreg_only_in_incoming_stream(char *name) "%s is in incoming stream but not on destination but this is explicitly tolerated"
Signature · 1 line
2.53.0
Re: [PATCH v8 2/6] target/arm/machine: Take account cpreg mig tolerances in case of mismatch
Quoted 19 lines · Eric Auger
If there is a mismatch between the cpreg indexes found on both ends, check whether a tolerance was registered for the given kvmidx. If any, silence warning/errors.
Create dedicated helper functions that print the name of the culprit reg and analyze whether a tolerance is set. According set the level of traces and analyze whether the migration must eventually fail.
Signed-off-by Eric Auger <[email protected]>---
target/arm/machine.c| 30 ++++++++++++++++++++----------
target/arm/trace-events | 2 ++2 files changed, 22 insertions(+), 10 deletions(-)target/arm/machine.c +0
-0
target/arm/machine.c static void handle_cpreg_missing_in_incoming_stream(ARMCPU *cpu, uint64_t kvmidx · line 1069
Quoted 8 lines
target/arm/machine.c +2
-3@@ -1065,24 +1065,34 @@ static void handle_cpreg_missing_in_incoming_stream(ARMCPU *cpu, uint64_t kvmidx { g_autofree gchar *name = print_register_name(kvmidx); -warn_report ("%s: %s " -"expected by the destination but not in the incoming stream: " -"skip it" , __func__, name); +if (!arm_cpu_cpreg_has_mig_tolerance (cpu, kvmidx, +0 ,0 , ToleranceNotOnBothEnds)) {
I don't get this. You apply a different tolerance type than the one (potentially) registered. This check will only fail when there was no tolerance registered for this kvmidx. But this can be changed by someone registering a different type.
Quoted 50 lines
target/arm/machine.c +18
-7+warn_report ("%s: %s " +"expected by the destination but not in the incoming stream: " +"skip it" , __func__, name); + }else { +trace_tolerate_cpreg_missing_in_incoming_stream (name); + } }/* -* Handle the situation where @kvmidx is in the incoming stream -* but not on destination. This currently fails the migration but -* we plan to accomodate some exceptions, hence the boolean returned value. +* Handle the situation where @kvmidx is in the incoming +* stream but not on destination. This fails the migration if +* no cpreg mig tolerance is set for this @kvmidx */ static bool handle_cpreg_only_in_incoming_stream (ARMCPU *cpu,uint64_t kvmidx) { g_autofree gchar *name = print_register_name(kvmidx); -bool fail = true; - -error_report ("%s: %s in the incoming stream but unknown on the " -"destination: fail migration" , __func__, name); +bool fail = false; +if (!arm_cpu_cpreg_has_mig_tolerance (cpu, kvmidx, +0 ,0 , ToleranceNotOnBothEnds)) { +error_report ("%s: %s in the incoming stream but unknown on the " +"destination: fail migration" , __func__, name); + fail = true; + }else { +trace_tolerate_cpreg_only_in_incoming_stream (name); + }return fail; }target/arm/trace-events +0
-0@@ -29,3 +29,5 @@ arm_psci_call(uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3, uint32_t cpuid # machine.c
cpu_post_load(uint32_t cpreg_vmstate_array_len, uint32_t cpreg_array_len)"cpreg_vmstate_array_len=%d cpreg_array_len=%d"target/arm/trace-events +2
-0+tolerate_cpreg_missing_in_incoming_stream(char *name) "%s is missing in incoming stream but this is explicitly tolerated" +tolerate_cpreg_only_in_incoming_stream(char *name) "%s is in incoming stream but not on destination but this is explicitly tolerated"Signature · 1 line
2.53.0
Re: [PATCH v8 2/6] target/arm/machine: Take account cpreg mig tolerances in case of mismatch
Quoted 25 lines · Sebastian Ott
Quoted 24 lines · Eric Auger
If there is a mismatch between the cpreg indexes found on both ends, check whether a tolerance was registered for the given kvmidx. If any, silence warning/errors.
Create dedicated helper functions that print the name of the culprit reg and analyze whether a tolerance is set. According set the level of traces
and analyze whether the migration must eventually fail.Signed-off-by Eric Auger <[email protected]>---
target/arm/machine.c | 30 ++++++++++++++++++++---------- target/arm/trace-events | 2 ++2 files changed, 22 insertions(+), 10 deletions(-)target/arm/machine.c +0
-0@@ -1065,24 +1065,34 @@ static voidhandle_cpreg_missing_in_incoming_stream(ARMCPU *cpu,
uint64_tkvmidx {
g_autofreegchar *name =print_register_name(kvmidx);
Quoted 12 lines
Quoted 7 lines
- warn_report("%s: %s "
- "expected by the destination but not in the incoming
stream: "
- "skip it",__func__, name);
+ if (!arm_cpu_cpreg_has_mig_tolerance(cpu, kvmidx,
+ 0, 0, ToleranceNotOnBothEnds)) {I don't get this. You apply a different tolerance type than the one (potentially) registered. This check will only fail when there was no tolerance registered for this kvmidx. But this can be changed by someone registering a different type.
OK so we know the cpreg is missing in the input stream. If there is a tolerance of type ToleranceNotOnBothEnds for this kvmidx, that's fine, we just trace and do not report any warning. Otherwise we warn_report the issue but do not fail.
Does it clarify?
Eric
Quoted 61 lines
Quoted 60 lines
+ warn_report("%s: %s "
+ "expected by the destination but not in the incoming stream: "
+ "skip it",__func__, name);
+ } else {
+trace_tolerate_cpreg_missing_in_incoming_stream(name); + }
}/*
- * Handle the situation where @kvmidx is in the incoming stream
- * but not on destination. This currently fails the migration but
- * we plan to accomodate some exceptions, hence the boolean returned value.
+ * Handle the situation where @kvmidx is in the incoming
+ * stream but not on destination. This fails the migration if
+ * no cpreg mig tolerance is set for this @kvmidx
*/
static boolhandle_cpreg_only_in_incoming_stream(ARMCPU *cpu, uint64_t kvmidx)
{
g_autofreegchar *name =print_register_name(kvmidx); - bool fail = true;
-
- error_report("%s: %s in the incoming stream but unknown on the " - "destination: fail migration",__func__, name); + bool fail = false;+ if (!arm_cpu_cpreg_has_mig_tolerance(cpu, kvmidx,
+ 0, 0, ToleranceNotOnBothEnds)) {
+ error_report("%s: %s in the incoming stream but unknown on the "
+ "destination: fail migration",__func__, name); + fail = true;
+ } else {
+trace_tolerate_cpreg_only_in_incoming_stream(name); + }
return fail;
}target/arm/trace-events +0
-0@@ -29,3 +29,5 @@ arm_psci_call(uint64_t x0, uint64_t x1, uint64_tx2,
uint64_tx3,uint32_tcpuid# machine.c cpu_post_load(uint32_t cpreg_vmstate_array_len, uint32_t cpreg_array_len) "cpreg_vmstate_array_len=%d cpreg_array_len=%d" +tolerate_cpreg_missing_in_incoming_stream(char *name) "%s is missing in incoming stream but this is explicitly tolerated" +tolerate_cpreg_only_in_incoming_stream(char *name) "%s is in incoming stream but not on destination but this is explicitly tolerated" -- 2.53.0
Re: [PATCH v8 2/6] target/arm/machine: Take account cpreg mig tolerances in case of mismatch
Quoted 39 lines · Eric Auger
Quoted 25 lines · Sebastian Ott
Quoted 24 lines · Eric Auger
If there is a mismatch between the cpreg indexes found on both ends, check whether a tolerance was registered for the given kvmidx. If any, silence warning/errors.
Create dedicated helper functions that print the name of the culprit reg and analyze whether a tolerance is set. According set the level of traces
and analyze whether the migration must eventually fail.Signed-off-by Eric Auger <[email protected]>---
target/arm/machine.c | 30 ++++++++++++++++++++---------- target/arm/trace-events | 2 ++2 files changed, 22 insertions(+), 10 deletions(-)target/arm/machine.c +0
-0@@ -1065,24 +1065,34 @@ static voidhandle_cpreg_missing_in_incoming_stream(ARMCPU *cpu,
uint64_tkvmidx {
g_autofreegchar *name =print_register_name(kvmidx);Quoted 12 lines
Quoted 7 lines
- warn_report("%s: %s "
- "expected by the destination but not in the incoming
stream: "
- "skip it",__func__, name);
+ if (!arm_cpu_cpreg_has_mig_tolerance(cpu, kvmidx,
+ 0, 0, ToleranceNotOnBothEnds)) {I don't get this. You apply a different tolerance type than the one (potentially) registered. This check will only fail when there was no tolerance registered for this kvmidx. But this can be changed by someone registering a different type.
Quoted 5 lines
OK so we know the cpreg is missing in the input stream. If there is a tolerance of type ToleranceNotOnBothEnds for this kvmidx, that's fine, we just trace and do not report any warning. Otherwise we
warn_reportthe issue but do not fail.
Does it clarify?
Yes, it does.
It just feels a bit odd that we identify specific issues when comparing destination vs incomming stream and then test if that specific issue is tolerated. With the infrastructure from patch 1 I would have expected that arm_cpu_cpreg_has_mig_tolerance() can already handle the specific issues - something like:
if (dest[i] == incomming[i]) {
//all good
} else if (arm_cpu_cpreg_has_mig_tolerance()) {
//all good
} else
fail();..but I guess I'm just missing smth.
Sebastian
Re: [PATCH v8 2/6] target/arm/machine: Take account cpreg mig tolerances in case of mismatch
In reply to Sebastian OttQuoted 25 lines · Sebastian Ott
Quoted 24 lines · Eric Auger
If there is a mismatch between the cpreg indexes found on both ends, check whether a tolerance was registered for the given kvmidx. If any, silence warning/errors.
Create dedicated helper functions that print the name of the culprit reg and analyze whether a tolerance is set. According set the level of traces
and analyze whether the migration must eventually fail.Signed-off-by Eric Auger <[email protected]>---
target/arm/machine.c | 30 ++++++++++++++++++++---------- target/arm/trace-events | 2 ++2 files changed, 22 insertions(+), 10 deletions(-)target/arm/machine.c +0
-0@@ -1065,24 +1065,34 @@ static voidhandle_cpreg_missing_in_incoming_stream(ARMCPU *cpu,
uint64_tkvmidx {
g_autofreegchar *name =print_register_name(kvmidx);
Quoted 12 lines
Quoted 7 lines
- warn_report("%s: %s "
- "expected by the destination but not in the incoming
stream: "
- "skip it",__func__, name);
+ if (!arm_cpu_cpreg_has_mig_tolerance(cpu, kvmidx,
+ 0, 0, ToleranceNotOnBothEnds)) {I don't get this. You apply a different tolerance type than the one (potentially) registered. This check will only fail when there was no tolerance registered for this kvmidx. But this can be changed by someone registering a different type.
Note at the moment, only one tolerance can be registered for a kvmidx
Eric
Quoted 61 lines
Quoted 60 lines
+ warn_report("%s: %s "
+ "expected by the destination but not in the incoming stream: "
+ "skip it",__func__, name);
+ } else {
+trace_tolerate_cpreg_missing_in_incoming_stream(name); + }
}/*
- * Handle the situation where @kvmidx is in the incoming stream
- * but not on destination. This currently fails the migration but
- * we plan to accomodate some exceptions, hence the boolean returned value.
+ * Handle the situation where @kvmidx is in the incoming
+ * stream but not on destination. This fails the migration if
+ * no cpreg mig tolerance is set for this @kvmidx
*/
static boolhandle_cpreg_only_in_incoming_stream(ARMCPU *cpu, uint64_t kvmidx)
{
g_autofreegchar *name =print_register_name(kvmidx); - bool fail = true;
-
- error_report("%s: %s in the incoming stream but unknown on the " - "destination: fail migration",__func__, name); + bool fail = false;+ if (!arm_cpu_cpreg_has_mig_tolerance(cpu, kvmidx,
+ 0, 0, ToleranceNotOnBothEnds)) {
+ error_report("%s: %s in the incoming stream but unknown on the "
+ "destination: fail migration",__func__, name); + fail = true;
+ } else {
+trace_tolerate_cpreg_only_in_incoming_stream(name); + }
return fail;
}target/arm/trace-events +0
-0@@ -29,3 +29,5 @@ arm_psci_call(uint64_t x0, uint64_t x1, uint64_tx2,
uint64_tx3,uint32_tcpuid# machine.c cpu_post_load(uint32_t cpreg_vmstate_array_len, uint32_t cpreg_array_len) "cpreg_vmstate_array_len=%d cpreg_array_len=%d" +tolerate_cpreg_missing_in_incoming_stream(char *name) "%s is missing in incoming stream but this is explicitly tolerated" +tolerate_cpreg_only_in_incoming_stream(char *name) "%s is in incoming stream but not on destination but this is explicitly tolerated" -- 2.53.0
PATCH v8 3/6 target/arm/cpu64: Mitigate migration failures due to spurious TCR_EL1, PIRE0_EL1 and PIR_EL1
In reply to Eric AugerBefore linux v6.13 those registers were erroneously unconditionally exposed and this was fixed by commits:
- 0fcb4eea5345 ("KVM: arm64: Hide TCR2_EL1 from userspace when disabled for guests")
- a68cddbe47ef ("KVM: arm64: Hide S1PIE registers from userspace when disabled for guests")
in v6.13.
This means if we migrate from an old kernel host to a >= 6.13 kernel host, migration currently fails.
Declare cpreg migration tolerance for those registers.
--- target/arm/cpu64.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
target/arm/cpu64.c +26 -0
@@ -810,6 +810,31 @@ static void aarch64_a53_initfn(Object *obj)define_cortex_a72_a57_a53_cp_reginfo (cpu); } +static void kvm_arm_set_cpreg_mig_tolerances (ARMCPU *cpu) +{ +/* +* Registers that may be in the incoming stream and not exposed +* on the destination +*/ + +/* +* TCR_EL1 was erroneously unconditionnally exposed before linux v6.13. +* See commit 0fcb4eea5345 ("KVM: arm64: Hide TCR2_EL1 from userspace +* when disabled for guests") +*/ +arm_register_cpreg_mig_tolerance (cpu,ARM64_SYS_REG (3 ,0 ,2 ,0 ,3 ), +0 ,0 , ToleranceNotOnBothEnds); +/* +* PIRE0_EL1 and PIR_EL1 were erroneously unconditionnally exposed +* before linux v6.13. See commit a68cddbe47ef ("KVM: arm64: Hide +* S1PIE registers from userspace when disabled for guests") +*/ +arm_register_cpreg_mig_tolerance (cpu,ARM64_SYS_REG (3 ,0 ,10 ,2 ,2 ), +0 ,0 , ToleranceNotOnBothEnds); +arm_register_cpreg_mig_tolerance (cpu,ARM64_SYS_REG (3 ,0 ,10 ,2 ,3 ), +0 ,0 , ToleranceNotOnBothEnds); +} +static void aarch64_host_initfn (Object *obj) {ARMCPU *cpu =ARM_CPU (obj);
@@ -822,6 +847,7 @@ static void aarch64_host_initfn(Object *obj)#endif #if defined(CONFIG_KVM ) +kvm_arm_set_cpreg_mig_tolerances (cpu);kvm_arm_set_cpu_features_from_host (cpu);aarch64_add_sve_properties (obj);#elif defined(CONFIG_HVF )
Signature · 1 line
2.53.0
Re: [PATCH v8 3/6] target/arm/cpu64: Mitigate migration failures due to spurious TCR_EL1, PIRE0_EL1 and PIR_EL1
Quoted 8 lines · Eric Auger
Before linux v6.13 those registers were erroneously unconditionally exposed and this was fixed by commits:
-0fcb4eea5345("KVM: arm64: HideTCR2_EL1from userspace when disabled for guests")
- a68cddbe47ef ("KVM: arm64: Hide S1PIE registers from userspace when disabled for guests")
in v6.13.
Quoted 6 lines
This means if we migrate from an old kernel host to a >= 6.13 kernel host, migration currently fails.
Declare cpreg migration tolerance for those registers.
Signed-off-by Eric Auger <[email protected]>
Quoted 52 lines
---
target/arm/cpu64.c| 26 ++++++++++++++++++++++++++1 file changed, 26 insertions(+)target/arm/cpu64.c +26
-0@@ -810,6 +810,31 @@ static void aarch64_a53_initfn(Object *obj)define_cortex_a72_a57_a53_cp_reginfo (cpu); } +static void kvm_arm_set_cpreg_mig_tolerances (ARMCPU *cpu) +{ +/* +* Registers that may be in the incoming stream and not exposed +* on the destination +*/ + +/* +* TCR_EL1 was erroneously unconditionnally exposed before linux v6.13. +* See commit 0fcb4eea5345 ("KVM: arm64: Hide TCR2_EL1 from userspace +* when disabled for guests") +*/ +arm_register_cpreg_mig_tolerance (cpu,ARM64_SYS_REG (3 ,0 ,2 ,0 ,3 ), +0 ,0 , ToleranceNotOnBothEnds); +/* +* PIRE0_EL1 and PIR_EL1 were erroneously unconditionnally exposed +* before linux v6.13. See commit a68cddbe47ef ("KVM: arm64: Hide +* S1PIE registers from userspace when disabled for guests") +*/ +arm_register_cpreg_mig_tolerance (cpu,ARM64_SYS_REG (3 ,0 ,10 ,2 ,2 ), +0 ,0 , ToleranceNotOnBothEnds); +arm_register_cpreg_mig_tolerance (cpu,ARM64_SYS_REG (3 ,0 ,10 ,2 ,3 ), +0 ,0 , ToleranceNotOnBothEnds); +} +static void aarch64_host_initfn (Object *obj) {ARMCPU *cpu =ARM_CPU (obj);@@ -822,6 +847,7 @@ static void aarch64_host_initfn(Object *obj)#endif #if defined(CONFIG_KVM ) +kvm_arm_set_cpreg_mig_tolerances (cpu);kvm_arm_set_cpu_features_from_host (cpu);aarch64_add_sve_properties (obj);#elif defined(CONFIG_HVF )Signature · 1 line
2.53.0
PATCH v8 4/6 target/arm/cpu64: Define cpreg migration tolerance for KVM_REG_ARM_VENDOR_HYP_BMAP_2
In reply to Eric AugerKVM_REG_ARM_VENDOR_HYP_BMAP_2 pseudo FW register is exposed from v6.15 onwards. Backward migration from a >= v6.15 to an older kernel would fail without cpreg migration tolerance definition for this register.
--- target/arm/cpu64.c | 8 ++++++++ 1 file changed, 8 insertions(+)
target/arm/cpu64.c +8 -0
@@ -833,6 +833,14 @@ static void kvm_arm_set_cpreg_mig_tolerances(ARMCPU *cpu) 0, 0, ToleranceNotOnBothEnds);arm_register_cpreg_mig_tolerance (cpu,ARM64_SYS_REG (3 ,0 ,10 ,2 ,3 ),0 ,0 , ToleranceNotOnBothEnds); + +/* +* KVM_REG_ARM_VENDOR_HYP_BMAP_2 pseudo FW register is exposed +* from v6.15 onwards. Backward migration from a >= v6.15 to an older +* kernel would fail without cpreg migration tolerance definition +*/ +arm_register_cpreg_mig_tolerance (cpu,KVM_REG_ARM_FW_FEAT_BMAP_REG (3 ), +0 ,0 , ToleranceNotOnBothEnds); }static void aarch64_host_initfn (Object *obj)
Signature · 1 line
2.53.0
Re: [PATCH v8 4/6] target/arm/cpu64: Define cpreg migration tolerance for KVM_REG_ARM_VENDOR_HYP_BMAP_2
Quoted 6 lines · Eric Auger
KVM_REG_ARM_VENDOR_HYP_BMAP_2pseudo FW register is exposed from v6.15 onwards. Backward migration from a >= v6.15 to an older kernel would fail without cpreg migration tolerance definition for this register.Signed-off-by Eric Auger <[email protected]>
PATCH v8 5/6 target/arm/helper: Define cpreg migration tolerance for DGBDTR_EL0
In reply to Eric AugerWe want to remove AArch32 DBGDTRTX which was erroneously exposed. This was attempted by 655659a74a36b ("target/arm: Correct encoding of Debug Communications Channel registers") but it was discovered that the removal of this debug register broke forward migration on TCG. Now we have the cpreg migration tolerance infrastructure, we can declare one for the DBGDTRTX. This allow to revert the reinstate patch.
--- target/arm/helper.c | 5 +++++ 1 file changed, 5 insertions(+)
target/arm/helper.c +5 -0
@@ -6426,9 +6426,14 @@ void register_cp_regs_for_features(ARMCPU *cpu) .fgt = FGT_CLIDR_EL1, .resetvalue = GET_IDREG(isar, CLIDR) }; +uint64_t dbgtr_el0_kvmidx = +cpreg_to_kvm_id (ENCODE_CP_REG (14 ,0 ,1 ,0 ,5 ,3 ,0 )); +define_one_arm_cp_reg (cpu, &clidr);define_arm_cp_regs (cpu, v7_cp_reginfo);define_debug_regs (cpu); +arm_register_cpreg_mig_tolerance (cpu, dbgtr_el0_kvmidx, +0 ,0 , ToleranceNotOnBothEnds); }else {define_arm_cp_regs (cpu, not_v7_cp_reginfo); }
Signature · 1 line
2.53.0
Re: [PATCH v8 5/6] target/arm/helper: Define cpreg migration tolerance for DGBDTR_EL0
Quoted 9 lines · Eric Auger
We want to remove AArch32 DBGDTRTX which was erroneously exposed. This was attempted by
655659a74a36b("target/arm: Correct encoding of Debug Communications Channel registers") but it was discovered that the removal of this debug register broke forward migration on TCG. Now we have the cpreg migration tolerance infrastructure, we can declare one for the DBGDTRTX. This allow to revert the reinstate patch.Signed-off-by Eric Auger <[email protected]>
PATCH v8 6/6 Revert "target/arm: Reinstate bogus AArch32 DBGDTRTX register for migration compat"
In reply to Eric AugerThis reverts commit 4f2b82f60431 ("target/arm: Reinstate bogus AArch32 DBGDTRTX register for migration compat). We don't need that commit anymore as the AArch32 DBGDTRTX register is declared to
be safe to ignore in the incoming migration stream.
--- target/arm/debug_helper.c | 29 ----------------------------- 1 file changed, 29 deletions(-)
target/arm/debug_helper.c +0 -29
@@ -171,13 +171,6 @@ static void dbgclaimclr_write(CPUARMState *env, const ARMCPRegInfo *ri, env->cp15.dbgclaim &= ~(value &0xFF ); } -static CPAccessResult access_bogus (CPUARMState *env,const ARMCPRegInfo *ri, -bool isread) -{ -/* Always UNDEF, as if this cpreg didn't exist */ -return CP_ACCESS_UNDEFINED ; -} -static const ARMCPRegInfo debug_cp_reginfo[] = {/* * DBGDRAR, DBGDSAR: always RAZ since we don't implement memory mapped
@@ -240,28 +233,6 @@ static const ARMCPRegInfo debug_cp_reginfo[] = { .opc0 = 2, .opc1 = 3, .crn = 0, .crm = 4, .opc2 = 0, .access = PL0_RW, .accessfn = access_tdcc, .type = ARM_CP_CONST, .resetvalue = 0 }, -/* -* This is not a real AArch32 register. We used to incorrectly expose -* this due to a QEMU bug; to avoid breaking migration compatibility we -* need to continue to provide it so that we don't fail the inbound -* migration when it tells us about a sysreg that we don't have. -* We set an always-fails .accessfn, which means that the guest doesn't -* actually see this register (it will always UNDEF, identically to if -* there were no cpreg definition for it other than that we won't print -* a LOG_UNIMP message about it), and we set the ARM_CP_NO_GDB flag so the -* gdbstub won't see it either. -* (We can't just set .access = 0, because add_cpreg_to_hashtable() -* helpfully ignores cpregs which aren't accessible to the highest -* implemented EL.) -* -* TODO: implement a system for being able to describe "this register -* can be ignored if it appears in the inbound stream"; then we can -* remove this temporary hack. -*/ - { .name = "BOGUS_DBGDTR_EL0", .state = ARM_CP_STATE_AA32, - .cp = 14, .opc1 = 3, .crn = 0, .crm = 5, .opc2 = 0, - .access = PL0_RW, .accessfn = access_bogus, - .type = ARM_CP_CONST | ARM_CP_NO_GDB, .resetvalue = 0 },/* * OSECCR_EL1 provides a mechanism for an operating system * to access the contents of EDECCR. EDECCR is not implemented though,
Signature · 1 line
2.53.0
Re: [PATCH v8 6/6] Revert "target/arm: Reinstate bogus AArch32 DBGDTRTX register for migration compat"
Quoted 6 lines · Eric Auger
This reverts commit
4f2b82f60431("target/arm: Reinstate bogus AArch32 DBGDTRTX register for migration compat). We don't need that commit anymore as the AArch32 DBGDTRTX register is declared to
be safe to ignore in the incoming migration stream.Signed-off-by Eric Auger <[email protected]>