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

[PATCH] x86emul/test: improve failure location identification for FMA sub-test


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 14 Jun 2022 18:03:23 +0200
  • 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=wNT607gGynGLKSl3fNju64xy8DuM0t2mTHdyyuRaUGk=; b=n1lR0BG03u6Lzm6BeVJlvhsiJmVfyQ+2viPqldo1xiPpnfIivuV/cFpCJaMlCCQBALkIHUMAMFhQBH9EzJTZdTqGqGsbC7ECFIkbyVaQ8K2w8n2UzIPXmewCN/XHezSf+sQWzX73k3Yolr+pKX3ylefmGXUDNnKuD+s3KulpgzP1P7TSfXmYz8Xhner7TBtYHP9zmWJRsGMgLR32Zmih6NoNHjDTk2Etxgxmtx/Rin7TBL9zAlMX/Bx20d8/Ww+xTH5UTsPikvJG+XFzuTVAgNWdmlgXzmRnJtnmH4FiU8XSLEnnTeC+4VQNAgq0SeqtMlBQKYU1KzuITeHoUj1fFw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ghBbnOwMRoqmZ2/u3lCezeFZXbFiQ9iuUJZWfnOe/7VEOD3VAOA62xjY9HboHmgUpdXqRIIrNPvOPCv7zXNKrlefM8Wp3O+X7KINrqpO7IWvtoxZ37PWpWaGhkHWXjUkmXLo7cSNtWEnBo+1s1wbggAC9xmjZ45D804n3v/9Cs+B3bsMSlorM+PENbxrKQClccjPly/qMZfLGP0H4942OgQ1LDmo+QFm6g2WJAvNryF9ktXn+nQsMsovkfnZmIQLZrGwUGErEoiSt+6C7gIafy3COQvmXchjvoggNn7NsdnEee8k4Z+K05Kly0mFbONzj9k0WQRm+kiNZFu6XATnWw==
  • 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: Tue, 14 Jun 2022 16:03:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

When some FMA set of insns is included in the base instruction set (XOP,
AVX512F, and AVX512-FP16 at present), simd_test() simply invokes
fma_test(), negating its return value. In case of a failure this would
yield a value close to 4G, which doesn't lend itself to easy
identification of the failing test case. Recognize the case in
simd_check_regs() and emit alternative output identifying FMA.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -259,7 +259,10 @@ static bool simd_check_regs(const struct
 {
     if ( !regs->eax )
         return true;
-    printf("[line %u] ", (unsigned int)regs->eax);
+    if ( (int)regs->eax > 0 )
+        printf("[line %u] ", (unsigned int)regs->eax);
+    else
+        printf("[FMA line %u] ", (unsigned int)-regs->eax);
     return false;
 }
 



 


Rackspace

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