Re: [PATCH v9 4/5] x86/cpuid: fix unbootable VMs by really inlining memcmp() in hypervisor_cpuid_base()

From: Mauricio Faria de Oliveira

Date: Tue Sep 15 2026 - 20:58:00 EST


On 2026-09-15 21:04, Borislav Petkov wrote:
> On Tue, Sep 15, 2026 at 08:49:27PM -0300, Mauricio Faria de Oliveira wrote:
>> IMO a fix in the source file is clearer, less obfuscated than in a
>> Makefile (and the source file has to be changed anyway).
>
> No, with the build option you only need to touch the Makefile which contains
> the build directives for the objects which contain hypervisor_cpuid_base() and
> xen_prepare_pvh().

IIUIC, the source file would also be touched for changing
__builtin_memcmp() into the open-coded comparison suggested earlier, no?
(the 3x u32-based comparisons.) And that is the code which would require
-fno-builtin-memcmp in a Makefile.

>> It also has the potential advantage that, if the Makefile change slips in
>> a future change/refactor, the issue shouldn't reappear.
>
> Yes, that is possible.
>
>> Either way, please let me know and I can certainly change the patch.
>
> Ok, let's do the explicit thing - the difference between the solutions is not
> that earth-shattering.

Ok, I think this closes the feedback and discussion so far; I'll send
v10.

Thanks again,

>
> Thx.

--
Mauricio