Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1296486imu; Wed, 16 Jan 2019 16:38:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN5l6kCP+gbcbUHVq0MgCPJOFB60lRP4ILE1hpvdOKJwzSLEzrLZtbHrB2CpQnBc6hEOaQA+ X-Received: by 2002:aa7:85d7:: with SMTP id z23mr13075917pfn.205.1547685514067; Wed, 16 Jan 2019 16:38:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547685514; cv=none; d=google.com; s=arc-20160816; b=KowEThpYuLCNOAu7pUcW9zqr1zlW/54jM6p494ag0njFgIP7hH47mylMu9/EB0rsPD RaVI3ORnu2KMo6fdPuvZ73dGg5aqo+wTmYKknTOcnasJb/vruAIytHa5NPRSZgov7bJG Y50jzEXWM4vdwKXndJLnKitOax8F1u/S4i1uH+QdMyX/4xCtx1BvZAtDzDUg5ASbpWHv 24f8tVFMhQ2xCXdX5Xf22IG9fhIyf/uBF5cuk4obY2ChlJFInJUpavES68PZW2wwRVXv UL6l/vK1kL5jPfK6R7HSJHKZJSE7Lgp5iyul87z2XSPy44Pz2Ce/xAfzylx5bu5D/56C qH0A== 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; bh=odEohUFbVzxDIm//mw2WvHs47akqCSyIGxS2ACwv7Zc=; b=sDrXtSN41MlCtLSi7kheW/0EB5WUnHgLacpT6dR3P/M750iCQjtqojlWLQOvkxhnXJ Vp5qbbZNPOab7EE0Fj9hoqJTwSAJO5aaUOeCKIWGin3Etbgf/QaGg+CvuB3dC+cm0R+Y hODHFpJXDflCTfQbx12w0LAP7ptr40Mx/enzXR07KneqyltIKEKFZddCLlUTCDPov0Gq bgLuaJYFSwn21upd9hb8XWvfAbsIYiCPUsQdhYqY1YXJxreFn9S7EhfUWiZ/AKtbQrud aEkZjRY5JL2/tXrhe6gjJatJ2m42g80A3WGBZy8ejPx5/fiTSjDGCsrxpgxJcynoqc5+ WDgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id k19si7222939pgn.20.2019.01.16.16.38.15; Wed, 16 Jan 2019 16:38:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1730002AbfAPVZQ (ORCPT + 99 others); Wed, 16 Jan 2019 16:25:16 -0500 Received: from mga11.intel.com ([192.55.52.93]:32307 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729451AbfAPVYf (ORCPT ); Wed, 16 Jan 2019 16:24:35 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2019 13:24:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,487,1539673200"; d="scan'208";a="117269585" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by fmsmga008.fm.intel.com with ESMTP; 16 Jan 2019 13:24:34 -0800 From: Fenghua Yu To: "Thomas Gleixner" , "Borislav Petkov" , "Ingo Molnar" , "H Peter Anvin" , "Andy Lutomirski" , "Andrew Cooper" , "Ashok Raj" , "Ravi V Shankar" Cc: "linux-kernel" , "x86" , Fenghua Yu Subject: [PATCH v2 1/3] x86/cpufeatures: Enumerate user wait instructions Date: Wed, 16 Jan 2019 13:18:36 -0800 Message-Id: <1547673522-226408-2-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1547673522-226408-1-git-send-email-fenghua.yu@intel.com> References: <1547673522-226408-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 UMONITOR, UMWAIT, and TPAUSE are a set of user wait instructions. UMONITOR arms address monitoring hardware using an address. A store to an address within the specified address range triggers the monitoring hardware to wake up the processor waiting in umwait. UMWAIT instructs the processor to enter an implementation-dependent optimized state while monitoring a range of addresses. The optimized state may be either a light-weight power/performance optimized state (c0.1 state) or an improved power/performance optimized state (c0.2 state). The UMONITOR and UMWAIT operate together to provide power saving in idle. TPAUSE instructs the processor to enter an implementation-dependent optimized state c0.1 or c0.2 state and wake up when time-stamp counter reaches specified timeout. The three instructions may be executed at any privilege level. Availability of the user wait instructions is indicated by the presence of the CPUID feature flag WAITPKG CPUID.0x07.0x0:ECX[5]. Please check the latest Intel Architecture Instruction Set Extensions and Future Features Programming Reference for more details on the instructions and CPUID feature WAITPKG flag. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/cpufeatures.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 6d6122524711..344874df5dc3 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -322,6 +322,7 @@ #define X86_FEATURE_UMIP (16*32+ 2) /* User Mode Instruction Protection */ #define X86_FEATURE_PKU (16*32+ 3) /* Protection Keys for Userspace */ #define X86_FEATURE_OSPKE (16*32+ 4) /* OS Protection Keys Enable */ +#define X86_FEATURE_WAITPKG (16*32+ 5) /* UMONITOR/UMWAIT/TPAUSE Instructions */ #define X86_FEATURE_AVX512_VBMI2 (16*32+ 6) /* Additional AVX512 Vector Bit Manipulation Instructions */ #define X86_FEATURE_GFNI (16*32+ 8) /* Galois Field New Instructions */ #define X86_FEATURE_VAES (16*32+ 9) /* Vector AES */ -- 2.19.1