@@ -870,6 +870,8 @@
#
# @num-watchpoints: Number of watchpoints (default: 0)
#
+# @num-pmu-counters: Number of PMU counters (default: 0, PMU disabled)
+#
# Since: FIXME
##
{ 'struct': 'RmeGuestProperties',
@@ -877,7 +879,8 @@
'*personalization-value': 'str',
'*sve-vector-length': 'uint32',
'*num-breakpoints': 'uint32',
- '*num-watchpoints': 'uint32' } }
+ '*num-watchpoints': 'uint32',
+ '*num-pmu-counters': 'uint32' } }
##
# @ObjectType:
@@ -24,7 +24,8 @@ OBJECT_DECLARE_SIMPLE_TYPE(RmeGuest, RME_GUEST)
#define RME_MAX_BPS 0x10
#define RME_MAX_WPS 0x10
-#define RME_MAX_CFG 4
+#define RME_MAX_PMU_CTRS 0x20
+#define RME_MAX_CFG 5
typedef struct RmeGuest RmeGuest;
@@ -35,6 +36,7 @@ struct RmeGuest {
uint32_t sve_vl;
uint32_t num_wps;
uint32_t num_bps;
+ uint32_t num_pmu_cntrs;
};
struct RmeImage {
@@ -157,6 +159,13 @@ static int rme_configure_one(RmeGuest *guest, uint32_t cfg, Error **errp)
args.num_wrps = guest->num_wps;
cfg_str = "debug parameters";
break;
+ case KVM_CAP_ARM_RME_CFG_PMU:
+ if (!guest->num_pmu_cntrs) {
+ return 0;
+ }
+ args.num_pmu_cntrs = guest->num_pmu_cntrs;
+ cfg_str = "PMU";
+ break;
default:
g_assert_not_reached();
}
@@ -378,6 +387,8 @@ static void rme_get_uint32(Object *obj, Visitor *v, const char *name,
value = guest->num_bps;
} else if (strcmp(name, "num-watchpoints") == 0) {
value = guest->num_wps;
+ } else if (strcmp(name, "num-pmu-counters") == 0) {
+ value = guest->num_pmu_cntrs;
} else {
g_assert_not_reached();
}
@@ -410,6 +421,9 @@ static void rme_set_uint32(Object *obj, Visitor *v, const char *name,
} else if (strcmp(name, "num-watchpoints") == 0) {
max_value = RME_MAX_WPS;
var = &guest->num_wps;
+ } else if (strcmp(name, "num-pmu-counters") == 0) {
+ max_value = RME_MAX_PMU_CTRS;
+ var = &guest->num_pmu_cntrs;
} else {
g_assert_not_reached();
}
@@ -456,6 +470,11 @@ static void rme_guest_class_init(ObjectClass *oc, void *data)
rme_set_uint32, NULL, NULL);
object_class_property_set_description(oc, "num-watchpoints",
"Number of watchpoints");
+
+ object_class_property_add(oc, "num-pmu-counters", "uint32", rme_get_uint32,
+ rme_set_uint32, NULL, NULL);
+ object_class_property_set_description(oc, "num-pmu-counters",
+ "Number of PMU counters");
}
static const TypeInfo rme_guest_info = {
Pass the num_cntrs parameter to Realm creation. These parameters contribute to the initial Realm measurement. Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> --- qapi/qom.json | 5 ++++- target/arm/kvm-rme.c | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-)