From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752870AbeAJVLw (ORCPT + 1 other); Wed, 10 Jan 2018 16:11:52 -0500 Received: from mail-it0-f44.google.com ([209.85.214.44]:33126 "EHLO mail-it0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752413AbeAJVLu (ORCPT ); Wed, 10 Jan 2018 16:11:50 -0500 X-Google-Smtp-Source: ACJfBovuJd3Vim0/fYREX7dgjdA5kMSrsxTOwC8yGhVGFSy6iPokIhw20O0jA6na3i5H4TA/bkhAkK6XJ2XKd/Af0iU= MIME-Version: 1.0 In-Reply-To: <1515618537.22302.253.camel@infradead.org> References: <20180110003139.10531-1-andi@firstfloor.org> <1515568506.22302.72.camel@infradead.org> <1515578735.22302.91.camel@infradead.org> <20180110112815.mgciyf5acwacphkq@pd.tnic> <20180110201532.5jnji6ypfl6slzvb@treble> <20180110205544.k2e534nkk27lkpjc@pd.tnic> <1515618537.22302.253.camel@infradead.org> From: Linus Torvalds Date: Wed, 10 Jan 2018 13:11:48 -0800 X-Google-Sender-Auth: upKKQy7RjG3uakEW52JaXWXUPmo Message-ID: Subject: Re: [PATCH] x86/alternatives: Fix optimize_nops() checking To: David Woodhouse Cc: Borislav Petkov , Josh Poimboeuf , Thomas Gleixner , Andi Kleen , "the arch/x86 maintainers" , Linux Kernel Mailing List , Paul Turner , Andrew Lutomirski , Peter Zijlstra , Tom Lendacky , Tim Chen , Greg Kroah-Hartman , Dave Hansen , Jiri Kosina , Andi Kleen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, Jan 10, 2018 at 1:08 PM, David Woodhouse wrote: > > There are a few of the form 'call *somefunc'. > > The existing code handles them not by virtue of the relocs, as I said, > but by a simple delta of the old and new location of the instruction. > > But it only does so for the *first* instruction of the altinstr, if it > happens to be a (4-byte?) branch. Ugh. That's nasty. Wouldn't it be much better to simply do it as part of relocation instead? Linus