Received: by 10.223.176.5 with SMTP id f5csp572100wra; Sat, 27 Jan 2018 05:43:30 -0800 (PST) X-Google-Smtp-Source: AH8x226uTwNuh955kUxoLhoUgYSvkLq2rZWdjz75a6bqCvso64uYGOkcEfAFT2frjhI2vCs9psOr X-Received: by 10.99.113.75 with SMTP id b11mr18504625pgn.271.1517060610577; Sat, 27 Jan 2018 05:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517060610; cv=none; d=google.com; s=arc-20160816; b=t71w8KmNEVTP6e25LZeNkuvMjCW0A9yWLX79QEk9Qdso8Sb8ZBdYJeQn3nkqO2eNUC xCwHCdCIEweXREKwmKGP1o0FVuXcC3yvBkMY8cOZhvzHnzQFYFqkFOot06EqiTPIU4qr In0bWCNDgxBFF6BN98ZvYJm8rmhOxFuQxCTDyVFaQjlq3rn2wBh3941ED68hg+5FmcQW 8l/AxeF/l3dnIuzSLyqGxopbZOqSCQ3T0GE8CF1iYnSa7JExG3pg7+jMUOTR6A4bO7TU jUYQy1n0ybMEnWLINYy3aINpcFM0p3LUqiZbcklOish6C3+2sHBw+EYImE+mqH9dnEEb 3oeQ== 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:arc-authentication-results; bh=LM9LOAJC9mll0NMZRJrbCQObA4pzTfu9r6osCQAAxe4=; b=h3Be1mAz+Zk3pmlR0+X0aOUs+/Q+hn8EaAexGyZpBIU7FhJBOw/hb5w898Ug5YCo1/ B8zEEozj/QB1Oewby0HEYBEy+Pg8TgxjaCJRM0iVGnxN72ljHI4anNsBnnkKBeakFcTb M+tt4w7ojIVe/fFZACouvM7++SEU6hnKg44t4K7NSwjuVtIBl6J4BT9aG5k5PKw+paFp qiPqlsfvFLEuohTsytVO6BALn1rATUKA/V4ZdLsDJQ3Oe7sGrTE5B6OHzPqjTIDNpGhJ QZtkX6StB2hF7tdv5TRbu3djHeD4Jb5hl+iFdbKam/2CHp990SQGPH+vzc9RPhcKThQx t1BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YmJfPXsu; 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 7si8099274pfo.357.2018.01.27.05.43.16; Sat, 27 Jan 2018 05:43:30 -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=fail header.i=@gmail.com header.s=20161025 header.b=YmJfPXsu; 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 S1752794AbeA0Nmv (ORCPT + 99 others); Sat, 27 Jan 2018 08:42:51 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:38862 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbeA0Nms (ORCPT ); Sat, 27 Jan 2018 08:42:48 -0500 Received: by mail-qt0-f194.google.com with SMTP id z10so7574595qti.5; Sat, 27 Jan 2018 05:42:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LM9LOAJC9mll0NMZRJrbCQObA4pzTfu9r6osCQAAxe4=; b=YmJfPXsu9npUOHkWJrmiQrIu5eBRoNEHxKKm9VKEy2ghCTjaRhG+brE90wpR8z66Mo PjBhnb794BjUHWqCNNONYKjzs+TjxYBRjqdYbQXhc4q95bZRhT/MHKhSrCYNYHWnF0OD PTOmkM69Xvf3SeGAt9g0E7rP261XnzdrCzgbS8Aj9hJjLWZxHiuYh3wcCEtcE/9wfnkE 6E+Y5RhHV6ngT6gZW4C3k5pV5pkIqdjIPeiiZT7DIHsBQIk6x1fUkteO/nNq95HhUJEC 4VI6YR4xuu+ou+9htUZvZKIYKHQWnUZ5plG1h3jSqTYbY67eAgG5Y1ZV2KhTbj/P65Uh tv8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=LM9LOAJC9mll0NMZRJrbCQObA4pzTfu9r6osCQAAxe4=; b=mJdlzcaZQH9XpVawRFcTsLQI9gtkq320vwsUwqgP7QR45ZC4vLqIbmYqzC8cRokTZp dAIIElf4N2wHWOFvU+W1ckQUZBPZJpJ6dLm+nqr0IofgUFvB7zmmW/gR6Z5KQ4adCubH 3mnwSEK63vsYVb1ISClH6I/2RxF65fvMFtBFGgL7+x9EtiCbAXuM42hF3KNv6/4NnwZ0 BJIRCRgba/nWZ0fZv+cwdJAoDOSwu3U/2eLvQCZEw4RqASgJTJNEm9iQ3n/P5DS7qcVg /CcGsoYTEJ9LPNohye/mFBQkh1ixph1bWyO2Ah2tbc76Ri7/UYvPHJYJvqJiPIyLs3S1 gVCw== X-Gm-Message-State: AKwxyteGDidCat4PCuQSsczsTqSPS6FQlDZZ/0pW2c0xByy1LNGG67y8 odZbsRPBMzeWNrrwxnt9qHg= X-Received: by 10.200.20.13 with SMTP id k13mr1324006qtj.137.1517060567312; Sat, 27 Jan 2018 05:42:47 -0800 (PST) Received: from localhost.localdomain (209-6-200-48.s4398.c3-0.smr-ubr2.sbo-smr.ma.cable.rcncustomer.com. [209.6.200.48]) by smtp.gmail.com with ESMTPSA id d42sm7226639qta.87.2018.01.27.05.42.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Jan 2018 05:42:46 -0800 (PST) Date: Sat, 27 Jan 2018 08:42:43 -0500 From: Konrad Rzeszutek Wilk To: "Hansen, Dave" Cc: Konrad Rzeszutek Wilk , Andi Kleen , Linus Torvalds , David Woodhouse , Liran Alon , Laura Abbott , Andrew Lutomirski , Janakarajan Natarajan , Borislav Petkov , "Mallick, Asit K" , Radim =?utf-8?B?S3LEjW3DocWZ?= , KarimAllah Ahmed , Peter Anvin , "Nakajima, Jun" , Ingo Molnar , the arch/x86 maintainers , "Raj, Ashok" , "Van De Ven, Arjan" , Tim Chen , Paolo Bonzini , Linux Kernel Mailing List , Peter Zijlstra , Thomas Gleixner , Greg Kroah-Hartman , Masami Hiramatsu , Arjan van de Ven , Tom Lendacky , "Williams, Dan J" , Joerg Roedel , Andrea Arcangeli , KVM list , Boris Ostrovsky Subject: Re: [RFC 09/10] x86/enter: Create macros to restrict/unrestrict Indirect Branch Speculation Message-ID: <20180127134239.GA25029@localhost.localdomain> References: <7c0b0879-3448-43e4-8380-4708fc787113@default> <50c5d627-8975-184b-b50f-4cc02c5816c5@intel.com> <1516957886.30244.161.camel@infradead.org> <20180126175901.GL26209@tassilo.jf.intel.com> <20180126190257.GS14668@char.us.oracle.com> <0089A7AA75120F4087B2E7CB6BF3E53442A9AA0A@CRSMSX104.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0089A7AA75120F4087B2E7CB6BF3E53442A9AA0A@CRSMSX104.amr.corp.intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 26, 2018 at 07:11:47PM +0000, Hansen, Dave wrote: > The need for RSB stuffing in all the various scenarios and what the heck it actually mitigates is freakishly complicated. I've tried to write it all down in one place: https://goo.gl/pXbvBE Thank you for sharing that. One question on the third from the top (' RSB Stuff (16) After irq/nmi/#PF/...'). It says that :"Return from interrupt path (more than 16 deep) can empty RSB". Just to clarify - you mean all the returns ('ret') that are happening after we call do_IRQ and the stack unwinds - but before we do an 'iret' correct? I am 99% sure that is what you mean, but just confirming as one could read this as: 'Need to do RSB after an iret' (say you are in the kernel and then get an interrupt and iret back to kernel).