Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3235071imu; Mon, 19 Nov 2018 12:42:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/VRCC5T0MY35nqTXI6NUTEFyX360Y2zIqOVO5y/3Nnm136HqQ5EnMBOjnb/YIrHsXtGtcrl X-Received: by 2002:a17:902:f082:: with SMTP id go2mr5265931plb.115.1542660178422; Mon, 19 Nov 2018 12:42:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542660178; cv=none; d=google.com; s=arc-20160816; b=lqYTHbqay/OJRKEsb98l+FQ/M2LmrSBj0Vyax5g9T60uZ4YQkdizMTk8EG4M0CCEWB xuUzKPE1sJwq66fK9HQAyXIilFSWdKomhWtR89VQfkviI72SZ+8YHmgy/7nyziNL5Ht8 blAGko5b7HJ6B9olPzEX2ixyT0SYWMcyEqThpFEdcIuo3f9p4prS5pwbNRLsnrv67SxG 1YbyHmWhtY/thgi5bnl0GJdfeGgRuWLn+cHyx9t+h4xLdqE5GO5OPTyGwhd/bxYlIwXC bJ6bDP4Um02qKjLZagXNhKfkshxMs9lJG6fMB6BPRpzigAwkjrk1oRPAe9xrLNRuXRfx Z5BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tkvbDbdSh7LZSDm5mylBSDPP17cxkrNCLU9z4Plxhb4=; b=GdO5GefqvVxv8Xj3z7GgKL3tbZ+NJJaFXFNwXTpIecqrXwsmDkwj6amXBh8uN6NDn5 5EHIXLAWhbimCw0eyk4kPVpIsQF2bQaMjarBes9PFT24bvOKOO4w+xlxmJOSarQOio1A Luf6/58jOCzBu/hfzszmGQDMJ5F6JihYL1mOljGmlCILBliEu/ZSUvNZfJquIJABEhSK MVs/vUUvbhozXAvTjKV0RbPn6Bwb96QRphxbjvuHnfvYbNlRXpzZnDOfvKXEkR6vta5U G9jKGiTjZRNN21cTUb1mb1pLHMvnJ9p09RO50a3AUd8JoDOhP8M4hwjMcfDXGIDsmnut gJkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LW9zkQ+U; 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=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j38-v6si39337854pgl.138.2018.11.19.12.42.42; Mon, 19 Nov 2018 12:42:58 -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=@alien8.de header.s=dkim header.b=LW9zkQ+U; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730812AbeKTHFx (ORCPT + 99 others); Tue, 20 Nov 2018 02:05:53 -0500 Received: from mail.skyhub.de ([5.9.137.197]:41214 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728938AbeKTHFx (ORCPT ); Tue, 20 Nov 2018 02:05:53 -0500 Received: from zn.tnic (p200300EC2BE2B700F95221CD056129B8.dip0.t-ipconnect.de [IPv6:2003:ec:2be2:b700:f952:21cd:561:29b8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 050561EC06FB; Mon, 19 Nov 2018 21:40:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1542660031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=tkvbDbdSh7LZSDm5mylBSDPP17cxkrNCLU9z4Plxhb4=; b=LW9zkQ+UyyQr+5hgR5D90urlg10ucSAHzLtoTHcK8N7knIuAgdrweAS9J1X7WSQZ/JE/6h +uMJX9mZ8pV+tNeNcqU+9L8J+5EsRulcO8u7ITE2Fr4O8hZkH1X21UXwng2BiYhoi3ti86 +Vc+vohroUzUA6Xkl2QT4tx7zIIUoXg= Date: Mon, 19 Nov 2018 21:40:25 +0100 From: Borislav Petkov To: "H. Peter Anvin" Cc: Andy Lutomirski , X86 ML , LKML , John Stultz , Tom Lendacky Subject: Re: [PATCH] x86/TSC: Use RDTSCP Message-ID: <20181119204025.GL14688@zn.tnic> References: <20181119184556.11479-1-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 On Mon, Nov 19, 2018 at 12:17:35PM -0800, H. Peter Anvin wrote: > On 11/19/18 11:52 AM, Andy Lutomirski wrote: > > > > I thought I benchmarked this on Intel at some point and found the > > LFENCE;RDTSC variant to be slightly faster. But I believe you, so: > > > > Acked-by: Andy Lutomirski > > > > As long as the difference isn't significant, the simplicity would seem to be a > win. Right, I think by simplicity you mean RDTSCP. :) Also in the sense that you have a single instruction which gives you that barrier of waiting for all older insns to retire before reading the TSC vs two where you don't necessarily know what happens on the uarch level. I mean, nothing probably happens but RDTSCP is still simpler :) Also, hpa, isn't LFENCE; RDTSC and RDTSCP equivalent on Intel? In the sense that RDTSCP microcode practically adds an LFENCE before reading the TSC? Because SDM says: "The RDTSCP instruction is not a serializing instruction, but it does wait until all previous instructions have executed and all previous loads are globally visible." which sounds pretty much like an LFENCE to me: "LFENCE does not execute until all prior instructions have completed locally, and no later instruction begins execution until LFENCE completes." -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.