From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753066AbeAJUuc (ORCPT + 1 other); Wed, 10 Jan 2018 15:50:32 -0500 Received: from mail.skyhub.de ([5.9.137.197]:53938 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752978AbeAJUua (ORCPT ); Wed, 10 Jan 2018 15:50:30 -0500 Date: Wed, 10 Jan 2018 21:50:16 +0100 From: Borislav Petkov To: Linus Torvalds Cc: David Woodhouse , Andi Kleen , Thomas Gleixner , 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: <20180110205015.ehahjumt3e3in6q6@pd.tnic> References: <20180110003139.10531-1-andi@firstfloor.org> <1515568506.22302.72.camel@infradead.org> <1515578735.22302.91.camel@infradead.org> <20180110112815.mgciyf5acwacphkq@pd.tnic> <20180110200519.w7r367aqnjptgjbn@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) 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 12:20:40PM -0800, Linus Torvalds wrote: > No, that's not valid. That could never work anyway. The ".long 2f" > would be the absolute address in the alternative section, but opcode > E9 takes a relative 32-bit offset. Ah, right, doh. I remember now. We used to do those jmps by computing the relative offset: From: 090a3f615524c3f75d09fdb37f15ea1868d79f7e - .section .altinstr_replacement,"ax" -1: .byte 0xeb /* jmp */ - .byte (copy_page_rep - copy_page) - (2f - 1b) /* offset */ -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.