From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752681AbeAJV1O (ORCPT + 1 other); Wed, 10 Jan 2018 16:27:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53776 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750718AbeAJV1N (ORCPT ); Wed, 10 Jan 2018 16:27:13 -0500 Date: Wed, 10 Jan 2018 15:27:10 -0600 From: Josh Poimboeuf To: Linus Torvalds Cc: David Woodhouse , Borislav Petkov , 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 Subject: Re: [PATCH] x86/alternatives: Fix optimize_nops() checking Message-ID: <20180110212710.en5ukccrw4sb7klt@treble> References: <20180110112815.mgciyf5acwacphkq@pd.tnic> <20180110201532.5jnji6ypfl6slzvb@treble> <20180110205544.k2e534nkk27lkpjc@pd.tnic> <1515618537.22302.253.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 10 Jan 2018 21:27:13 +0000 (UTC) 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 01:17:45PM -0800, Linus Torvalds wrote: > On Wed, Jan 10, 2018 at 1:11 PM, Linus Torvalds > wrote: > > > > Wouldn't it be much better to simply do it as part of relocation instead? > > .. except we only do real relocation for modules, and depend on the > linker doing everything for us (handle_relocations() at load-time) I > think. > > So it's somewhat more involved surgery. Which explains the hack. > > Nasty. Right. With KASLR, the relocations seem to be resolved by handle_relocations(), but without KASLR, they're resolved in vmlinux linking. -- Josh