From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C75AC43461 for ; Wed, 16 Sep 2020 12:40:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AFBB522240 for ; Wed, 16 Sep 2020 12:40:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BUYBKHpF"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="clfcM+a6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFBB522240 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jboFEviq9V4Gaen4fDjcWO3gWa4DDL42ni8Aor+HVJA=; b=BUYBKHpF6FW7fb3X17zv/Lpvr iyvCF323QDGrmESONXmH8lrtSVkUTK6rVICCRYxCIjx32+ECvOKwhFRI3TmZOTP29lxFS2djm2C6+ NmHONckSvIfJsqLPDguz4Y9ffVH0gC2a8MGxQpr42OUYffx8L6W86Me1CSrhbbCDVLeePPKbhHvua +1JnjyRhBZuqyKgA2c4p0ED+EQEcDaRmF80AugTzJGohEna2jUfzYQGsmGHhyhK93Cq9Qu283sTbR w8u1iDYiakBWIxPtQYkogWg3Mwi7PLocsQo8NC45p3bIOV+NSe0MqozlyCyf+F55QogiPZnO46AKK PGsckl50w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIWic-0005jt-FN; Wed, 16 Sep 2020 12:39:26 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIWia-0005j0-88 for linux-arm-kernel@lists.infradead.org; Wed, 16 Sep 2020 12:39:25 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 C66EC22225; Wed, 16 Sep 2020 12:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600259962; bh=SG4MuQp/zwduxe3VaSSRDORy0X7NqWtWqo77LpwkLVw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=clfcM+a6rpyIvjE9f/xKkFEArCvnhlB83pHLnB4FRf9h/LWBgsDNWuLET6KuYTnlg ipu1/I8F0W3MU7Xv6S7hEF6BswSLvz2VZlaBcO+rZHonVu7dRFYKA54uWJ7VdXESG3 ryxftx2FjhHc+UTLAyC8ogG/hxgTSlN2VjehXuzo= Date: Wed, 16 Sep 2020 13:39:14 +0100 From: Will Deacon To: David Brazdil Subject: Re: [PATCH v2 00/10] Independent per-CPU data section for nVHE Message-ID: <20200916123913.GA28056@willie-the-truck> References: <20200903091712.46456-1-dbrazdil@google.com> <20200914174008.GA25238@willie-the-truck> <20200916115404.rhv4dkyjz35e4x25@google.com> <20200916122412.elxfxbdygvmdgrj5@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200916122412.elxfxbdygvmdgrj5@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200916_083924_436358_4F798D9D X-CRM114-Status: GOOD ( 21.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Arnd Bergmann , Suzuki K Poulose , Marc Zyngier , linux-kernel@vger.kernel.org, James Morse , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Tejun Heo , Dennis Zhou , Christoph Lameter , kernel-team@android.com, kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 16, 2020 at 01:24:12PM +0100, David Brazdil wrote: > > I was also wondering about another approach - using the PERCPU_SECTION macro > > unchanged in the hyp linker script. It would lay out a single .data..percpu and > > we would then prefix it with .hyp and the symbols with __kvm_nvhe_ as with > > everything else. WDYT? Haven't tried that yet, could be a naive idea. > > Seems to work. Can't use PERCPU_SECTION directly because then we couldn't > rename it in the same linker script, but if we just unwrap that one layer > we can use PERCPU_INPUT. No global macro changes needed. > > Let me know what you think. > > ------8<------ > diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S > index 5904a4de9f40..9e6bf21268f1 100644 > --- a/arch/arm64/kernel/vmlinux.lds.S > +++ b/arch/arm64/kernel/vmlinux.lds.S > @@ -195,11 +195,9 @@ SECTIONS > PERCPU_SECTION(L1_CACHE_BYTES) > > /* KVM nVHE per-cpu section */ > - #undef PERCPU_SECTION_NAME > - #undef PERCPU_SYMBOL_NAME > - #define PERCPU_SECTION_NAME(suffix) CONCAT3(.hyp, PERCPU_SECTION_BASE_NAME, suffix) > - #define PERCPU_SYMBOL_NAME(name) __kvm_nvhe_ ## name > - PERCPU_SECTION(L1_CACHE_BYTES) > + . = ALIGN(PAGE_SIZE); > + .hyp.data..percpu : { *(.hyp.data..percpu) } > + . = ALIGN(PAGE_SIZE); > > .rela.dyn : ALIGN(8) { > *(.rela .rela*) > diff --git a/arch/arm64/kvm/hyp/nvhe/hyp.lds.S b/arch/arm64/kvm/hyp/nvhe/hyp.lds.S > index 7d8c3fa004f4..1d8e4f7edc29 100644 > --- a/arch/arm64/kvm/hyp/nvhe/hyp.lds.S > +++ b/arch/arm64/kvm/hyp/nvhe/hyp.lds.S > @@ -4,6 +4,10 @@ > * Written by David Brazdil > */ > > +#include > +#include > +#include > + > /* > * Defines an ELF hyp section from input section @NAME and its subsections. > */ > @@ -11,9 +15,9 @@ > > SECTIONS { > HYP_SECTION(.text) > - HYP_SECTION(.data..percpu) > - HYP_SECTION(.data..percpu..first) > - HYP_SECTION(.data..percpu..page_aligned) > - HYP_SECTION(.data..percpu..read_mostly) > - HYP_SECTION(.data..percpu..shared_aligned) > + > + .hyp..data..percpu : { Too many '.'s here? > + __per_cpu_load = .; I don't think we need this symbol. Otherwise, idea looks good to me. Can you respin like this, but also incorporating some of the cleanup in the diff I posted, please? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel