Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1242992imu; Tue, 11 Dec 2018 15:39:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/WPqZSoDMvxoj9AxybALIMZVeTUyDUZiOEAp8wltfWQWbBI6qqYgE8tO//aIAmPUbu7/arD X-Received: by 2002:a63:6bc1:: with SMTP id g184mr16736117pgc.25.1544571541347; Tue, 11 Dec 2018 15:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544571541; cv=none; d=google.com; s=arc-20160816; b=kL0xM3Y8YPx6+3nZgU/Av8ukvLbX4LrMSNoqRHjLNc8cE1jq2xqgEJWiASO5OpQL7m OBAMCIKnEdZwmANTJQSFcKuDqV+eR7tHS+zUWMGe9mIbVatcbLK3IZMs3e9uW14233R5 6P7bEYvsQmbWeE4AaIdIBGmS5gMk6rr0n4sPVl8SoIImPvkrOLPLArpBou0/F00sglQ5 UxMmMjnjQOOvY4lmtoz4HLQD8KFAd5EX0V7JnYJDwNmzaCG+OheTmszj3neKsUx+Gvkw 44C+w2M+veXZCyAeQqoLLJHNq22YZKqjnIMgp72vVoyM0PH5u7Xpz1lOx0mXXEyw5cuT Odgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=M+ZESdkC1LCs3NwWzelStNPrJ9VByThnOLUyRcLrGwo=; b=urauNV82EzhTljlAuDObrPOrDaPdeH86jiX8EJgsgyzDL43pfJFWfPFNVf9b0QHGHp /peVAa+7Jrf+EshUC0YHibbPz4JiAf8cyt4gg8bvKry5xwJHUyuDYvggx4ix/DnyQAdV 3e24pySPP5Bw2YGZwSck9cxpyAkegBc3u9/4GuVaIGRMBPGtv9NPBZKlZ3Cfx62xArpu wRI0bGD+pB4yCvve8EZe5+mJDWrEdVFFsNlVDhnozkltKpVe2tZWvxso9S+cwa4Vt6Gm xmGQ8K3mcG63fQDSOEHKY/j1Ht1p629sZShMJcyl1K6BBzxreC2pAY0mGZGXy0mnhsIy ebTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KRL751pS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si13602431pfd.236.2018.12.11.15.38.46; Tue, 11 Dec 2018 15:39:01 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KRL751pS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726239AbeLKXh6 (ORCPT + 99 others); Tue, 11 Dec 2018 18:37:58 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46084 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726158AbeLKXh6 (ORCPT ); Tue, 11 Dec 2018 18:37:58 -0500 Received: by mail-wr1-f68.google.com with SMTP id l9so15798519wrt.13 for ; Tue, 11 Dec 2018 15:37:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=M+ZESdkC1LCs3NwWzelStNPrJ9VByThnOLUyRcLrGwo=; b=KRL751pSO9vI0naXAWLg16Vpb+UYRBUwgzGXdusWxlw7DB4gT7/41fJea6y+kV9a7S 320YoouaoZmUXknQfGBF0BUGnornb/pd8ZqAwOj96jBgaT4lnYy+DR07hjZ8YZmlg0Uy SMUpyk38CHhAg7w4pTs7Zjbluj56NCH6d5ZmEbyX18HjnZf7Q100Z1OWSA0um815jEex ccBBp6Fw+BvfF0HKizFywp6ZEdHZvsOxK2nxbPTbCG00c30uAOwXWXYTm4acWka4xHk4 DR4x3Y9NgcTWlnj0to38/26EXWoElqQkAg0TfxtyGYJVrnAnzRy6ONrnl4uF5b+NnHwV n1vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=M+ZESdkC1LCs3NwWzelStNPrJ9VByThnOLUyRcLrGwo=; b=cA/TKDx+lVXAy+ViBsUfigc6zLFt7q2FK/h1gebAPgJzeyu0TCWdj+EAXBeFz9nxPe QIO/bkxvefYTjd6xwYHbE6c6QtmtJlJR+AMVRSSuExuKd4H98By1k+1hzoRFFN/g+Aor 1jrPt0DZwee2KwpXdhGyarQIO4PzrJHHzhJjf6Hqre/X17AJ71N/9HcFE/htCQcYUfd8 /al8MJjARTv4hx0Afb4uS+/QmFVEO7deyuD/ZGhWtWpRwBjOJ6z69vWUbeqWww4cJ+BW xLJM0IqvhPOQHxJaCTt4KdM1Vh/e+InZjRiJGcuKSc9+/I+g02o/89CpArKgBSm4RolK ElCw== X-Gm-Message-State: AA+aEWZ0x8VGWAI6G2yLiQcVrQIAet/9khuus6vEVepJAqntb9tBr7Kg 25SL3equtR8Y7RiGEbdGWQ== X-Received: by 2002:a05:6000:120a:: with SMTP id e10mr15378411wrx.85.1544571476424; Tue, 11 Dec 2018 15:37:56 -0800 (PST) Received: from avx2 (nat-minsk-pool-46-53-201-92.telecom.by. [46.53.201.92]) by smtp.gmail.com with ESMTPSA id l197sm2923080wma.44.2018.12.11.15.37.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 15:37:55 -0800 (PST) Date: Wed, 12 Dec 2018 02:37:53 +0300 From: Alexey Dobriyan To: luto@kernel.org Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@suse.de, thomas.lendacky@amd.com, hpa@zytor.com, john.stultz@linaro.org, x86@kernel.org Subject: Re: [RFC PATCH 4/4] x86/TSC: Use RDTSCP Message-ID: <20181211233753.GA26593@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > And I had a bit of a WTF moment, as in "WTF does > RDTSC have to do with a speculation protection barrier". > Does it actually make sense? It doesn't. There was too much s/lfence/barrier_nospec/ apparently. > + asm volatile(ALTERNATIVE_3("rdtsc", > + "mfence; rdtsc", X86_FEATURE_MFENCE_RDTSC, > + "lfence; rdtsc", X86_FEATURE_LFENCE_RDTSC, > + "rdtscp", X86_FEATURE_RDTSCP) > + : EAX_EDX_RET(val, low, high) > + /* RDTSCP clobbers ECX with MSR_TSC_AUX. */ > + :: "ecx"); I have a question: does alternatives ordering matter? CPU can have both features. And other code in this file uses "c" for clobber.