From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754577AbbFKOXl (ORCPT ); Thu, 11 Jun 2015 10:23:41 -0400 Received: from mail-bl2on0108.outbound.protection.outlook.com ([65.55.169.108]:48640 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754499AbbFKOXj (ORCPT ); Thu, 11 Jun 2015 10:23:39 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; amacapital.net; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NPSANA-07-Y7T-02 X-M-MSG: Date: Thu, 11 Jun 2015 22:14:28 +0800 From: Huang Rui To: Borislav Petkov CC: Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , "Rafael J. Wysocki" , Len Brown , John Stultz , =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , , , Fengguang Wu , Aaron Lu , Suravee Suthikulanit , Tony Li , Ken Xue Subject: Re: [PATCH v3 1/2] x86, mwaitt: add monitorx and mwaitx instruction Message-ID: <20150611141428.GA21621@hr-slim.amd.com> References: <1434032051-1953-1-git-send-email-ray.huang@amd.com> <1434032051-1953-2-git-send-email-ray.huang@amd.com> <20150611141904.GE30391@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20150611141904.GE30391@pd.tnic> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11OLC016;1:t0pH19Iy9FskEFtAhlQxdn8gkOdNDjr95CsZY3MbDDSRxFOJA/9GTEXotoLu3yfa/enfqySxKFCgKpZBXSD38MaBXe5uMZJJmdsFIPHOrjwFY8+keSDzjdISjZN2OwrEKvmwGPwTEzyySuwyvndCOyp7aKpnx77UnO7iMhg8qXlAqcM1CKrAIqO2tlm0j+0iuJnfZudro6lBbyyCPHSSzr7KqGo7Dv42r4iELC2EgSQifvumNFLV8V6UonQMXLD8Ix8JXFI36JeW1gh3nv36mKCjaNNLGX+dhcCcqui+YxYdJmTTl8O3rrqys8VFvtl6j6mNIiRxgrIafmidoLudWB61X4hG3nsU1zMNhEK+YpI= X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(24454002)(51704005)(164054003)(189002)(199003)(53416004)(83506001)(77156002)(62966003)(46102003)(33656002)(92566002)(50466002)(46406003)(47776003)(76176999)(50986999)(23726002)(86362001)(87936001)(54356999)(101416001)(97756001)(189998001)(110136002)(2950100001)(19580395003)(5003600100002)(77096005)(4001350100001)(105586002)(106466001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR02MB1113;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1113; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:BY1PR02MB1113;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1113; X-Forefront-PRVS: 0604AFA86B X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2015 14:23:36.1051 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR02MB1113 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 11, 2015 at 04:19:04PM +0200, Borislav Petkov wrote: > On Thu, Jun 11, 2015 at 10:14:10PM +0800, Huang Rui wrote: > > On AMD Carrizo processors (Family 15h, Model 60h-6fh), there is a new > > feature called MWAITT (Mwait with a timer) as an extension of > > Monitor/Mwait. > > > > MWAITT, another name is MWAITX (MWAIT with extensions), has a configurable > > timer that causes MWAITX to exit on expiration. > > > > Compared with MONITOR/MWAIT, there are minor differences in opcode and > > input parameters. > > > > MWAITX ECX[1]: enable timer if set > > MWAITX EBX[31:0]: max wait time expressed in SW P0 clocks > > > > MWAIT MWAITX > > opcode 0f 01 c9 | 0f 01 fb > > ECX[0] value of RFLAGS.IF seen by instruction > > ECX[1] unused/#GP if set | enable timer if set > > ECX[31:2] unused/#GP if set > > EAX unused (reserve for hint) > > EBX[31:0] unused | max wait time (loops) > > > > MONITOR MONITORX > > opcode 0f 01 c8 | 0f 01 fa > > EAX (logical) address to monitor > > ECX #GP if not zero > > > > The software P0 frequency is the same as the TSC frequency. > > > > Max timeout = EBX/(TSC frequency) > > As suggested last time, please put the description of MWAITX over > __mwaitx() in the code as comments below. See below. > Apology to miss that. Will do it at once. Thanks, Rui