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

[PATCH] x86emul: rework compiler probing in the test harness


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 2 Mar 2023 15:28:19 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kfm9uMF70+d2IOZPPQI5T/zd8bek/4f4z0JwNpGc9Rs=; b=hedWNQuXyJNc+G7aBxlnzToUyTNz0lvlY8gjltKRQ/BlVNXyxLFZr4dLE1bHClgHBtQk7SRp6IcdRsVFetJAIrqi0ixFtzwVKEGLWcqcGnfY2ozIRdxPyLVsQ/7ImkINzJ2cxvYbSPTNqQnOjrEnbGoaBverKawwHriI9nAppaKkgHHbK2+iq/NmgGJnec8XqDv+z8HrsaRidwh23toyUrBPggbQPqcWe80pvnTsUi6WaeURjS1EJ9pJgzxz4ne36jrdNasOeXGiHMLrMMyCGJ6xlIbwNuPoOiXbzdkYWyTbji5f0D6Ox881hEmDrkBoHnL2efYjtRZERldk/Sv3cA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H0GDSqaVY/pX9mHYKbYDouZRGugFBxGu4C73OyS5IRNv0pFraUCL8aAxd71EUhyZsPS6YDTWU+IAdX8678d8qb1mUoCC+5BOI98HMfqnyFFmRf3rcJEBh1gvdbmCDa6aLMtF6CZrzEjSVlsWi6g6J/tW991nOHB+lOuqT6pKbdNaEs5v0tQIxiO0ApMwgwSkhznsagCZUSsvTHbdAOfe3AHaPRr0aeZthylhyeYC+JnWkTs8AMiFP5vEg09ke12IwsILzn6Q6TRHogBiYtqezpYPXYjvFHiQL/qoBYoyyTpXFHnr2OIK5NnE04o+kYnWNDm/LZZJFCMU3WnsZJhIWQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 02 Mar 2023 14:28:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Checking for what $(SIMD) contains was initially right, but already the
addition of $(FMA) wasn't. Later categories (correctly) weren't added.
Instead what is of interest is anything the main harness source file
uses outside of suitable #if and without resorting to .byte, as that's
the one file (containing actual tests) which has to succeed in building.
The auxiliary binary blobs we utilize may fail to build; the resulting
empty blobs are recognized and reported as "n/a" when the harness is
run.

Note that strictly speaking we'd need to probe the assembler. We assume
that a compiler knowing of a certain ISA extension is backed by an
equally capable assembler.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
A little while ago this would probably have enabled osstest to actually
build the harness. Luckily meanwhile a new enough gcc is in use there
to be unaffected by the inappropriate checking.

--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -104,11 +104,13 @@ TARGET-y := $(TARGET)
 
 ifeq ($(filter run%,$(MAKECMDGOALS)),)
 
-define simd-check-cc
+define isa-check-cc
 TARGET-$(shell echo 'int i;' | $(CC) -x c -c -o /dev/null -m$(1) - || echo y) 
:=
 endef
 
-$(foreach flavor,$(SIMD) $(FMA),$(eval $(call simd-check-cc,$(flavor))))
+ISA := bmi bmi2 tbm sse4.1 sse4.2 sse4a avx avx2 f16c
+ISA += $(addprefix avx512,f bw dq 4fmaps)
+$(foreach isa,$(ISA),$(eval $(call isa-check-cc,$(isa))))
 
 # Also explicitly check for {evex} pseudo-prefix support, which got introduced
 # only after AVX512F and some of its extensions.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.