* having a cfg offset) at this moment.
*/
static RISCVCPUProfile RVA22U64 = {
+ .parent = NULL,
.name = "rva22u64",
.misa_ext = RVI | RVM | RVA | RVF | RVD | RVC | RVU,
.priv_spec = RISCV_PROFILE_ATTR_UNUSED,
#define CPU_CFG_OFFSET(_prop) offsetof(struct RISCVCPUConfig, _prop)
typedef struct riscv_cpu_profile {
+ struct riscv_cpu_profile *parent;
const char *name;
uint32_t misa_ext;
bool enabled;
CPURISCVState *env = &cpu->env;
const char *warn_msg = "Profile %s mandates disabled extension %s";
bool send_warn = profile->user_set && profile->enabled;
- bool profile_impl = true;
+ bool parent_enabled, profile_impl = true;
int i;
#ifndef CONFIG_USER_ONLY
}
profile->enabled = profile_impl;
+
+ if (profile->parent != NULL) {
+ parent_enabled = object_property_get_bool(OBJECT(cpu),
+ profile->parent->name,
+ NULL);
+ profile->enabled = profile->enabled && parent_enabled;
+ }
}
static void riscv_cpu_validate_profiles(RISCVCPU *cpu)
profile->user_set = true;
profile->enabled = value;
+ if (profile->parent != NULL) {
+ object_property_set_bool(obj, profile->parent->name,
+ profile->enabled, NULL);
+ }
+
if (profile->enabled) {
cpu->env.priv_ver = profile->priv_spec;
}