Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3872349imm; Tue, 29 May 2018 15:46:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL8T3zo6VRFHhkBPhUxHsUvTxxEQykf3tlysKiVoQd7btEFQjxOUru9dQnRkIZgmXufU09m X-Received: by 2002:a62:c45a:: with SMTP id y87-v6mr296079pff.190.1527633999764; Tue, 29 May 2018 15:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527633999; cv=none; d=google.com; s=arc-20160816; b=PrrCvco35WeKr3LdcmcLxJod6jwcZtk9GbeSftYo2mIDA4ks2LwdZoK1UR7hg4KZoa LV2F8wRfK+LUk95dtnaeHiYg3r0BzzuGK45Y2+6ogU+DpTqpTjNMwdPEe82P6NS18qHB rjvLIvMN0cT8ONcTTCEi2p8/W+ZY1I86mdFswT5px4a9IKGaTxLnQi5YcSPOMhppWrG1 8WVhIqqIo5yDAlIrAaeFWMQibu3daK5+gFOjl+LmI8Z6y5nzAdDmXf2XNXzxFn72A5Ub mAiuT4r61uNzrFjqLMQlHvfu0U+WS1myfJ+Ad9iwFV+dmFSFWrP+nXyJVcN27Xshl6T7 fESg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=NTPrKiNUawiwY23G41uRD5XVFul1VndLc1OfQYnd4kc=; b=HEPzU6HLlYJJyk8abIZb4hQ1crBx/oQYQaC4219dKnGk7+M8hIS9SstRZtWGXJEcdM 2BY514sayb4Tr2S5y8PZBKleRbc8Wh+27vFrVcgc44lQlnbQcZniuwqZw9EhG3kSf+Ki k0CbD6JslB4ERoPX3tMBfU3WFN5wxKHbq1bLkZFUktgNnSzNABItlhKfaA6CxsBVzQNu hY6XhG7uOGgEKiDyQzh4VvbNS19qfCQzk0bKhlveaqXDrvJSXQO5gmw/o9L6viqlVngF EMRXisJmKhBG2lB2PIBn9J8F6TdgsBzMRpE6DAU+Ex5Sthi2oz14D8K1u2djg3frNojz 6H7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=GxElLeRj; 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 h189-v6si8875882pge.266.2018.05.29.15.46.25; Tue, 29 May 2018 15:46:39 -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=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=GxElLeRj; 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 S967758AbeE2WqC (ORCPT + 99 others); Tue, 29 May 2018 18:46:02 -0400 Received: from a9-54.smtp-out.amazonses.com ([54.240.9.54]:42832 "EHLO a9-54.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935806AbeE2WqB (ORCPT ); Tue, 29 May 2018 18:46:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1527633960; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=NTPrKiNUawiwY23G41uRD5XVFul1VndLc1OfQYnd4kc=; b=GxElLeRj/L3jTJ4S8Q2aoUdIVj56m/nxZth//6I2/Hf/UXZP4E/pVZbdKN5YvkY9 y1ZjILxH0B71l3fIXCdg2Jneu8ZjWDxRgSt3XMr3cy4y81O2X5djxQ+ffb3DC8uUaAn 5fv7qmLbz7ZScXpcEpbpCiKdLao0rzQxGxd1SRuU= Date: Tue, 29 May 2018 22:46:00 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Thomas Garnier cc: kernel-hardening@lists.openwall.com, Skip Dave Hansen , Skip Vitaly Kuznetsov , Skip Tom Lendacky , Skip Mathieu Desnoyers , Skip Frederic Weisbecker , Skip Nicholas Piggin , Skip Kees Cook , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Tejun Heo , Dennis Zhou , Boris Ostrovsky , Juergen Gross , Dominik Brodowski , Borislav Petkov , Josh Poimboeuf , Andy Lutomirski , Peter Zijlstra , "Kirill A. Shutemov" , Andrew Morton , Philippe Ombredanne , Greg Kroah-Hartman , Alexey Dobriyan , Francis Deslauriers , Masahiro Yamada , Cao jin , Masami Hiramatsu , "Paul E. McKenney" , Nicolas Pitre , Randy Dunlap , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Subject: Re: [PATCH v4 14/27] x86/percpu: Adapt percpu for PIE support In-Reply-To: <20180529221625.33541-15-thgarnie@google.com> Message-ID: <01000163ae145cac-5ac07b51-8f08-4da5-bb93-0238d59756d3-000000@email.amazonses.com> References: <20180529221625.33541-1-thgarnie@google.com> <20180529221625.33541-15-thgarnie@google.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2018.05.29-54.240.9.54 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 May 2018, Thomas Garnier wrote: > Perpcu uses a clever design where the .percu ELF section has a virtual > address of zero and the relocation code avoid relocating specific > symbols. It makes the code simple and easily adaptable with or without > SMP support. > > This design is incompatible with PIE because generated code always try to > access the zero virtual address relative to the default mapping address. We always access relative to the "segment register". You can already change the segment register to relocate the per cpu sections arbitrarily since all per cpu "addresses" are offsets relative to the segment register. I am not sure what exactly you are trying to accomplish here? Maybe you need to explain it better?