[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/7] target/arm/cpu: spe: Add an option to turn on/off vSPE s
From: |
Richard Henderson |
Subject: |
Re: [PATCH 3/7] target/arm/cpu: spe: Add an option to turn on/off vSPE support |
Date: |
Fri, 14 Aug 2020 12:15:29 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 8/7/20 1:10 AM, Haibo Xu wrote:
> +static void arm_set_spe(Object *obj, bool value, Error **errp)
> +{
> + ARMCPU *cpu = ARM_CPU(obj);
> +
> + if (value) {
> + if (kvm_enabled() && !kvm_arm_spe_supported()) {
> + error_setg(errp, "'spe' feature not supported by KVM on this
> host");
> + return;
> + }
> + set_feature(&cpu->env, ARM_FEATURE_SPE);
> + } else {
> + unset_feature(&cpu->env, ARM_FEATURE_SPE);
> + }
> + cpu->has_spe = value;
> +}
I think you want to simply set cpu->has_spe here, and leave the adjustment of
ID_AA64DFR0 to a finalize routine. Because there are multiple values that
PMSVer can take.
Once the get/set routines are only setting a flag on ARMCPU, you can use a
simpler property interface:
static Property arm_cpu_spe_property =
DEFINE_PROP_BOOL("spe", ARMCPU, has_spe, true);
qdev_property_add_static(DEVICE(obj), &arm_cpu_spe_property);
The finalize routine would be called from arm_cpu_finalize_features(), much
like the existing arm_cpu_sve_finalize().
Since you're only registering the spe property when the selected cpu supports
spe, the finalize routine only needs to set PMSVer to 0 to turn it off,
preserving the initial enabled value of 1 or 2.
r~
- Re: [PATCH 6/7] hw/arm/virt: spe: Add SPE fdt binding for virt machine, (continued)
Re: [PATCH 6/7] hw/arm/virt: spe: Add SPE fdt binding for virt machine, Auger Eric, 2020/08/29
[PATCH 3/7] target/arm/cpu: spe: Add an option to turn on/off vSPE support, Haibo Xu, 2020/08/07
Re: [PATCH 3/7] target/arm/cpu: spe: Add an option to turn on/off vSPE support, Andrew Jones, 2020/08/10
Re: [PATCH 3/7] target/arm/cpu: spe: Add an option to turn on/off vSPE support,
Richard Henderson <=
[PATCH 7/7] target/arm/cpu: spe: Enable spe to work with host cpu, Haibo Xu, 2020/08/07
- Re: [PATCH 7/7] target/arm/cpu: spe: Enable spe to work with host cpu, Andrew Jones, 2020/08/10
- Re: [PATCH 7/7] target/arm/cpu: spe: Enable spe to work with host cpu, Haibo Xu, 2020/08/10
- Re: [PATCH 7/7] target/arm/cpu: spe: Enable spe to work with host cpu, Andrew Jones, 2020/08/11
- Re: [PATCH 7/7] target/arm/cpu: spe: Enable spe to work with host cpu, Haibo Xu, 2020/08/11
- Re: [PATCH 7/7] target/arm/cpu: spe: Enable spe to work with host cpu, Richard Henderson, 2020/08/14
- Re: [PATCH 7/7] target/arm/cpu: spe: Enable spe to work with host cpu, Andrew Jones, 2020/08/15
Re: [PATCH 0/7] target/arm: Add vSPE support to KVM guest, Andrew Jones, 2020/08/10
Re: [PATCH 0/7] target/arm: Add vSPE support to KVM guest, Auger Eric, 2020/08/31