Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3102219yba; Mon, 8 Apr 2019 11:08:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvcLGUmEFlROmDa3H2ZU0HbCEGH9q9JmgFU3M+2cT1xTlEd67d6JbPokew/tanoB0epv3x X-Received: by 2002:a17:902:7081:: with SMTP id z1mr32002266plk.252.1554746928720; Mon, 08 Apr 2019 11:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554746928; cv=none; d=google.com; s=arc-20160816; b=bOBaw0ROGpMSsDi8nxAK3kflNJCvaqxLeb5twuqZUJjEFcBQeLnNTCAzEEvCDwP8pc rOpQo5o9MG7uTG26yeENnM7i3oxCYi900qXcKSPNlK1TalhYfRgCwdw9TaceHJDSnJ4s UZf/TB37+pHklWm3GdXJyDKWvO1QmfjM6BrkknzcKh5EkqB8P1jn8fALqrJeEHdhnToS R9THJOSHGR+wA/2IHoU9UEy9pElscpe0+zpP6HXQOr0Qaff6CHep4Daw9NMzcfbOp/6U QdRy2nNz1f+Tkk1EeeSPTrNmcmqkmGeUZixuabEs9CPxkim2UvvOoghXyDr3/pg7E+31 rvlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ITlIss5JlNmHr6h7/GJ+WO1zukGFR0T0+8FXF5kIEW8=; b=RhSamWvIImXNuOBDscgtjatUwgLa6gH8iT7woLP370GqIoYfQQ7DEhncxGSvPhq8Xk 0+dk7YvfTyoF2aC/95u37deEfJIgpM9VJYPuSou3NkItX/ZFTZnpdb6T61zJN8QdnpXi G4KHogSNCcLb1r3eDou++UtTEVtVBb6Bg294QCZmWGw6TaCbB6ouqI1F+VPQ/4ve+4oy zdkwT7jp7aXzEvUF5RqssEHYr04/BnlL+iT9qyLXwAq4Uzpm3VEQUpc/5vMs/uOSMJMb UWSvKzrYVnTuHXvGfn6GrlrFRhcNDxlYu7WQ80jeNOfPlAhFqKh5mx9bfB9I+9XAOrXl Cj1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Tgx5xyCI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d18si25835479pgo.525.2019.04.08.11.08.30; Mon, 08 Apr 2019 11:08:48 -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=@chromium.org header.s=google header.b=Tgx5xyCI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728879AbfDHQF2 (ORCPT + 99 others); Mon, 8 Apr 2019 12:05:28 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:53920 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726723AbfDHQF1 (ORCPT ); Mon, 8 Apr 2019 12:05:27 -0400 Received: by mail-it1-f196.google.com with SMTP id y204so21567988itf.3 for ; Mon, 08 Apr 2019 09:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ITlIss5JlNmHr6h7/GJ+WO1zukGFR0T0+8FXF5kIEW8=; b=Tgx5xyCIuznHAa4L24TZv/ZXknLAgPoKsLc/o/EbVrGqDZ/IN2ScTuyKe67ag7gDrR 5Sxq9BRZbRN+0b2otaUVhJFIA7x/W1hQq5bTTjw1NjVjcaVjRj/CHBb8fkeNipls21GN iDfR1soX16kDdbf6ROSyg34ynic1/EOIhZPeo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ITlIss5JlNmHr6h7/GJ+WO1zukGFR0T0+8FXF5kIEW8=; b=mTDTIx9s4YIVU1fiXwbayYP1pGm47R5ZCqwHaFvZhMB0PvF5UL6SRuEWa67UpnNOHa 8fTJU+PwfWjmaoZOX5QIHXDw2PM19eV3FnCJDPkszdIO6i/br0j2GU452xl7MFS5B3NC H5uOlCV/VHmWn2yS4TpYRVZZ/I+VuHkLPZK78ea+6Hap39CesDP/XPf7IZ+0jF4KfNae 5BObamx65yyCjS0CbsdIDyzoJ1ysg6ANiblasuG9kbb8Pezjwx3ZdPtqdMoT8Uug6gVK jPmapIoA4tyjmLK7ZXQ8G1lQEZuNR9cvrPRwutGxKPgAh/C77O4LNzvkLKpYyeUkTtYM Lg+A== X-Gm-Message-State: APjAAAWkY07AzrCvatUWws8/N9IQOodfc+9DBuuJfsHUyuSCO39K+VWV 0nxphvckjzgyIevg8czSpfj5kyZh02k= X-Received: by 2002:a02:711f:: with SMTP id n31mr20933503jac.126.1554739526949; Mon, 08 Apr 2019 09:05:26 -0700 (PDT) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com. [209.85.166.43]) by smtp.gmail.com with ESMTPSA id s3sm10788777ioo.65.2019.04.08.09.05.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Apr 2019 09:05:26 -0700 (PDT) Received: by mail-io1-f43.google.com with SMTP id f6so11532976iop.3 for ; Mon, 08 Apr 2019 09:05:26 -0700 (PDT) X-Received: by 2002:a6b:6509:: with SMTP id z9mr21038168iob.43.1554739145445; Mon, 08 Apr 2019 08:59:05 -0700 (PDT) MIME-Version: 1.0 References: <20190131192533.34130-1-thgarnie@chromium.org> <20190131192533.34130-15-thgarnie@chromium.org> <01000168a5b35a86-b79bfe67-191e-43bc-a5c7-0e74eac06195-000000@email.amazonses.com> <01000168a6e5ab88-0deea73f-387f-4941-bd11-d1c161aac88a-000000@email.amazonses.com> In-Reply-To: From: Thomas Garnier Date: Mon, 8 Apr 2019 08:58:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 14/27] x86/percpu: Adapt percpu for PIE support To: Christopher Lameter Cc: Kernel Hardening , Kristen Carlson Accardi , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "the arch/x86 maintainers" , Dennis Zhou , Tejun Heo , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Andrew Morton , Andi Kleen , "Kirill A. Shutemov" , Michal Hocko , Mike Rapoport , Stephen Rothwell , Cao jin , Brijesh Singh , Masahiro Yamada , Joerg Roedel , Peter Zijlstra , Kees Cook , Mathieu Desnoyers , LKML , xen-devel 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 On Fri, Feb 1, 2019 at 9:13 AM Thomas Garnier wrote: > > On Thu, Jan 31, 2019 at 6:31 PM Christopher Lameter wrote: > > > > On Thu, 31 Jan 2019, Thomas Garnier wrote: > > > > > The per-cpu symbols are in a section that is zero based to create > > > offsets. The compiler doesn't see them as offsets but as relative > > > symbol and try to relocate them. Given the distance between zero and > > > the mapped kernel is much larger than the instruction offset range, it > > > fails to do it. > > > > We switch that off in the linker. If that does not work with your > > modifications then you need to figure out how to update the link > > configuration. > > > > It didn't work originally but I will revisit to see if I missed something. I revisited and couldn't find a way to prevent relocations to the percpu section. Without PIE, you can reference absolute address which was convenient for percpu. Christopher: Did you have something specific in mind? I checked the following: - Changing the FLAGS() on the PHDRS. - using -z noreloc-overflow which actually doesn't seem to apply to PC32 relocations. - Look at all linker options and script format for anything around that.