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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 95010C4363D for ; Thu, 24 Sep 2020 10:10:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41C9023977 for ; Thu, 24 Sep 2020 10:10:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727374AbgIXKKy (ORCPT ); Thu, 24 Sep 2020 06:10:54 -0400 Received: from gentwo.org ([3.19.106.255]:48690 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbgIXKKx (ORCPT ); Thu, 24 Sep 2020 06:10:53 -0400 Received: by gentwo.org (Postfix, from userid 1002) id D7A6C3F1AE; Thu, 24 Sep 2020 10:10:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id D4FD23F1AA; Thu, 24 Sep 2020 10:10:52 +0000 (UTC) Date: Thu, 24 Sep 2020 10:10:52 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: David Brazdil cc: kvmarm@lists.cs.columbia.edu, Catalin Marinas , Will Deacon , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Dennis Zhou , Tejun Heo , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v4 00/10] Independent per-CPU data section for nVHE In-Reply-To: <20200922204910.7265-1-dbrazdil@google.com> Message-ID: References: <20200922204910.7265-1-dbrazdil@google.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Sep 2020, 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 percpu subsystems point is to enable the use of special hardware instructions that can perform address calculation and a memory operation in one interruptible instruction. This is in particular useful to avoid higher overhead for memory management related counters because preempt disable/enable etc can be avoided. ARM cannot do that and thus has a LC/SC loop. This is a patchset for ARM64 so its not clear to me what kind of advantage there would be against a simple implementation that does a regular fetch from a base address with an offset. > Main benefits: > * independent nVHE per-CPU data section that can be unmapped from host, > * more robust linking of nVHE hyp code, > * no need for hyp-specific macros to access per-CPU variables. Maybe simply don't use percpu variables for your arm code? Those pointers to data will be much more indepedent of the rest of the kernel and allow a much higher degree of being self-contained.