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=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 64440C43461 for ; Wed, 16 Sep 2020 11:55:51 +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 E5203206B7 for ; Wed, 16 Sep 2020 11:55:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="K+sIB0te"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="JyQsV3C/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E5203206B7 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com 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=h1xDXbyXvGeCvtFB3PAHnif8X8LM86Ti+o1jdexSBCg=; b=K+sIB0tez1biC9uSBGfLOpPPB DuUy52/GX9JI1yeADS1gV1sSR1Pp164V5VhtVURqrnzRoLzcHi9bTS1Q1h53YWtLo+fsfQIAXeUJ1 p/G98G5rjnh3MkSFBHSiUwX7ih1XV/9/Wx1WOpsyd2kjCygpspt4FVc28gB4dYXJeu8dsCN5zWGGE wTO6kOkmhh3JgH3x8iNMwskrSC2JL/BG2AV6hLbOxuv6vpFEVF+btmlMcBVYKhBe6IEGtTk/JQZIZ /kMKVE43QFYsCnqSq4uUaRN5aeRoub1PsBz+lQHkIcerHm1iJlPMt+q0gJ+uyUSV7rj4x+ZQF9plL cwC7xOxSQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIW0q-00009C-5P; Wed, 16 Sep 2020 11:54:12 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIW0n-00008d-Ah for linux-arm-kernel@lists.infradead.org; Wed, 16 Sep 2020 11:54:10 +0000 Received: by mail-wm1-x341.google.com with SMTP id z9so2713636wmk.1 for ; Wed, 16 Sep 2020 04:54:07 -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=Yh0igFnXFGH3K7pZzQhRNs7ViU5/hMjpnGkORzHpipk=; b=JyQsV3C/yV+HMhjcrBeo4b6vbtbXN/7M7NJbIgBea1ZCl6bB/Wv56zT6tM39MhZYIz 1ePZsPTW5M75mT5wRpRoNtZy/x1FJ8O69Jo5IFaxDlzHdWeRiNrB4GKbyft7T7Rf3m7c aWwz5PsssRQJClQFnacWnvlS5MQg4yUM9L2jw8VuALu4NTPRUxNv67kIW5FUWGPCDVP9 yMm7HzrgXsD04qEeBHOQTjc1spMBk+h1ObSRut8UsG0poo7gRH4ptNx9EujbEMj5Cb7U w4FXV2249ahLD5jNOQ2ov9+67BvirUZC0p0CE4a+dXdPSDP2nJyRXQPZXP6lPs90vfLk zTZQ== 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=Yh0igFnXFGH3K7pZzQhRNs7ViU5/hMjpnGkORzHpipk=; b=FvCgoKpLFKWyhnZvAlTf0ISSY6lLJVR7leGuqXD2u9A/YWyPJSECaMWcd2sXYBg+6J i1SncudhlImDXhLAs7zdGIw830tKTv9/g/wvmcPPm1NfarDnEDaUKWlC6ZfT7vvKXNta US4eAofs5g0n0QUQidjXbN1/ZJa6YS+6SwqEbXeVx15p8nUBYBxKMygfnwB2ypXqxys0 /jEXf6+yvamj8LvGDJq2U1fOvy9ZaHkV8qCkVVo5zrDMtAg5Bq3KoBLP4cEK6dH9yOyH AyqyMVYkn+QopP9//ecB437OZQQJLNNifF7WFWMmxhayC5rgYPwaFsTZ/j2q4ttrtbva GXfA== X-Gm-Message-State: AOAM532T2BbLTz6vA/t/fQNxznARgP5hD3Hh0g26a+klh21FEb9jHfXD bSvLgsSu+VUqdiZmGM3f0veZmw== X-Google-Smtp-Source: ABdhPJwEUCld1s87TOjbwzmcs50r5qVIn7ePIrzWPUYEsAFENq0CtkJ+OctMHBN++deLK1KNg4U8hw== X-Received: by 2002:a05:600c:2118:: with SMTP id u24mr4258846wml.59.1600257246355; Wed, 16 Sep 2020 04:54:06 -0700 (PDT) Received: from google.com ([2a01:4b00:8523:2d03:e49d:f6be:d31b:ad3c]) by smtp.gmail.com with ESMTPSA id u66sm5088416wmg.44.2020.09.16.04.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 04:54:05 -0700 (PDT) Date: Wed, 16 Sep 2020 12:54:04 +0100 From: David Brazdil To: Will Deacon Subject: Re: [PATCH v2 00/10] Independent per-CPU data section for nVHE Message-ID: <20200916115404.rhv4dkyjz35e4x25@google.com> References: <20200903091712.46456-1-dbrazdil@google.com> <20200914174008.GA25238@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200914174008.GA25238@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200916_075409_418897_55DB1BE8 X-CRM114-Status: GOOD ( 25.02 ) 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 Hi Will, On Mon, Sep 14, 2020 at 06:40:09PM +0100, Will Deacon wrote: > Hi David, > > On Thu, Sep 03, 2020 at 11:17:02AM +0200, David Brazdil wrote: > > Introduce '.hyp.data..percpu' as part of ongoing effort to make nVHE > > hyp code self-contained and independent of the rest of the kernel. > > > > The series builds on top of the "Split off nVHE hyp code" series which > > used objcopy to rename '.text' to '.hyp.text' and prefix all ELF > > symbols with '__kvm_nvhe' for all object files under kvm/hyp/nvhe. > > I've been playing around with this series this afternoon, trying to see > if we can reduce the coupling between the nVHE code and the core code. I've > ended up with the diff below on top of your series, but I think it actually > removes the need to change the core code at all. The idea is to collapse > the percpu sections during prelink, and then we can just deal with the > resulting data section a bit like we do for .hyp.text already. > > Have I missed something critical? I was wondering whether this approach would be sufficient as well because of the simplicity. We'd just need to be careful about correctly preserving the semantics of the different .data..percpu..* sections. For instance, I've noticed you make .hyp..data..percpu page-aligned rather than cacheline-aligned. We need that for stage-2 unmapping but it also happens to correctly align DEFINE_PER_CPU_PAGE_ALIGNED variables when collapsed into the single hyp section. The reason why I ended up reusing the global macro was to avoid introducing subtleties like that into the arm64 linker script. Do you think it's a worthwhile trade off? One place where this approach doesn't work is DEFINE_PER_CPU_FIRST. But I'm guessing that's something we can live without. 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. Thanks for reviewing, David _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel