qemu-devel
[Top][All Lists]
Advanced

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

Re: arm: "max" CPU class hierarchy changes possible?


From: Eduardo Habkost
Subject: Re: arm: "max" CPU class hierarchy changes possible?
Date: Thu, 11 Mar 2021 12:35:53 -0500

On Thu, Mar 11, 2021 at 06:16:52PM +0100, Claudio Fontana wrote:
> On 3/11/21 5:18 PM, Paolo Bonzini wrote:
> > On 11/03/21 16:02, Peter Maydell wrote:
> >> On Thu, 11 Mar 2021 at 14:27, Claudio Fontana <cfontana@suse.de> wrote:
> >>> the "max" cpu in x86 and s390 is a class,
> >>>
> >>> and then "host" has "max" as parent.
> >>>
> >>> This would be a convenient setup for ARM too, as it would allow to put 
> >>> common code between kvm and tcg in the "max" class,
> >>> and allow "host" to specialize the behavior for KVM (and in the future 
> >>> HVF probably).
> >>>
> >>> Would changing the class hierarchy this way be acceptable, cause any 
> >>> problems?
> >>
> >> It's not clear to me why 'host' would be a subtype of 'max':
> >> that doesn't seem like an obvious relationship.
> > 
> > On x86, "-cpu host" is essentially the same as "-cpu max" with the only 
> > difference that it errors out on TCG.  So:
> > 
> > - with TCG: "-cpu max" enables all that can be emulated, "-cpu host" fails
> > 
> > - with KVM: "-cpu max" enables all that can be virtualized, "-cpu host" 
> > does the same
> > 
> > Paolo
> > 
> 
> Maybe Peter you could clarify similarly what the intended meaning of "max" is 
> on ARM?
> 
> TCG: for aarch64, the starting point seems to be Cortex-A57, and then lots of 
> other features are added on top of it,
> and for non-aarch64, the starting point seems to be Cortex-A15, plus 
> "old-style VFP short-vector support".
> 
> Is the intention to enable all that can be emulated here too, like for X86?
> 
> 
> KVM: (aarch64-only): aarch64_max_initfn():
> 
> The following comment in the code seems wrong to me:
> 
> /* -cpu max: if KVM is enabled, like -cpu host (best possible with this 
> host); */
> 
> This is not exactly true:
> 
> "-cpu max" calls kvm_arm_set_cpu_features_from_host(), (which checks 
> "dtb_compatible", and if not set gets the features from the host, if set ...?)
> After that, calls aarch64_add_sve_properties() and then adds also 
> "svw-max-vq". This code is common with TCG.
> 
> In the case of cpu host instead,
> 
> "-cpu host" calls kvm_arm_set_cpu_features_from_host(), same as max, then 
> calls aarch64_add_sve_properties() but does NOT add "svw-max-vq".
> 
> Is this a bug?
> 
> Are "max" and "host" for KVM supposed to be the same like with x86?

Note that even on x86 "max" and "host" are allowed to be
different, because they have different purposes.

This can happen if a feature is supported by the host software
and hardware (so it will be included in "max") but can't be
enabled by default on "host" for some reason (e.g. if a feature
doesn't work out of the box without extra configuration options).

-- 
Eduardo




reply via email to

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