Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2044508imm; Mon, 16 Jul 2018 00:47:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdTXtofEdtUAE+FinRekHjaOYqPRTOHAXjrCHSxlwkOC+NpzGb2QALq7Zs8Z3O4ItvCR09o X-Received: by 2002:a62:464f:: with SMTP id t76-v6mr17062578pfa.118.1531727277711; Mon, 16 Jul 2018 00:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727277; cv=none; d=google.com; s=arc-20160816; b=QijkzEHXlO/HkCpSnXMFcoNmI0U+ylzL8Dj8DpGQaaP9iCSLHwpOV1IdvKX974UNPH +h8DkHAwySqJBI6i0Hn4mnKPWX+mGmLiKboTGlPklnwLU/V3KBUsWo80GjoACUwzoyCv zcJfNMrZaj5YueGjO/cktFMAxeG8+avEnWfcH/qmfdA6mvlI2fkwvxg6L5aVfmcF/iLu QKR82d9dwPWgbjpOnEVkcx7pT72m4mij0zSNug91KjQAQNdN2jF6DAEMXXXnVx7t64MK F/EmyrCuvpgjCDurVGJl6sOrqCIDTvbm9pnitj64W7jDnJtNjRP22CjmfseIho5zq6Lh +jow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=r4NI3fa/1gLwmHr/Qa4xgttPU6I6zZa+aA4oyUBAY6s=; b=OLz4DV7DHovxRVKRLvG/L1ozsZu/n0KlpW95+BthltD4zB+g8QqBOxehb0c5YtP6sn yX0vg8QNMNSn6Q5CsxQ3ZiA8ISQ1iKq5sOxnJngE9YHqa9OMMpX0+0Zbnlf9zZFjFwyK W85IcZyNZQwo8BMekVzAoWS70+hUdhb92hwciJKrKk+mNeIvM25vNxBwJh1KrsiWHcv3 6CSiFsCfcNyCCZgBhWrkx5s/zEoYL2lQ4349BPbWpS7rQqkhJLlOix+FhJMarGMwX2mn J8g5aibmWlCpO7kUR+YAHqllIsy1w5o9buSUBeyRduudbSVS7pcKQDG7cAtGjJtjxzlJ yEeg== ARC-Authentication-Results: i=1; mx.google.com; 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 r133-v6si27962728pgr.17.2018.07.16.00.47.43; Mon, 16 Jul 2018 00:47:57 -0700 (PDT) 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; 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 S2389720AbeGPIMI (ORCPT + 99 others); Mon, 16 Jul 2018 04:12:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51030 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388740AbeGPIMH (ORCPT ); Mon, 16 Jul 2018 04:12:07 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EAEECCEB; Mon, 16 Jul 2018 07:45:46 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Andy Lutomirski , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , "Srivatsa S. Bhat" , "Matt Helsley (VMware)" , Alexey Makhalov , Bo Gan Subject: [PATCH 4.4 25/43] x86/alternatives: Add an auxilary section Date: Mon, 16 Jul 2018 09:36:30 +0200 Message-Id: <20180716073514.609955270@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073511.796555857@linuxfoundation.org> References: <20180716073511.796555857@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Borislav Petkov commit 337e4cc84021212a87b04b77b65cccc49304909e upstream Add .altinstr_aux for additional instructions which will be used before and/or during patching. All stuff which needs more sophisticated patching should go there. See next patch. Signed-off-by: Borislav Petkov Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1453842730-28463-8-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar Signed-off-by: Srivatsa S. Bhat Reviewed-by: Matt Helsley (VMware) Reviewed-by: Alexey Makhalov Reviewed-by: Bo Gan Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/vmlinux.lds.S | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -202,6 +202,17 @@ SECTIONS :init #endif + /* + * Section for code used exclusively before alternatives are run. All + * references to such code must be patched out by alternatives, normally + * by using X86_FEATURE_ALWAYS CPU feature bit. + * + * See static_cpu_has() for an example. + */ + .altinstr_aux : AT(ADDR(.altinstr_aux) - LOAD_OFFSET) { + *(.altinstr_aux) + } + INIT_DATA_SECTION(16) .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {