[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFCv2 19/20] arm-qmp-cmds: introspection for ID register props
From: |
Cornelia Huck |
Subject: |
[PATCH RFCv2 19/20] arm-qmp-cmds: introspection for ID register props |
Date: |
Fri, 6 Dec 2024 12:22:12 +0100 |
Implement the capability to query available ID register values by
adding SYSREG_* options and values to the cpu model expansion for the
host model, if available.
Excerpt:
(QEMU) query-cpu-model-expansion type=full model={"name":"host"}
{"return": {"model": {"name": "host", "props":
{"SYSREG_ID_AA64PFR0_EL1_EL3": 1224979098931106066,
"SYSREG_ID_AA64ISAR2_EL1_CLRBHB": 0,
../..
So this allows the upper stack to detect available writable ID
regs and the "host passthrough model" values.
[CH: moved SYSREG_* values to host model]
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
TODO: Add the moment there is no way to test changing a given
ID reg field value. ie:
(QEMU) query-cpu-model-expansion type=full model={"name":"host",
"prop":{"SYSREG_ID_AA64ISAR0_EL1_DP":0x13}}
---
target/arm/arm-qmp-cmds.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c
index 3cc8cc738bb0..44d7bf4c80ce 100644
--- a/target/arm/arm-qmp-cmds.c
+++ b/target/arm/arm-qmp-cmds.c
@@ -21,6 +21,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "hw/boards.h"
#include "kvm_arm.h"
#include "qapi/error.h"
@@ -209,6 +210,24 @@ CpuModelExpansionInfo
*qmp_query_cpu_model_expansion(CpuModelExpansionType type,
}
}
+ /* If writable ID regs are supported, add them as well */
+ if (ARM_CPU(obj)->writable_id_regs == WRITABLE_ID_REGS_AVAIL) {
+ ObjectProperty *prop;
+ ObjectPropertyIterator iter;
+
+ object_property_iter_init(&iter, obj);
+
+ while ((prop = object_property_iter_next(&iter))) {
+ QObject *value;
+
+ if (!g_str_has_prefix(prop->name, "SYSREG_")) {
+ continue;
+ }
+ value = object_property_get_qobject(obj, prop->name, &error_abort);
+ qdict_put_obj(qdict_out, prop->name, value);
+ }
+ }
+
if (!qdict_size(qdict_out)) {
qobject_unref(qdict_out);
} else {
--
2.47.0
- [PATCH RFCv2 08/20] arm/cpu: Store aa64smfr0 into the idregs array, (continued)
- [PATCH RFCv2 08/20] arm/cpu: Store aa64smfr0 into the idregs array, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 09/20] arm/cpu: Store id_isar0-7 into the idregs array, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 10/20] arm/cpu: Store id_mfr0/1 into the idregs array, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 11/20] arm/cpu: Store id_dfr0/1 into the idregs array, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 13/20] arm/cpu: Add infra to handle generated ID register definitions, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 12/20] arm/cpu: Store id_mmfr0-5 into the idregs array, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 15/20] arm/cpu: Add generated files, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 16/20] arm/kvm: Allow reading all the writable ID registers, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 18/20] arm/cpu: more customization for the kvm host cpu model, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 17/20] arm/kvm: write back modified ID regs to KVM, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 19/20] arm-qmp-cmds: introspection for ID register props,
Cornelia Huck <=
- [PATCH RFCv2 14/20] arm/cpu: Add sysreg generation scripts, Cornelia Huck, 2024/12/06
- [PATCH RFCv2 20/20] arm/cpu-features: document ID reg properties, Cornelia Huck, 2024/12/06
- Re: [PATCH RFCv2 00/20] kvm/arm: Introduce a customizable aarch64 KVM host model, Eric Auger, 2024/12/12
- Re: [PATCH RFCv2 00/20] kvm/arm: Introduce a customizable aarch64 KVM host model, Eric Auger, 2024/12/12
- Re: [PATCH RFCv2 00/20] kvm/arm: Introduce a customizable aarch64 KVM host model, Daniel P . Berrangé, 2024/12/12