Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1296145imu; Wed, 16 Jan 2019 16:38:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN68TWyDF7gZ4Oz0l/cXi1DRBWkcmzYkFzt5UZHYYEAAgkxHSw6UUr1LHP1ZlPCGHwmWXsWK X-Received: by 2002:a63:2c0e:: with SMTP id s14mr11720269pgs.132.1547685486423; Wed, 16 Jan 2019 16:38:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547685486; cv=none; d=google.com; s=arc-20160816; b=yR2AZw+kc7+x4NEF8ryP/AOlwwsKHnLnQy1nLd9Duns+cqfXOGf/I3dOqiKlZu2Owu CNXFR3jJo21oJK0cWSZKP2ACS9vLM3sNBNJiBESVzBgIZCU7MifZRvUgFOiWLPTAzyiF 70cA7fubwivMZTdmJYvnQIl1ZIa5av6iBj1cnCZweSI+0NVnpaSxrbUfxYdh1Er+srFU EJBhbN8Z+cxd2id03W+tYau57cZjM9TqQ7W15v8mtHY7UjY3CyBZfppTtgBI3FxErr2i dh/7J/Jv9q6qfSSDeBFa8hq01A7Jp1IzNbOT1zFt/nxV+ejc2Roo3gELTNn4hQJwu6sI BPBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=El3HgT9HkJBjsHbps3BuRPYtrEZbmoq2/xXWZh8CFXg=; b=arijmWoDoAXAJtTQPwX1le2sYQSNAhYD1/X8ylbcTFaqC3/fOG8VZoWyItJW3TWidf 8UJRddkBjxlQq974PbUgH1eHSNfC/UIKB3F1S3xjgrPK9SGCKieuP2khu4/i5pt4qe5V +/rUuIwTwJ31SzcJ6WyGhSS6QWhUsa5xvJtp19OML2yRIoO5UKAPzWNG7NbhjzZYJdUu MClV5d7LDpYf+Su+HAbKw9ExGazuwO6pEAzWuRuggg3MKNICnCnbZS329jYsIAIRPFdD C+x5D8b5sPz7nhBc/3r0w5lmecQ5TgFKv0r2s5AIqfRl0Z1zdoXwHHgVXbQVexf/q2sc Jvpg== 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 p2si7995627pgr.133.2019.01.16.16.37.50; Wed, 16 Jan 2019 16:38:06 -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 S1729524AbfAPVYf (ORCPT + 99 others); Wed, 16 Jan 2019 16:24:35 -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 S1729138AbfAPVYe (ORCPT ); Wed, 16 Jan 2019 16:24:34 -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:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,487,1539673200"; d="scan'208";a="117269581" 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 0/3] x86/umwait: Enable user wait instructions Date: Wed, 16 Jan 2019 13:18:35 -0800 Message-Id: <1547673522-226408-1-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org User wait instructions (umwait, umonitor, and tpause) and IA32_MWAIT_CONTROL MSR to control umwait/umonitor/tpause behaviors will be available in Tremont and other future x86 processors. This patch set enumerates the instructions, adds a sysfs interface for user to configure the umwait/umonitor/tpause instructions. The sysfs interface files are in /sys/devices/system/cpu/umwait_control/ because it's hard to find an existing place to host the files. The instructions generates #GP if CR4.TSD=1 and CPL>0. If user worries security issues from the instructions, disabling TSC can prevent malicious code from executing the instructions. Detailed information on the instructions and the MSR can be found in the latest Intel Architecture Instruction Set Extensions and Future Features Programming Reference. Changelog: v2: - Address comments from Thomas Gleixner and Andy Lutomirski - Remove vDSO functions - Add sysfs control file for umwait max time v1: Based on comments from Thomas: - Change user APIs to vDSO functions - Change sysfs to positive logic and enable file name - Change patch descriptions etc Fenghua Yu (3): x86/cpufeatures: Enumerate user wait instructions x86/umwait: Setup umwait C0.2 state x86/umwait: Control umwait maximum time arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/msr-index.h | 6 ++ arch/x86/power/Makefile | 1 + arch/x86/power/umwait.c | 154 +++++++++++++++++++++++++++++ 4 files changed, 162 insertions(+) create mode 100644 arch/x86/power/umwait.c -- 2.19.1