Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp8012ybt; Fri, 12 Jun 2020 17:47:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQtTGqFWImwVRH+g1qRt0easUeyqTYULeyxFIhYxp55hwHWVQ5VLdRz6BQxCJbWYMMpD3H X-Received: by 2002:aa7:c41a:: with SMTP id j26mr14586318edq.13.1592009226765; Fri, 12 Jun 2020 17:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592009226; cv=none; d=google.com; s=arc-20160816; b=x+WD6tDpHZm8jWvc//1w5AjtWPbp39tdQ2avIfljW3JFrPIIOwUlBxCpR8jqrjoLy5 vTy+Csu4QzoXhiCvl6kqinb2T1WJheamfcgkQX20SupRm2Yi56LI74ouMLHxPf0V7ypE dpcV/EMkh2b5xH8XjxxUGrRDlfPAASg0HsZspdJqb15qhJjxyNf0iosr+hGrXHvpvbc4 kiUQ+AAJDaZ3Ew2UKqGGzUedvHrmv9hGsgst1/MGVsIWBLwnx3mENv8jiRWXQl78cIwD 85AnxAL1xwscfpv3/q4Eh+BE5CvfL95Q4SpWJ7YRESzHWQ7KAN5w6cdFI6XTnSYJzIU/ WHoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=k2Cf1TEvnc3dt8cLNG0MdAt+GXJgZUWftW8sKc2zdRs=; b=iVaNTiTYXPSGTLMMHu86KulX5glBTWqAL72tikuZB+VPMYcRaQinteS8CpTAU4MppT czzliE2LCrnlTzwGVsZR0Oxm7MtZZ1h0qszyV8p4uLZY8/ACMHz12ackr3urWrEiKG8c GB1zN3oFr2uBJ4hs3KDqUx4nTQhdPxwnagCQa6u3E16JJXc/1lsTr51WGS7QNS+1teRk ONtwYlZJvxvjAHc4LDYLeGW1RMC8zfgpn/0XrlCH4GGidYOHeVGED+JZtDTxRVQ1SIIq 5VfkoR9NUxbcsftDorZ0D4QQ2ppeEUuXSov93PQZSMKW9di+HCoiv0enjtqHGdS5V5CB rumw== 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 f6si4759006eds.91.2020.06.12.17.46.44; Fri, 12 Jun 2020 17:47:06 -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 S1726462AbgFMAly (ORCPT + 99 others); Fri, 12 Jun 2020 20:41:54 -0400 Received: from mga12.intel.com ([192.55.52.136]:1253 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbgFMAlw (ORCPT ); Fri, 12 Jun 2020 20:41:52 -0400 IronPort-SDR: jyIoQ+8Ap5Y1kMFcA2OcT5J1WxH+E/+KIWBW4+x0xruokZzoy9UCFklC1FtZIe0kqPRpRrLY/2 75+k72m4bPLg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2020 17:41:51 -0700 IronPort-SDR: 4orzCDAr1Fl3Ky9nsuJWgNVzEv2YMKhwcYsHeXc7cdLcl0UjddUkuIdJogemAnGPNbBwO+yPWy AdJOE7RSWEhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,505,1583222400"; d="scan'208";a="261011211" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by orsmga007.jf.intel.com with ESMTP; 12 Jun 2020 17:41:50 -0700 From: Fenghua Yu To: "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "H Peter Anvin" , "David Woodhouse" , "Lu Baolu" , "Frederic Barrat" , "Andrew Donnellan" , "Felix Kuehling" , "Joerg Roedel" , "Dave Hansen" , "Tony Luck" , "Ashok Raj" , "Jacob Jun Pan" , "Dave Jiang" , "Yu-cheng Yu" , "Sohil Mehta" , "Ravi V Shankar" Cc: "linux-kernel" , "x86" , iommu@lists.linux-foundation.org, "amd-gfx" , "linuxppc-dev" , Fenghua Yu Subject: [PATCH v2 05/12] x86/cpufeatures: Enumerate ENQCMD and ENQCMDS instructions Date: Fri, 12 Jun 2020 17:41:26 -0700 Message-Id: <1592008893-9388-6-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1592008893-9388-1-git-send-email-fenghua.yu@intel.com> References: <1592008893-9388-1-git-send-email-fenghua.yu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Work submission instruction comes in two flavors. ENQCMD can be called both in ring 3 and ring 0 and always uses the contents of PASID MSR when shipping the command to the device. ENQCMDS allows a kernel driver to submit commands on behalf of a user process. The driver supplies the PASID value in ENQCMDS. There isn't any usage of ENQCMD in the kernel as of now. The CPU feature flag is shown as "enqcmd" in /proc/cpuinfo. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- v2: - Re-write commit message (Thomas) arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/cpuid-deps.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 02dabc9e77b0..4469618c410f 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -351,6 +351,7 @@ #define X86_FEATURE_CLDEMOTE (16*32+25) /* CLDEMOTE instruction */ #define X86_FEATURE_MOVDIRI (16*32+27) /* MOVDIRI instruction */ #define X86_FEATURE_MOVDIR64B (16*32+28) /* MOVDIR64B instruction */ +#define X86_FEATURE_ENQCMD (16*32+29) /* ENQCMD and ENQCMDS instructions */ /* AMD-defined CPU features, CPUID level 0x80000007 (EBX), word 17 */ #define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* MCA overflow recovery support */ diff --git a/arch/x86/kernel/cpu/cpuid-deps.c b/arch/x86/kernel/cpu/cpuid-deps.c index 3cbe24ca80ab..3a02707c1f4d 100644 --- a/arch/x86/kernel/cpu/cpuid-deps.c +++ b/arch/x86/kernel/cpu/cpuid-deps.c @@ -69,6 +69,7 @@ static const struct cpuid_dep cpuid_deps[] = { { X86_FEATURE_CQM_MBM_TOTAL, X86_FEATURE_CQM_LLC }, { X86_FEATURE_CQM_MBM_LOCAL, X86_FEATURE_CQM_LLC }, { X86_FEATURE_AVX512_BF16, X86_FEATURE_AVX512VL }, + { X86_FEATURE_ENQCMD, X86_FEATURE_XSAVES }, {} }; -- 2.19.1