qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 00/24] generalize parsing of cpu_model (part 4)


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH 00/24] generalize parsing of cpu_model (part 4)
Date: Thu, 18 Jan 2018 12:31:53 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

(CC'ing linux-user maintainers)

Hi Peter, Igor,

On 01/18/2018 10:10 AM, Peter Maydell wrote:
> On 18 January 2018 at 13:06, Igor Mammedov <address@hidden> wrote:
>> I've looked and such case is rather an exception,
>> I can fix it up in 2 ways:
>> 1st:
>>   target/arm/cpu.h
>>   +#if !defined(CONFIG_USER_ONLY)
>>   +#define TARGET_DEFAULT_CPU_TYPE TYPE_ARM_CPU
>>   +else
>>   +#define TARGET_DEFAULT_CPU_TYPE ARM_CPU_TYPE_NAME("any")
>>   +#endif
> 
> This is weird, because TYPE_ARM_CPU isn't really
> a sensible thing to use for anything, so you've really set
> it up as a "this is only of any use for null-machine.c",
> in which case you should just do that in null-machine.c.
> 
>> or 2nd is to compile in "any" type in system mode
>> (which most targets do), roughly it would amount to:
>>   target/arm/cpu.c
>>   @@ -1671,10 +1671,8 @@ static const ARMCPUInfo arm_cpus[] = {
>>      { .name = "pxa270-b1",   .initfn = pxa270b1_initfn },
>>      { .name = "pxa270-c0",   .initfn = pxa270c0_initfn },
>>      { .name = "pxa270-c5",   .initfn = pxa270c5_initfn },
>>   -#ifdef CONFIG_USER_ONLY
>>      { .name = "any",         .initfn = arm_any_initfn },
>>    #endif
>>   -#endif
>>      { .name = NULL }
>>    };
> 
> This is definitely wrong. We deliberately don't provide "any"
> in system mode, because it's not a sensible thing for users
> to try to use with board emulation. We disabled it some while
> back to avoid users trying it by accident and getting confused.
> 
> In general, for Arm you really need to know which CPU you want
> to use and why. So:
>  linux-user and bsd-user: should use "any"

I disagree on this, since userland binaries are compiled for a specific
arch/ABI/FPU.
Even without worrying about the FPU, it is unlikely the "any" cpu can
run indifferently ARMv6 and ARMv7 binaries.

IMHO ARMv5 should default to arm946, ARMv6  arm1176 and ARMv7 to cortex-a7.

I think we should do the same for linux-user than system and remove the
'any' cpu for ARM.

>  board models: should use whatever CPU that board is designed for
>  null-machine: if it genuinely doesn't care, then pick one at random

Should work :)

Maybe pick the latest/best implemented, hoping this has more features to
cover?

> But there is no single sensible "default CPU type" at an architecture
> level, which is why you can't define a TARGET_DEFAULT_CPU_TYPE
> in target/arm/cpu.h. Any code that thinks it wants that should
> instead be defining it own default that makes sense for that
> context.
> 
> thanks
> -- PMM
> 

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]