Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp846918ybi; Thu, 30 May 2019 07:39:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMkAJNmCU6Vu9B3yZaHRkOnBWLlyPb90NnkdXtXyh61EQ0hd/UyObbvC6NZkyi/SL3hszZ X-Received: by 2002:a17:90a:62cb:: with SMTP id k11mr3914434pjs.26.1559227157996; Thu, 30 May 2019 07:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559227157; cv=none; d=google.com; s=arc-20160816; b=xIFhzSuHmGqNSfmGNNcn91olBHI7D1MbcYo8DwaEPNrDRyaAvYtNStlGuTECcz+7o0 upzCIZXUt/j/nMTxBBgPvYzognYJvQilskrpp2E2MXistHirxYGjPI09r5HEnzjzK22e y3++r2TOn2G9PV1ww4EAsMP9O0AUsIHTdR1NE73fv/rcoxcfawRAPpDVkgHghEyn/wAN sIQqcnw6/9eZYW1VY0iXg5GrT2MxR8Q0cIZQuPZmPu2OKRDDvGHN3g2Z+qA/YVprpHMf 5L7YT/BqWrmZR/QHpAb99LQsGncLGCezonblkg1adnWEM7RmAugBnqnH706jx6dtRF2f XQkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BDWtQFm+WAzDqApfOL3f1+PtlUxOkj1j4sNRaB1SPIU=; b=PbrGyzYnUeSGXicpUu4cJrXqjYw3fYBxwPVmvUq8iYHBHIuRPk+91+t1/brXdRo3zy 2N1L6dKDx/7MKC56PmlXys4vxseKYXjcgIAETrkAfSYw76y1hRb/JSaYrdf5yeBVHE0V AnTWCJ6oLbtjqFOvoKBGR6+fAlJL2JIzCkVb00W014MZbZhJKkhPh3wrnvgqrnTUxftp wz4oB1gs1qlkHBa7VydN9zSLulkkMdoEUmgib31Yza2AXiB9zmrEbpKMJllGWgxy0vp/ Bw9vfy3+sqgP2nt8moDMXV8wDLnYjN2ns7Mo0sEkwzWUGE98a9KKNwrjseD1d/sq6p9I 223g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=hWSVtcjJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si3343321pff.102.2019.05.30.07.39.01; Thu, 30 May 2019 07:39:17 -0700 (PDT) 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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=hWSVtcjJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbfE3Ohr (ORCPT + 99 others); Thu, 30 May 2019 10:37:47 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35817 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbfE3Ohr (ORCPT ); Thu, 30 May 2019 10:37:47 -0400 Received: by mail-wm1-f67.google.com with SMTP id c6so1063402wml.0 for ; Thu, 30 May 2019 07:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BDWtQFm+WAzDqApfOL3f1+PtlUxOkj1j4sNRaB1SPIU=; b=hWSVtcjJZOIrECbWF+cqlhzrgoPipyWe7boEc6ikHzB+um9Z11/GN2zX6GvWr+WT/g m8ROPVjiHKyM/M50lUjpBUzhgt8MVkxnLpucQCCI1szffFHXQsKIWOW2HQWVV2xn5mnE gxWYtWwhLwAodwWEPfuH61lkIQMGd4RrC/b9mVdwwa98izPl3EycEvLa9qOXoRuMrvvq 0wXbDVCAEMVvsS/HHafIwkc5WfSg1FFSquxxeWrNpNLTrtk9vnqB8FESdcmUzbH3ITa4 b13XGs2XExYTn7Apk66yJGKmHuroJtYlDHpRCQ8/SpFECgo6WODjck/hJ6wTDg+uIVDG izgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BDWtQFm+WAzDqApfOL3f1+PtlUxOkj1j4sNRaB1SPIU=; b=q28qb7RS93g6ZKT2zHEDEehCYeaE8nJUV0r6j9SEIDavag0egtkVP8TQqz7IZuEGus nWZ4ls1HBH+sBmWOOeHmjgLvY1glYiDRk+Kwu8RNhHQfttEF897IJLUgoO5tXi+kWlbE O6CVslwySG086y4vAu1cFJHaswRFAQ4jwwRaiLj9uVSj+fBSFFOVPoci7WO6A4sRqNl8 gt99mwHEBZx6xSE2h2yD43u1EnDIiyCasTo9n+Dl/eLpItlFzcfIvZY0Vp34aRxGJc9M K/9KPT0Dzl6p78Y/pFSGVDUY4EDeNwDJLIZGK9//N7Wa3vDvy5yCPK7BCCQtw8XQMnC0 NNjQ== X-Gm-Message-State: APjAAAUOKxuZ7cXEOJK+Q5cuHrT8CaBoI2QyNm2XuH8s7ad8D3Vk4dFQ T5qW3XWpK7dqZ3YXBIJvrjjJTmYv43YQE479MS32Mw== X-Received: by 2002:a7b:cd84:: with SMTP id y4mr2525587wmj.79.1559227065647; Thu, 30 May 2019 07:37:45 -0700 (PDT) MIME-Version: 1.0 References: <1558742162-73402-1-git-send-email-fenghua.yu@intel.com> <1558742162-73402-2-git-send-email-fenghua.yu@intel.com> In-Reply-To: <1558742162-73402-2-git-send-email-fenghua.yu@intel.com> From: Andy Lutomirski Date: Thu, 30 May 2019 07:37:34 -0700 Message-ID: Subject: Re: [PATCH v3 1/5] x86/cpufeatures: Enumerate user wait instructions To: Fenghua Yu Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Andrew Cooper , Ashok Raj , Tony Luck , Ravi V Shankar , linux-kernel , x86 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 24, 2019 at 5:05 PM Fenghua Yu wrote: > > umonitor, umwait, and tpause are a set of user wait instructions. > > umonitor arms address monitoring hardware using an address. The > address range is determined by using CPUID.0x5. 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). > > 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. > > The instructions provide power saving method while waiting in > user space. Additionally, they can allow a sibling hyperthread to > make faster progress while this thread is waiting. One example of an > application usage of umwait is when waiting for input data from another > application, such as a user level multi-threaded packet processing > engine. > > Availability of the user wait instructions is indicated by the presence > of the CPUID feature flag WAITPKG CPUID.0x07.0x0:ECX[5]. > > Detailed information on the instructions and CPUID feature WAITPKG flag > can be found in the latest Intel Architecture Instruction Set Extensions > and Future Features Programming Reference and Intel 64 and IA-32 > Architectures Software Developer's Manual. > Reviewed-by: Andy Lutomirski > Signed-off-by: Fenghua Yu > Reviewed-by: Ashok Raj > --- > 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 75f27ee2c263..b8bd428ae5bc 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 > -- Andy Lutomirski AMA Capital Management, LLC