Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1453149pxb; Tue, 26 Oct 2021 09:15:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw509QlT1Mh7KJYJ88nLVqxG1P3awTKTbcUV3XRn21IPx197U0E0m4gSfAB3uqxtaKn4Huk X-Received: by 2002:a05:6402:26cb:: with SMTP id x11mr15390084edd.198.1635264941213; Tue, 26 Oct 2021 09:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635264941; cv=none; d=google.com; s=arc-20160816; b=HR0Tj3Go+Z7JmyztdHNi/HCsh6ALnGWG4/vcnm9uQijGrnaZ3vUw5K3VJ9cJYLR9l0 2ZcrXsfDmmKqKSyp0ixFpWApYIXJ79kLIK0aHXVkCwpFapn/Q0rG4pnA++YqSyAMyxWw aY+1qRCYe+gwpW2LgF0qqapoec+vsZcdu2vKibdTgp5j248uGhtYv6GUMRc3tteVuzGs bGKbehKjTpM8BddlRwPVeLnCVbAAUigcWjqEWu82i7N7ySEdm3NFgYtT8M9aVzM5JUIV lI7FXh3EQnGrWZTS+qlw9kW5QGoyPKdwBqtQiVJCaels3iM6A1cTYJRwqK8n1KXqVRFX eeNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:from:cc:to:subject; bh=3TI0o8q+SHeUdTZl5SvtcKEK5ROwyQ56LY90cBSz4lE=; b=fxDZAXkd2IrlPnSABaDGclZ4eH/+e9xe3nsBcL5w1ZX7G9YFa6LwVlz4Q5g6pV8rvL 77m9xs4SX2NlqooN9x03kR/tuUqAelCpErn6P8N+I3u8d0gBhTsCzQFEnfaZXd8xvDs2 PZqOee77gojIGOpKLvD4QjL3qyW1QOuO2r+lauzQRD3/qSzyo5J4PV6zjeOMGAltPbTy ygvVSpMXbIz1Spk8XwwVFZSf5gmx1QYvBWlugPcmNcULvLyy3lX3qBSPfS0TapK4QEPP FgYLmC/+hEEsfxYvj3hDE2UF3gcEReT+4mvQYv0x9yW6WGQRWYnYg/0jdzQv5gYvVqlU 8UtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id he14si35329005ejc.350.2021.10.26.09.15.14; Tue, 26 Oct 2021 09:15:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234899AbhJZM1k (ORCPT + 99 others); Tue, 26 Oct 2021 08:27:40 -0400 Received: from mga04.intel.com ([192.55.52.120]:8643 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234359AbhJZM1i (ORCPT ); Tue, 26 Oct 2021 08:27:38 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="228647488" X-IronPort-AV: E=Sophos;i="5.87,182,1631602800"; d="scan'208";a="228647488" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 05:25:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,182,1631602800"; d="scan'208";a="486160664" Received: from davehans-spike.ostc.intel.com (HELO localhost.localdomain) ([10.165.28.105]) by orsmga007.jf.intel.com with ESMTP; 26 Oct 2021 05:25:03 -0700 Subject: [PATCH 0/2] selftest/x86: AMX CPU state management tests To: dave.hansen@intel.com Cc: Dave Hansen , chang.seok.bae@intel.com, tglx@linutronix.de, x86@kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org From: Dave Hansen Date: Tue, 26 Oct 2021 05:25:23 -0700 Message-Id: <20211026122523.AFB99C1F@davehans-spike.ostc.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Intel Advanced Matrix Extensions (AMX) are a new set registers and ISA. They are conceptually similar to the earlier AVX and SSE ISA. But, the registers as a whole are *really* big: ~8k verus 2k for AVX-512. Those amply-sized registers present some potential problems with task_struct and signal stack bloat. To fix those issues, most of the new AMX state is dynamically allocated with the help of a new CPU feature. This new selftest exercises the new dynamic allocation ABI and also ensures that AMX state is properly context-switched. Processors that support AMX (Sapphire Rapids) are not publicly available. The kernel support needed to run these tests is not upstream. This selftest was developed against this tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git/log/?h=x86/fpu These tests were primarily written by Chang Bae. He's busy working on the real kernel support, so I stole these and cleaned them up a bit. Chang S. Bae (2): selftest/x86/amx: Test cases for the AMX state management selftest/x86/amx: Add context switch test tools/testing/selftests/x86/Makefile | 2 +- tools/testing/selftests/x86/amx.c | 851 +++++++++++++++++++++++++++ 2 files changed, 852 insertions(+), 1 deletion(-) Signed-off-by: Chang S. Bae Signed-off-by: Dave Hansen Cc: Thomas Gleixner Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-kselftest@vger.kernel.org