From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x224gQKjKbkodHHx6RHfGSIycjssugLCcv1TnR1CdX7Bz52ApUEO1nsDNts+Wu2gzwsRD/GIT ARC-Seal: i=1; a=rsa-sha256; t=1517414443; cv=none; d=google.com; s=arc-20160816; b=QWYx1QONf2JGzYoKxggZUEvbJzVeM/J8mxxuyVkyCG/0sP3ZZYkDzfYVdwzWzwuZIX o5+Q3h8v0DO/dqLjHznCPQXUtqUMTCKQZOWKF4FAmjgjVAVesyo3JKtd/5eKSTnimQ5O YR5fiF4+9hG4bp33Mo8FhsoQ8aMJ13JMorKDnSN+gqEPNrWZVfwIXQ+bMqMHCOxN1fbQ +rtZQa8srlurr0oLlezPmW+UrbJgJqXWDfz+jdkeLActqYBn3jqvjt4ORU0vp7iJFNuE PjBMxrQ5IWvdKtUlx3w35X1IRlJKz2TKV6SoZKuyegj+hgceEssXMgaLKqs2Py0vF2rv jY3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=TQYygzuu4rAyV7W7HE3yWN1wgCnETeUT9XfHHMY+s4o=; b=uHtYpwHI3LWx0lWVV3/sxA5AUXGyJyogvfMXuIZTJsciBy5gXnY+6Pm342JW6Ga+zl xfOuLC0y1/w6Ax0bmMHW1AncrO0HS7Ggzr+CkMTrl7RZ5PYlKiRu2Ak6q3v89VQpXVQb FrrX8eFvs4YFpz+HFE0fXPYOrUb448Gij4tGvhgMkJ3cl1RhdtfmJhqjQEX0uWX3D9D1 pd6IQUwwPUqRG7OUpB/kXqZ4Ab7yC4UvF53jcn0xKOn7qjzzntop87pPUCUFhVfRsHty /VL5IVUhxJ0vzOMER0peOZ+v5Pw4sfot5jqjvTP40u3Be7JPIT6BxUsXHOXZN68YU/yo 0TyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=iJ+MEYB3; spf=pass (google.com: best guess record for domain of peterz@infradead.org designates 205.233.59.134 as permitted sender) smtp.mailfrom=peterz@infradead.org Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=iJ+MEYB3; spf=pass (google.com: best guess record for domain of peterz@infradead.org designates 205.233.59.134 as permitted sender) smtp.mailfrom=peterz@infradead.org Date: Wed, 31 Jan 2018 17:00:18 +0100 From: Peter Zijlstra To: Josh Poimboeuf Cc: David Woodhouse , Thomas Gleixner , linux-kernel@vger.kernel.org, Dave Hansen , Ashok Raj , Tim Chen , Andy Lutomirski , Linus Torvalds , Greg KH , Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , Dan Williams , Paolo Bonzini , Jun Nakajima , Asit Mallick , Jason Baron , Tom Lendacky , Borislav Petkov Subject: Re: [PATCH 08/24] x86,sme: Annotate indirect call Message-ID: <20180131160018.GU2269@hirez.programming.kicks-ass.net> References: <20180123152539.374360046@infradead.org> <20180123152638.453859448@infradead.org> <1516963050.30244.188.camel@infradead.org> <20180131092921.GI2269@hirez.programming.kicks-ass.net> <20180131150451.5m2pg4u33d72bpbw@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180131150451.5m2pg4u33d72bpbw@treble> User-Agent: Mutt/1.9.2 (2017-12-15) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590397849625954556?= X-GMAIL-MSGID: =?utf-8?q?1591124367001660521?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Wed, Jan 31, 2018 at 09:04:51AM -0600, Josh Poimboeuf wrote: > If there's no harm, it would be simpler and more robust to just do > retpolines everywhere and not worry about special cases. > > (Forgetting paravirt for the moment, which is the eternal "special > case".) > > I was also thinking about adding a debug option for _runtime_ retpoline > verification that decodes all kernel text and reports any indirect > branches it finds (yes, kind of like an in-kernel objtool). That would > be a lot more straightforward without special cases. Obviously > .init.text wouldn't be a problem there, but the other annotated safe > locations would. Like said, even retpolines themselves need annotation. We could simply keep the section and not .discard. it.