[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH v2 4/6] target/arm: Make 'any' CPU ju
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH v2 4/6] target/arm: Make 'any' CPU just an alias for 'max' |
Date: |
Tue, 6 Mar 2018 16:03:40 +0000 |
On 6 March 2018 at 15:16, Igor Mammedov <address@hidden> wrote:
> On Tue, 6 Mar 2018 12:55:24 +0000
> Peter Maydell <address@hidden> wrote:
>
>> Now we have a working '-cpu max', the linux-user-only
>> 'any' CPU is pretty much the same thing, so implement it
>> that way.
>>
>> For the moment we don't add any of the extra feature bits
>> to the system-emulation "max", because we don't set the
>> ID register bits we would need to to advertise those
>> features as present.
>>
>> Signed-off-by: Peter Maydell <address@hidden>
>> ---
>> target/arm/cpu.c | 50 +++++++++++++++++++++++----------------------
>> target/arm/cpu64.c | 59
>> ++++++++++++++++++++++++++----------------------------
>> 2 files changed, 54 insertions(+), 55 deletions(-)
>>
>> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
>> index e46ddcc613..c8d3da2140 100644
>> --- a/target/arm/cpu.c
>> +++ b/target/arm/cpu.c
>> @@ -965,9 +965,17 @@ static ObjectClass *arm_cpu_class_by_name(const char
>> *cpu_model)
>> ObjectClass *oc;
>> char *typename;
>> char **cpuname;
>> + const char *cpunamestr;
>>
>> cpuname = g_strsplit(cpu_model, ",", 1);
>> - typename = g_strdup_printf(ARM_CPU_TYPE_NAME("%s"), cpuname[0]);
>> + cpunamestr = cpuname[0];
>> +#ifdef CONFIG_USER_ONLY
>> + /* For backwards compatibility usermode emulation allows "-cpu any",
>> + * which has the same semantics as "-cpu max".
>> + */
>> + cpunamestr = "max";
> shouldn't it be
> if (!strcmp(cpuname[0], "any")) {
> cpunamestr = "max";
> }
Yes. I shuffled the code around a bit and managed to lose the
comparison...
>> @@ -1789,7 +1791,7 @@ static const ARMCPUInfo arm_cpus[] = {
>> { .name = "max", .initfn = arm_max_initfn },
>> #endif
>> #ifdef CONFIG_USER_ONLY
>> - { .name = "any", .initfn = arm_any_initfn },
>> + { .name = "any", .initfn = arm_max_initfn },
> Note,
> 'any' will disappear from "-cpu help"
> but that's probably fine, old users would still be able to use alias
> and new ones won't even suspect about its existence and use 'max'.
Yeah, I guess that's OK.
thanks
-- PMM
- [Qemu-arm] [PATCH v2 0/6] arm: support -cpu max (and gic-version=max), Peter Maydell, 2018/03/06
- [Qemu-arm] [PATCH v2 6/6] hw/arm/virt: Support -machine gic-version=max, Peter Maydell, 2018/03/06
- [Qemu-arm] [PATCH v2 1/6] target/arm: Query host CPU features on-demand at instance init, Peter Maydell, 2018/03/06
- [Qemu-arm] [PATCH v2 2/6] target/arm: Move definition of 'host' cpu type into cpu.c, Peter Maydell, 2018/03/06
- [Qemu-arm] [PATCH v2 5/6] hw/arm/virt: Add "max" to the list of CPU types "virt" supports, Peter Maydell, 2018/03/06
- [Qemu-arm] [PATCH v2 4/6] target/arm: Make 'any' CPU just an alias for 'max', Peter Maydell, 2018/03/06
- [Qemu-arm] [PATCH v2 3/6] target/arm: Add "-cpu max" support, Peter Maydell, 2018/03/06