Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1021229yba; Thu, 4 Apr 2019 02:36:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1Ruxb6aGrHWIuAjjZezmaoTYYS87cH350Q9HP3yntSJYgvDqyCdhcpNVVTXnOixKPMoB+ X-Received: by 2002:a62:4815:: with SMTP id v21mr4708154pfa.167.1554370585486; Thu, 04 Apr 2019 02:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370585; cv=none; d=google.com; s=arc-20160816; b=MA10Yt8bybyh7jPEZ7S0bpICjI6mKBfx1wnwP5MGJ249rYARO9Wh8GMtKw74IXDp2l qSjZ6LqZDS3itV0JgDDhcGbQs4earx+TvzbE1X9yWqD0qKWikJ3FpS9HVGa4IR072UEQ Cks9OXlooJj0xVQAQcQ0RnO9QPPDiiOKUmZO+1Ie2mF7ublEWkDmb5UAh1SY5ITaR+vs rYXzbpt5VN+BYv9FYdYBp2bd6EvR8sx+0qNXL0t8eXI6qC4a1sbfXOf8JNEvi84qdv8J BFy+e0SPHXAmDzJ0IjaWnh/SKhlDsm/H24xvh/60f9Ud92x5ZERDCTSdA+iiFHYXziAs qeIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FkvOOAt5YnpMvfGjuaR3A8PTDhdVhZ5eT9+rYpGc9gI=; b=YAfRgwo8nyEnZZuXnsBkCixM4W61f+S5iGiPw6YEo1cEIGTsQHQDeghwbGzFFg50YA IYsQx9i9MfHEzXu6RZr03kCSmlO/XvKt3JuYLGy/6BAqN+D/2MxDRTs3QeGf0+pVwzMa 6ziMj3LktwoPMlZ3t8a51wxAMZDbhFYtCInj/4TRKfAdORF/iquJP3nyaHsqPuh1STJk iCDgu1DdfJcwUk4ds1Z6EEEa98BCIZiEsUDFzBVuPqE7faSUn3jBzmUS5KNFZVGRc2N5 QCRi2ylb7TOlDDe75yYoK1kxsFtyIj3YD/VS2svRCEBVLRcmPFpcc2vvcGmsk9n6OTDI btqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p6efFuV7; 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 t22si15810738plo.74.2019.04.04.02.36.10; Thu, 04 Apr 2019 02:36:25 -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; dkim=pass header.i=@kernel.org header.s=default header.b=p6efFuV7; 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 S1732394AbfDDJGt (ORCPT + 99 others); Thu, 4 Apr 2019 05:06:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:45356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732121AbfDDJGq (ORCPT ); Thu, 4 Apr 2019 05:06:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 42DA3214AF; Thu, 4 Apr 2019 09:06:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368805; bh=zF4ja8FXQk+Ov64WOx1eAwOd9XuQkqiwqWkUsGu9QNQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p6efFuV7JAV7Bsq2EnhPP7hugeOFU8N9ttO2VUYO/dIlQJZEBOCU4VXRLGf5WPETo DQEa4tOD2Ob+VzHs7T7WzYFPuuDBQqP+HY9qmMnN5DkdGdPMlcbtVtxWTomJXa1Ce3 Q0rnKKCOhuHAJMR+v0v/BD3HbUkxDKn+T8NpnYdQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Golovin , =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= , Nick Desaulniers , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Brijesh Singh , Cao Jin , Ingo Molnar , Joerg Roedel , Masahiro Yamada , Masami Hiramatsu , Thomas Gleixner , Tri Vo , morbo@google.com, x86-ml , Sasha Levin Subject: [PATCH 4.19 177/187] x86/build: Mark per-CPU symbols as absolute explicitly for LLD Date: Thu, 4 Apr 2019 10:48:34 +0200 Message-Id: <20190404084611.446549370@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit d071ae09a4a1414c1433d5ae9908959a7325b0ad ] Accessing per-CPU variables is done by finding the offset of the variable in the per-CPU block and adding it to the address of the respective CPU's block. Section 3.10.8 of ld.bfd's documentation states: For expressions involving numbers, relative addresses and absolute addresses, ld follows these rules to evaluate terms: Other binary operations, that is, between two relative addresses not in the same section, or between a relative address and an absolute address, first convert any non-absolute term to an absolute address before applying the operator." Note that LLVM's linker does not adhere to the GNU ld's implementation and as such requires implicitly-absolute terms to be explicitly marked as absolute in the linker script. If not, it fails currently with: ld.lld: error: ./arch/x86/kernel/vmlinux.lds:153: at least one side of the expression must be absolute ld.lld: error: ./arch/x86/kernel/vmlinux.lds:154: at least one side of the expression must be absolute Makefile:1040: recipe for target 'vmlinux' failed This is not a functional change for ld.bfd which converts the term to an absolute symbol anyways as specified above. Based on a previous submission by Tri Vo . Reported-by: Dmitry Golovin Signed-off-by: Rafael Ávila de Espíndola [ Update commit message per Boris' and Michael's suggestions. ] Signed-off-by: Nick Desaulniers [ Massage commit message more, fix typos. ] Signed-off-by: Borislav Petkov Tested-by: Dmitry Golovin Cc: "H. Peter Anvin" Cc: Andy Lutomirski Cc: Brijesh Singh Cc: Cao Jin Cc: Ingo Molnar Cc: Joerg Roedel Cc: Masahiro Yamada Cc: Masami Hiramatsu Cc: Thomas Gleixner Cc: Tri Vo Cc: dima@golovin.in Cc: morbo@google.com Cc: x86-ml Link: https://lkml.kernel.org/r/20181219190145.252035-1-ndesaulniers@google.com Signed-off-by: Sasha Levin --- arch/x86/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 5dd3317d761f..c63bab98780c 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -411,7 +411,7 @@ SECTIONS * Per-cpu symbols which need to be offset from __per_cpu_load * for the boot processor. */ -#define INIT_PER_CPU(x) init_per_cpu__##x = x + __per_cpu_load +#define INIT_PER_CPU(x) init_per_cpu__##x = ABSOLUTE(x) + __per_cpu_load INIT_PER_CPU(gdt_page); INIT_PER_CPU(irq_stack_union); -- 2.19.1