Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1162992pxb; Thu, 16 Sep 2021 00:48:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwY1uTzMZY/p7oXVYaSiMkJff1OJ2MxCMfzGUkqgrxTDFafbrOzJxIhlkHQbSpUyavSIGbn X-Received: by 2002:a17:906:e094:: with SMTP id gh20mr5045541ejb.252.1631778505307; Thu, 16 Sep 2021 00:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631778505; cv=none; d=google.com; s=arc-20160816; b=lXtsXwWj5X20ziWR7gU75T4DfP2W9HsUKit62gCNiDjUqVKIAFEWZ6CLz4RFblkxjF q4P43er3tOt7SsxYYJu0G5SSXkxsM9eL+LabLKoAO1h5xKzjqD88MLnomNOnags8cVfY Sez4/Hu68E6ljy9rbmnh03DXJGO4oaPZe0N9rpsABmtc3TMosAUAZppzgd6PZZwMjt2n SmWoQlOyNkET3DLlHX+KasB+ohK8XGLTXgiGhLRiDBdFqa6ILQ2iaeSqwRATZ5p+Jmrt /T+ROgrQ1AYLuZVL0uWoFd7OuWXb/MBVulvkxiJxrYNhqPtJBFX/pM0KYPckUvoI+VPa Pl1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=AOEZZ1hPFKkZTRx8d3dmDl1BQ79nbvSmgQmc0jKVXV4=; b=DhAtp+uKCJz6AerSKCSBKFWFgqvQ2HPXIr4AcPKIWKXk3vQft6Dq5K+lZkFa/2nyRl SK0YU3mQeAXj9TVPHil2xdxUR5E2BiOKrmWdDFdic+DC2dbyMjifsWt7wFpBEOQQiuqA cUNlvWym3xXZpUY0N3U1pS4cZF60bjEHDvQ6nNdvlaU/KtkCZqjNgJcTUCcaD2hlLwkj WQxQdcanWs3caXPIPA/cEi3JtTtPoax+oQd2Z91QhQJDVQonWtXO8zHvaTdw1+dJXLS0 u0JiFXmWFhrB/aSWknrHA3H31mciRX7txJ2kZICP6y35VjAPM5+V6ZPXuFH0JCbK+GNx cVHQ== 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 g17si3524423ejm.145.2021.09.16.00.48.00; Thu, 16 Sep 2021 00:48:25 -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 S234769AbhIPHsE (ORCPT + 99 others); Thu, 16 Sep 2021 03:48:04 -0400 Received: from mga12.intel.com ([192.55.52.136]:61638 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233142AbhIPHsD (ORCPT ); Thu, 16 Sep 2021 03:48:03 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10108"; a="202007573" X-IronPort-AV: E=Sophos;i="5.85,297,1624345200"; d="scan'208";a="202007573" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2021 00:46:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,297,1624345200"; d="scan'208";a="545422566" Received: from fedora29.sh.intel.com ([10.239.182.87]) by FMSMGA003.fm.intel.com with ESMTP; 16 Sep 2021 00:46:40 -0700 From: Pengfei Xu To: Shuah Khan , linux-kselftest , linux-kernel Cc: Pengfei Xu , Heng Su , Yu Yu-cheng , Yu Fenghua , Hansen Dave , Luck Tony , Mehta Sohil , Chen Yu C Subject: [RFC PATCH v4 0/2] Introduce XSAVE/XRSTOR self-test Date: Thu, 16 Sep 2021 15:45:31 +0800 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The XSAVE feature set supports the saving and restoring of state components, which is used for process context switching. The state components include x87 state for FPU execution environment, SSE state, AVX state and so on. In order to ensure that XSAVE works correctly, add XSAVE basic test for XSAVE architecture functionality. This patch set tests and verifies the basic functions of XSAVE/XRSTOR in user space; during and after signal processing on the x86 platform, the XSAVE contents of the process should not be changed. This series introduces only the most basic XSAVE tests. In the future, the intention is to continue expanding the scope of these selftests to include more kernel XSAVE-related functionality and XSAVE-managed features like AMX and shadow stacks. ======== - Change from v3 to v4: - Improve the comment in patch 1. - Change from v2 to v3: - Improve the description of patch 2 git log. - Change from v1 to v2: - Improve the cover-letter. (Dave Hansen) Pengfei Xu (2): selftests/xsave: test basic XSAVE architecture functionality selftests/xsave: add xsave test during and after signal handling tools/testing/selftests/Makefile | 1 + tools/testing/selftests/xsave/.gitignore | 3 + tools/testing/selftests/xsave/Makefile | 6 + tools/testing/selftests/xsave/xsave_common.h | 246 ++++++++++++++++++ .../selftests/xsave/xsave_instruction.c | 83 ++++++ .../selftests/xsave/xsave_signal_handle.c | 184 +++++++++++++ 6 files changed, 523 insertions(+) create mode 100644 tools/testing/selftests/xsave/.gitignore create mode 100644 tools/testing/selftests/xsave/Makefile create mode 100644 tools/testing/selftests/xsave/xsave_common.h create mode 100644 tools/testing/selftests/xsave/xsave_instruction.c create mode 100644 tools/testing/selftests/xsave/xsave_signal_handle.c -- 2.20.1