Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755076AbeAMPU1 (ORCPT + 1 other); Sat, 13 Jan 2018 10:20:27 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:38032 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751335AbeAMPU0 (ORCPT ); Sat, 13 Jan 2018 10:20:26 -0500 X-Google-Smtp-Source: ACJfBovImmH+bKszbzogoeb+ole9jmFyAIw9CD/WW6nCIpzVJqz+SbhuaLkHZcLOOFsxQLESLo/XQA== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 1/5] x86/ibrs: Introduce native_rdmsrl, and native_wrmsrl From: Andy Lutomirski X-Mailer: iPhone Mail (15C202) In-Reply-To: <0575AF4FD06DD142AD198903C74E1CC87A5C7FB4@FMSMSX151.amr.corp.intel.com> Date: Sat, 13 Jan 2018 07:20:23 -0800 Cc: Andy Lutomirski , "Hansen, Dave" , "Raj, Ashok" , LKML , Thomas Gleixner , Tim Chen , Linus Torvalds , Greg KH , Andrea Arcangeli , Andi Kleen , David Woodhouse , Peter Zijlstra , "Williams, Dan J" , Paolo Bonzini , "Nakajima, Jun" , "Mallick, Asit K" Content-Transfer-Encoding: 8BIT Message-Id: <7C6CCBE8-D03D-41B0-94BE-03EF31007A49@amacapital.net> References: <1515720739-43819-1-git-send-email-ashok.raj@intel.com> <1515720739-43819-2-git-send-email-ashok.raj@intel.com> <20180112015231.GA44418@otc-nc-03> <20180112030139.GA46095@otc-nc-03> <917cf067-c986-a459-ea87-7b7724c3c2d6@intel.com> <0575AF4FD06DD142AD198903C74E1CC87A5C7FB4@FMSMSX151.amr.corp.intel.com> To: "Van De Ven, Arjan" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: > On Jan 13, 2018, at 5:52 AM, Van De Ven, Arjan wrote: > > >>> We were also worried about the indirect calls that are part of the >>> paravirt interfaces when retpolines are not in place. >>> >> >> How could those possibly be any worse than any other indirect call in >> the kernel? > > they're worse if they happen before you write the MSR that then protects them? I haven't looked at the latest IBRS code, but I can see only two ways to do it: 1. Write the MSRs from asm. Get exactly what you expect. 2. Write them from C. Trust the compiler to be sane. Failure to optimize asm goto correctly or failure of the paravirt code to patch correctly is very low on the list of things to worry about.