[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH 4/6] target/arm: Add "-cpu max" suppo
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH 4/6] target/arm: Add "-cpu max" support |
Date: |
Fri, 26 Jan 2018 14:33:21 +0000 |
On 26 January 2018 at 14:29, Philippe Mathieu-Daudé <address@hidden> wrote:
> Hi Peter,
>
> On 12/07/2017 03:14 PM, Peter Maydell wrote:
>> Add support for "-cpu max" for ARM guests. This CPU type behaves
>> like "-cpu host" when KVM is enabled, and like a system CPU with
>> the maximum possible feature set otherwise. (Note that this means
>> it won't be migratable across versions, as we will likely add
>> features to it in future.)
>>
>> Signed-off-by: Peter Maydell <address@hidden>
>> ---
>> +#ifndef TARGET_AARCH64
>> +/* -cpu max: if KVM is enabled, like -cpu host (best possible with this
>> host);
>> + * otherwise, a CPU with as many features enabled as our emulation supports.
>> + * The version of '-cpu max' for qemu-system-aarch64 is defined in cpu64.c;
>> + * this only needs to handle 32 bits.
>> + */
>> +static void arm_max_initfn(Object *obj)
>> +{
>> + ARMCPU *cpu = ARM_CPU(obj);
>> +
>> + if (kvm_enabled()) {
>> + kvm_arm_set_cpu_features_from_host(cpu);
>> + } else {
>> + cortex_a15_initfn(obj);> + /* In future we might add feature
>> bits here even if the
>> + * real-world A15 doesn't implement them.
>> + */
>
> Why not use arm_any_initfn() here?
That function (and the 'any' cpu) are deliberately only
included in the linux-user binaries, not the system-emulation binaries.
(Also arm_any_initfn() only initializes userspace-visible stuff, it
doesn't provide ID register values etc for kernel-visible things.)
> Actually what seems cleaner is to move "any" features here, and kill the
> "any" cpu, using "max" for this purpose.
We can't kill 'any', that would break back-compatibility
of command lines.
thanks
-- PMM