Received: by 10.223.176.5 with SMTP id f5csp1657496wra; Wed, 31 Jan 2018 09:33:43 -0800 (PST) X-Google-Smtp-Source: AH8x226jlF8apZFTXvyia5+osYhzyM9qP3aYAtASzAC4OKhbH72472+McKnvvda48ZR9nStpClZv X-Received: by 10.101.67.5 with SMTP id j5mr27876972pgq.442.1517420023445; Wed, 31 Jan 2018 09:33:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517420023; cv=none; d=google.com; s=arc-20160816; b=NHVdJP5sBttMU7Xf9U5ATNsv3Xy+8XOv/dOv+ydJudP+hcoytESUsKfG5slrsAzFVY a44t272De7s2ixPehhtT3S+LHhI8sbTZ6qHb6nMymf9rmnSt4LyitCpTPhzetwWIWBz7 CAzakZc9zPBi1ZZOEIMeRuDxReuw1fk7CbRxZrTQQUB2L+T+I148VUwpxo5gnwB5eJoX Xp+GZLVzQBd6rlH0WEyT66JZ6ZgnDK3VEQHQJ+1m6JiIMRwZSoLq2m5L87AhsGbhjaym 9qAts5upOuYSt5ZaoPxlV0xqHxUOuBKa6nmN6XWeOx0i50ZkP2UIHAd1tgdiXbwuyhRd fXww== 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:arc-authentication-results; bh=Fg3NRA/jnNF9mj2LgLnL1CmQehHO1QbHDMxB0gULQy4=; b=QG07kqJ32Q4INnYYe5g3fZvcVDck0MYrrzaBYJvlf1vPOG8iuBP57VjwPGwbMqQQfW 4p9tbT0SqJqTRdgmx0M9kRaP2+8JzlYjFymErOtcE+UZMaxAF9YtaOUVjfwglk6mfFdg wXpoEaLO7fSVaYBNKpi4HBYV6ckBJqIYvft0XujGzbxO7343J0U7SzxXNltqdyocQsGA OpfRjIJ/X+8+/g6JdaP0oHKQkX0Q7bOw5we0kdCFJBspM2KpoJF5tGzxp5fRHE9TGNXF GsiDUC1z0Vg4aQA++Tk/nqXbvAcmRsCMA15/NoTTBhoAlyJSAawK3KCZJSyY8HF3wJYL yqUQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e64si212145pfg.409.2018.01.31.09.33.27; Wed, 31 Jan 2018 09:33:43 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753148AbeAaRGG (ORCPT + 99 others); Wed, 31 Jan 2018 12:06:06 -0500 Received: from mail.skyhub.de ([5.9.137.197]:36174 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752360AbeAaRGF (ORCPT ); Wed, 31 Jan 2018 12:06:05 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id sTVbPHG0Udt7; Wed, 31 Jan 2018 18:06:03 +0100 (CET) Received: from pd.tnic (p200300EC2BCE68005D4DFBFD0E3B986B.dip0.t-ipconnect.de [IPv6:2003:ec:2bce:6800:5d4d:fbfd:e3b:986b]) (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 AD4381EC0288; Wed, 31 Jan 2018 18:06:03 +0100 (CET) Date: Wed, 31 Jan 2018 18:05:55 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: X86 ML , Jiri Kosina , LKML Subject: Re: [RFC PATCH] x86/vdso: Remove retpoline flags Message-ID: <20180131170555.f6aboqitcvmgvhso@pd.tnic> References: <20180131163312.7144-1-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 31, 2018 at 08:35:30AM -0800, Andy Lutomirski wrote: > Hmm. I'm okay with this, but I'd also be okay doing nothing and > figuring out WTF happened if an upstream kernel fails to build like > this. Oh sure, I'm sending it only as an FYI to show that something like this *might* happen so that we're aware. I've taken it into our trees where the 3.0 vdso code generates an indirect call to the thunk: .loc 1 41 0 movq -10489696, %rax # MEM[(const struct vsyscall_gtod_data *)-10489728B].clock.vread, MEM[(const struct vsyscall_gtod_data *)-10489728B].clock.vread call __x86_indirect_thunk_rax Without the retpoline flags, the code looks like this: 170: 4c 8b 34 25 88 f0 5f mov 0xffffffffff5ff088,%r14 177: ff 178: 44 8b 2c 25 90 f0 5f mov 0xffffffffff5ff090,%r13d 17f: ff 180: ff 14 25 a0 f0 5f ff callq *0xffffffffff5ff0a0 <--- 187: 4c 8b 0c 25 a8 f0 5f mov 0xffffffffff5ff0a8,%r9 18e: ff 18f: 4c 8b 04 25 b0 f0 5f mov 0xffffffffff5ff0b0,%r8 which is: movl -10489712, %r12d # MEM[(const struct vsyscall_gtod_data *)-10489728B].wall_time_nsec, .LVL46: .LBB125: .LBB126: .loc 1 41 0 call *-10489696 # MEM[(const struct vsyscall_gtod_data *)-10489728B].clock.vread <--- .LVL47: movq -10489688, %r9 # MEM[(const struct vsyscall_gtod_data *)-10489728B].clock.cycle_last, D.23457 movq -10489680, %r8 # MEM[(const struct vsyscall_gtod_data *)-10489728B].clock.mask, D.23457 notrace static inline long vgetns(void) { long v; cycles_t (*vread)(void); vread = gtod->clock.vread; v = (vread() - gtod->clock.cycle_last) & gtod->clock.mask; ^^^^^^^^^^^^ so it has been converted to an absolute memory reference in that CALL - nothing funky through a register. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.