<div dir="ltr">Ping for reviews</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 10, 2020 at 5:55 PM Andrea Bolognani <<a href="mailto:abologna@redhat.com">abologna@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 2020-04-09 at 13:03 +0200, Jiri Denemark wrote:<br>
> On Thu, Apr 02, 2020 at 17:03:59 +0800, Zhenyu Zheng wrote:<br>
> > +static int<br>
> > +armCpuDataFromRegs(virCPUarmData *data)<br>
> > +{<br>
> > +    /* Generate human readable flag list according to the order of */<br>
> > +    /* AT_HWCAP bit map */<br>
> > +    const char *flag_list[MAX_CPU_FLAGS] = {<br>
> > +        "fp", "asimd", "evtstrm", "aes", "pmull", "sha1", "sha2",<br>
> > +        "crc32", "atomics", "fphp", "asimdhp", "cpuid", "asimdrdm",<br>
> > +        "jscvt", "fcma", "lrcpc", "dcpop", "sha3", "sm3", "sm4",<br>
> > +        "asimddp", "sha512", "sve", "asimdfhm", "dit", "uscat",<br>
> > +        "ilrcpc", "flagm", "ssbs", "sb", "paca", "pacg"};<br>
> <br>
> I would expect these to be defined in src/cpu_map/arm_features.xml,<br>
> although I'm not sure how well the new features would play with the<br>
> existing ones... What do you think, Andrea?<br>
<br>
You tell me :)<br>
<br>
As you know, the main thing that sets x86 and ARM apart in this area<br>
is that on x86 you can basically mix and match CPU features at your<br>
heart's content, but on ARM this is not (yet) possible: the only<br>
features that you can really control are the SVE-related ones.<br>
<br>
I assume that, at some point further down the line, it will be<br>
possible to control ARM CPU features with a similar level of<br>
granularity as it's currently possible on x86, and at that point<br>
something like<br>
<br>
  <cpu><br>
    <feature name='asimddp' policy='require'/><br>
    <feature name='dcpop' policy='disable'/><br>
  </cpu><br>
<br>
will be possible, but that's certainly not the case now, and<br>
attempting to do so for non-SVE features will result in QEMU refusing<br>
to start.<br>
<br>
With that in mind, I don't think it's a problem to include these<br>
features in cpu_map upfront and report them in the context of the<br>
host CPU: any attempt to use them in guest CPU context will be<br>
blocked by QEMU anyway.<br>
<br>
Perhaps we could go one step further and fail validation in libvirt<br>
until such a time comes when QEMU is able to accept them? That would<br>
make for a more pleasant user experience, I think.<br>
<br>
Do you foresee any potential issues caused by this approach? As I<br>
said it seems to me like it would be fine, but you're the expert when<br>
it comes to the CPU drivers :)<br>
<br>
-- <br>
Andrea Bolognani / Red Hat / Virtualization<br>
<br>
</blockquote></div>