Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp672261pxk; Wed, 16 Sep 2020 14:02:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJKf4laJfba3gQQWyIWY9L/mcmzGVXMbNt412Xqi8rOGfdePtxtqCLm9BUJ6KbA3bqR9F7 X-Received: by 2002:a17:906:7248:: with SMTP id n8mr27115104ejk.160.1600290145030; Wed, 16 Sep 2020 14:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600290145; cv=none; d=google.com; s=arc-20160816; b=u68xdkFDMkNSTSdlIjtliMNvd1zk32n1s3+eeDjttCNCEUGFkdjUH7bytO+IQ81wJr Rd2G+RBmtSXWrp5M5+CoXysVUxEqerh64esH0uus5jDz61TiIHUGhgpDvGat9AVXGOE7 TdEZwUH1p9eU1DcyjNH7K5pvP05ve+TxegtcxT9n6+Jf7t6Cpz8vhkA/kOxLY+4D/O6s h7R1zPs3Qg4gLcD9SYNv0yC9L2EEsmjrVF+n0z2nUmwgnq/Bm8yEicEtmEowHNu4Izhe 7AHGNZ8KYWkbFpw3yYxat26QhHhjkR8oLwmA9yw2YAPaxG3jO4ktSDBhHEumFNSHqsLQ tKvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yWmAHcgT2wDa3AHqlJ16t/WowuUKj+5oH128IS3to+s=; b=aZGQu1b8AZL65tqJTI993Lz6I1Vf1eDib8O9lEjgj8YxYBVSyGXuI3S97m6cj+cCkd RtkSGG/NJYV2zPMruTZ9AExsvjEXM7M1qJf3rEUMe/3B7oXZtlMaIsf494nT24rnkbP3 Gn0nqej6XbQII2pr0/OdyU0oG7eaM7f4bpAGlQvuYwy6xyaQpGptXYNBTeBb4PZUYxcR vEbUFksKERNokCzNvnl5ikEhxsBHAyHnVygj5B8K2Kr1BuwN3iI0ew4JGdUgAPJaBpXv dIIGvYq1p6ri+H9VpegNOKbFYoOUEnlrHonWlLdV/wwyU/cmpfeoe5I/Jp4lBPalKFqg mqmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ecyvxJA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b10si13514171edq.484.2020.09.16.14.02.01; Wed, 16 Sep 2020 14:02:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ecyvxJA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728569AbgIPVAu (ORCPT + 99 others); Wed, 16 Sep 2020 17:00:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726419AbgIPQaY (ORCPT ); Wed, 16 Sep 2020 12:30:24 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB0C0C0A3BFE for ; Wed, 16 Sep 2020 05:24:15 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id z4so6724816wrr.4 for ; Wed, 16 Sep 2020 05:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yWmAHcgT2wDa3AHqlJ16t/WowuUKj+5oH128IS3to+s=; b=ecyvxJA9SssekdAOtuviJ13pOnV2clLGkWhiOWO+2yrKD8LW/yxDkjFG3CzSaKPwdz lO4l8QLk4EjgOwdsycDk3JkggZLdyWLIjx79hY9n3+KYGB1WQIAQ4FECAlbZPLNNzst2 +V8xxssKHQL+hxHT661evNUe9qi63Lr5THWvEXVzmU8ys481d4Icv0X7UrGAWcX3Y6R6 TW53J0GJUqSsZ/FtTU9WDgV3l69ZLSMQ+ne9CePfgEfWy5GDf3/fHWWq15NCFehU95v3 AHJkB5O7SLJY0IhMVow1YeZiDiMLuOOGL8aCTq8O7o0OtK/8YUEzsxMcZLk6TNgC2ruT WwzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yWmAHcgT2wDa3AHqlJ16t/WowuUKj+5oH128IS3to+s=; b=RiVict7AuQ8+0J9iqiZ6HBslv4fvxtN4IY4LfuIq7WztDCP2cARaF7QqFHsxgEYkrp cF+b8OMC7ZKEt/P6WeFtLY2DjBS0N4jK5x1mFmwcrSvcX/20K017J+E9XlUAgPLkuyUl sm5Jy2MgC4sAQWotJ7FY9Aa+Ip3cqwjtakN0gapyA978kRdXnCvgmwpCCNPjTas/zoUT GCiuPVStFepoyfm1NyHXxcpv3P7RQbjfNcyPNAGUiVqp3bLFU286/fy4hMmS0AFzzJVx 2lRdFUm5K1rEOjqLO+LnZDU9Do36Ev3tTpxuJ6PVW6DyLkwot1vYa2RN4EgoldA82pop m0eg== X-Gm-Message-State: AOAM532D9MhTzbPkeQp1ON5wXmnfZW48ZeQ8biabBh5S3lg3giy1KCq8 8uVlHfN1YJ3nXoRn8yFlYAAvYQ== X-Received: by 2002:adf:9b8b:: with SMTP id d11mr19383508wrc.71.1600259054273; Wed, 16 Sep 2020 05:24:14 -0700 (PDT) Received: from google.com ([2a01:4b00:8523:2d03:e49d:f6be:d31b:ad3c]) by smtp.gmail.com with ESMTPSA id j26sm2567165wrc.79.2020.09.16.05.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 05:24:13 -0700 (PDT) Date: Wed, 16 Sep 2020 13:24:12 +0100 From: David Brazdil To: Will Deacon Cc: Marc Zyngier , Catalin Marinas , Dennis Zhou , Tejun Heo , Christoph Lameter , Arnd Bergmann , James Morse , Julien Thierry , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arch@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v2 00/10] Independent per-CPU data section for nVHE Message-ID: <20200916122412.elxfxbdygvmdgrj5@google.com> References: <20200903091712.46456-1-dbrazdil@google.com> <20200914174008.GA25238@willie-the-truck> <20200916115404.rhv4dkyjz35e4x25@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200916115404.rhv4dkyjz35e4x25@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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 : { + __per_cpu_load = .; + PERCPU_INPUT(L1_CACHE_BYTES) + } } -----8<------ David