From patchwork Mon Feb 8 17:57:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 61426 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1581875lbl; Mon, 8 Feb 2016 09:58:42 -0800 (PST) X-Received: by 10.66.63.8 with SMTP id c8mr27809468pas.147.1454954322219; Mon, 08 Feb 2016 09:58:42 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rt5si47854991pab.98.2016.02.08.09.58.41; Mon, 08 Feb 2016 09:58:42 -0800 (PST) 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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932276AbcBHR6G (ORCPT + 30 others); Mon, 8 Feb 2016 12:58:06 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38163 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755675AbcBHR57 (ORCPT ); Mon, 8 Feb 2016 12:57:59 -0500 Received: by mail-wm0-f46.google.com with SMTP id p63so126884521wmp.1 for ; Mon, 08 Feb 2016 09:57:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hUVorz3kuPckMPH5eBbnVdUsqKO7ZsaFi9MiE/gFB1I=; b=XfqLdYthirtfB5Fl2Ix5bmSGQ/u5ERYbfSoYX63C8I8BlzjiYSr6xuvExSjKvZRN2G IwYrSzluJeFYqUFp4ggMH0Th4GIoA8MPyYGaFj5wQi4u+pT2J81E6HX7Yrl047XBws2z F3luG1M8XvT8rtk/gkL1fCkn2ISyDL70yjz7o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hUVorz3kuPckMPH5eBbnVdUsqKO7ZsaFi9MiE/gFB1I=; b=TPFURvpa7veXJ+ISbng4viK7RsntDJJJgqLEAPUZJ47+rKK6vL7C2+os40S1q8okOL ecr3urDuJ7qmpaDj0ME31bM1ZvporhS/ukIKRzHRkb0PmwuswDSfJmMxZzbcT6dDvFi5 4OOJqWtAqpCLDUUMi+/zvEMKZkfklxeUKwDAyN3kLI2hiVznAE6kjUpi3tbkP0liOQOD vh9Lwe7GjVbewnSxtBcyfTqWkPes1EOqFciQ6E9KVti+YTn4vdAdIZAVcsI/x8xtXx/r TsleRJk6ULUsLbjnwnV1teiRoE5CsJIgtSGsTUwBryoOIOHVj+dkPORaCM35gAvvdgDi xL4A== X-Gm-Message-State: AG10YOStcmvXl7my0NrvApU/P5x4VV6kL4HC0BuRvHOglBB3cyow3LMYiOlLho7ean+3qeRY X-Received: by 10.194.204.225 with SMTP id lb1mr28140280wjc.156.1454954278612; Mon, 08 Feb 2016 09:57:58 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id w17sm13664684wmw.5.2016.02.08.09.57.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Feb 2016 09:57:57 -0800 (PST) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, keescook@chromium.org, akpm@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, heiko.carstens@de.ibm.com, benh@kernel.crashing.org, mpe@ellerman.id.au, mmarek@suse.cz, rusty@rustcorp.com.au, arnd@arndb.de, linux-arch@vger.kernel.org, linux@roeck-us.net Cc: Ard Biesheuvel Subject: [PATCH v5 1/3] x86: kallsyms: disable absolute percpu symbols on !SMP Date: Mon, 8 Feb 2016 18:57:46 +0100 Message-Id: <1454954268-3225-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454954268-3225-1-git-send-email-ard.biesheuvel@linaro.org> References: <1454954268-3225-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org scripts/kallsyms.c has a special --absolute-percpu command line option which deals with the zero based per cpu offsets that are used when building for SMP on x86_64. This means that the option should only be passed in that case, so add a Kconfig symbol with the correct predicate, and use that instead. Tested-by: Guenter Roeck Reviewed-by: Kees Cook Tested-by: Kees Cook Acked-by: Rusty Russell Signed-off-by: Ard Biesheuvel --- init/Kconfig | 4 ++++ scripts/link-vmlinux.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) -- 2.5.0 diff --git a/init/Kconfig b/init/Kconfig index 22320804fbaf..b17824a875fa 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1420,6 +1420,10 @@ config KALLSYMS_ALL Say N unless you really need all symbols. +config KALLSYMS_ABSOLUTE_PERCPU + bool + default X86_64 && SMP + config PRINTK default y bool "Enable support for printk" if EXPERT diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index ba6c34ea5429..7a08bf9a9576 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -86,7 +86,7 @@ kallsyms() kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET" fi - if [ -n "${CONFIG_X86_64}" ]; then + if [ -n "${CONFIG_KALLSYMS_ABSOLUTE_PERCPU}" ]; then kallsymopt="${kallsymopt} --absolute-percpu" fi