Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1499958pxv; Sat, 10 Jul 2021 06:13:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyiGtJ8niR7lEPy18tiuNO5JMteeVLMv+ODcEUME8JCebnODKnvrnxaP2rWTPud1Hv9X2N X-Received: by 2002:a05:6e02:1d9a:: with SMTP id h26mr19527579ila.308.1625922785574; Sat, 10 Jul 2021 06:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625922785; cv=none; d=google.com; s=arc-20160816; b=sU5wSgdUKwdbgOgjLTszxK9I48sqySDyolKdRb/O3Y+6sFNJQ+lvDauoF6iLg+DuEq XCrr4yMceZZEwmaxiO9Z2Cx3HAxWFtPgaS4TKS39DOR5mkqBa1rvivG02LAe/D2taUTW O0k3ykMIjAyOH39EYl/W0g4nIRhb5F2NILowXWeWiy/G2n74uMcpTwiIl9S/J82du57/ qdmHLxKG3B9uc7n8iUyLRocgrTWQ/zwVEkg9HKwIne/2fE7gkQVZrcf0oxY+xYPJNNB7 ySIYkAe4yooOQuXb4IUsiS3Hh2Nd12hJL7ARup/9+pS5D2KEy1gH42Q+ZPPnYR9dQWqv ftlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=FpwjCitqMfDsTcpgTcnZFDpZr7YvLawURXD/ssnuL2A=; b=lJBTIlh8XH47eUBQPZDPuAyfvJlizxhLzhEEKc6oxeoYZwx1QE7QDdcnxctmC7KEcY A1rbqbNfck0LrmWcA6OrC6E/mbpPqyYiZd+WzIU2PQmS3g/bWhUC+aJDpaFmJpEVZyVS 8AKYookM3OrfCj4afYGKyFaktl69yWVxjMzTZheDhRTzKWF3eTdIrQjbAS5pHerzHwNn nIZhH/Q2lm35pW3nSNjlRBfhtBpI6YzSAelJbSvM9upPeF5PNiV72OFd+ulgWT3uRRmb x60HTK4Y7TGZK3YNEIySWfomFAbGws2Hvb5QNonu5KRKDpE9wpKvbK03GqF2Y/iBNgmB hNnw== 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 b18si9668266iob.19.2021.07.10.06.12.50; Sat, 10 Jul 2021 06:13:05 -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 S232920AbhGJNMd (ORCPT + 99 others); Sat, 10 Jul 2021 09:12:33 -0400 Received: from mga03.intel.com ([134.134.136.65]:52358 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231577AbhGJNL5 (ORCPT ); Sat, 10 Jul 2021 09:11:57 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10040"; a="209867326" X-IronPort-AV: E=Sophos;i="5.84,229,1620716400"; d="scan'208";a="209867326" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2021 06:09:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,229,1620716400"; d="scan'208";a="488742403" Received: from chang-linux-3.sc.intel.com ([172.25.66.175]) by FMSMGA003.fm.intel.com with ESMTP; 10 Jul 2021 06:09:09 -0700 From: "Chang S. Bae" To: bp@suse.de, luto@kernel.org, tglx@linutronix.de, mingo@kernel.org, x86@kernel.org Cc: len.brown@intel.com, dave.hansen@intel.com, thiago.macieira@intel.com, jing2.liu@intel.com, ravi.v.shankar@intel.com, linux-kernel@vger.kernel.org, chang.seok.bae@intel.com Subject: [PATCH v7 18/26] x86/cpufeatures/amx: Enumerate Advanced Matrix Extension (AMX) feature bits Date: Sat, 10 Jul 2021 06:03:05 -0700 Message-Id: <20210710130313.5072-19-chang.seok.bae@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210710130313.5072-1-chang.seok.bae@intel.com> References: <20210710130313.5072-1-chang.seok.bae@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Intel's Advanced Matrix Extension (AMX) is a new 64-bit extended feature consisting of two-dimensional registers and an accelerator unit. The first implementation of the latter is the tile matrix multiply unit (TMUL). TMUL performs SIMD dot-products on four bytes (INT8) or two bfloat16 floating-point (BF16) elements. Here enumerate this hardware capability to be shown as 'amx_tile', 'amx_bf16', and 'amx_int8' in /proc/cpuinfo. Signed-off-by: Chang S. Bae Reviewed-by: Len Brown Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org --- Changes from v4: * Massaged the changelog a bit. --- arch/x86/include/asm/cpufeatures.h | 3 +++ arch/x86/kernel/cpu/cpuid-deps.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 37150b7a8e44..9e9763ec7713 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -386,7 +386,10 @@ #define X86_FEATURE_TSXLDTRK (18*32+16) /* TSX Suspend Load Address Tracking */ #define X86_FEATURE_PCONFIG (18*32+18) /* Intel PCONFIG */ #define X86_FEATURE_ARCH_LBR (18*32+19) /* Intel ARCH LBR */ +#define X86_FEATURE_AMX_BF16 (18*32+22) /* AMX BF16 Support */ #define X86_FEATURE_AVX512_FP16 (18*32+23) /* AVX512 FP16 */ +#define X86_FEATURE_AMX_TILE (18*32+24) /* AMX tile Support */ +#define X86_FEATURE_AMX_INT8 (18*32+25) /* AMX INT8 Support */ #define X86_FEATURE_SPEC_CTRL (18*32+26) /* "" Speculation Control (IBRS + IBPB) */ #define X86_FEATURE_INTEL_STIBP (18*32+27) /* "" Single Thread Indirect Branch Predictors */ #define X86_FEATURE_FLUSH_L1D (18*32+28) /* Flush L1D cache */ diff --git a/arch/x86/kernel/cpu/cpuid-deps.c b/arch/x86/kernel/cpu/cpuid-deps.c index 7f891d2eb52e..9a520ab259ac 100644 --- a/arch/x86/kernel/cpu/cpuid-deps.c +++ b/arch/x86/kernel/cpu/cpuid-deps.c @@ -76,6 +76,9 @@ static const struct cpuid_dep cpuid_deps[] = { { X86_FEATURE_SGX1, X86_FEATURE_SGX }, { X86_FEATURE_SGX2, X86_FEATURE_SGX1 }, { X86_FEATURE_XFD, X86_FEATURE_XSAVE }, + { X86_FEATURE_AMX_TILE, X86_FEATURE_XSAVE }, + { X86_FEATURE_AMX_INT8, X86_FEATURE_AMX_TILE }, + { X86_FEATURE_AMX_BF16, X86_FEATURE_AMX_TILE }, {} }; -- 2.17.1