[Buildroot] [PATCH/master 6/7] package/qemu: add BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS string

Arnout Vandecappelle arnout at mind.be
Sat Sep 11 19:39:44 UTC 2021



On 10/09/2021 19:42, Adam Duskett wrote:
> Hey Thomas;
> 
> As briefly discussed on IRC, this is mostly due to x86 discrepancies,
> however, as I do not have access to * every * CPU
> that buildroot + GOI supports, it's better to commit these changes
> now, and if others find issues with their CPU/GOI
> builds, they can submit a patch far easier thanks to this patch series!

 I still think Thomas is right: we should have a mapping for each architecture
option to the Qemu emulation option that corresponds to it.

 In an ideal world, we would have BR2_ARCH_QEMU_CPU that is set in
arch/Config.in.* for all (sub)architectures.

 However, I doubt that anyone is going to take the time to do that (and test it,
without even knowing how to test it because *most* code will run just fine when
the wrong -cpu option is used).

 So, the pragmatic approach is to use this patch.

 Therefore, applied to master, thanks.

 Regards,
 Arnout

> 
> Adam
> 
> On Fri, Sep 3, 2021 at 3:37 PM Thomas Petazzoni
> <thomas.petazzoni at bootlin.com> wrote:
>>
>> Hello Adam,
>>
>> On Fri,  3 Sep 2021 09:20:26 -0700
>> Adam Duskett <aduskett at gmail.com> wrote:
>>
>>> For specific architectures, running qemu in user mode without any additional
>>> options may fail if the host processor does not have the necessary instructions
>>> to properly run qemu in user mode, which results in the following error:
>>> "qemu: uncaught target signal 4 (Illegal instruction) - core dumped"
>>>
>>> CoreI7 is one such architecture that has had consistent auto-build failures.
>>>
>>> Add a new string in qemu/Config.in.host: BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS.
>>> The default for the Corei7 architecture is directly from the OpenEmbedded
>>> project found in meta/conf/machine/include/x86/tune-corei7.inc:
>>> "-cpu Nehalem,check=false." Other architectures may be added to this string at
>>> a later date if other failures occure.
>>>
>>> Signed-off-by: Adam Duskett <aduskett at gmail.com>
>>
>> So on the principle, I'm obviously OK as this is something I have
>> suggested. However, what bothers me here is that we are handling only
>> the Core i7 case, because it caused some issue in the autobuilder.
>>
>> What is qemu doing when no -cpu is provided? Does it emulate the host
>> CPU in this case? If so, then it is going to be wrong in a lot of other
>> cases than Core i7, no?
>>
>> Or put differently, shouldn't we essentially have a value for
>> BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS for pretty much all CPU
>> architectures that we want to support for this use-case ?
>>
>> Thomas
>> --
>> Thomas Petazzoni, co-owner and CEO, Bootlin
>> Embedded Linux and Kernel engineering
>> https://bootlin.com
> _______________________________________________
> buildroot mailing list
> buildroot at lists.buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
> 


More information about the buildroot mailing list