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 D66E7C43461 for ; Thu, 17 Sep 2020 08:35:59 +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 703D620684 for ; Thu, 17 Sep 2020 08:35:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UuCXy4pd"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="OqIh71Za" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 703D620684 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=9suce0Ayv3zeFKt29MYMOW+OtTq93NqsXqoMKFusHGM=; b=UuCXy4pdwsYkIhxtGYs72kvNT mFDivcreOSry9Ndat5pEuElksnCU5+vBQheickA7008qt17t1ZQeVJwlle7GZslHLwHSQqG9J1prR iPsikpsAbSuJqN9Dim3A2QUORWiuSEO49eGeg8dmjFJA6b2609as0m43xda/sJCRmv2SWqLpiwO8i AdWe/wlfwc/2Ck1BO2BeIttgVzwcMQXgLWOe/HDjT8ACuvhRj/T+kNRi2KUvjS2aVVQndvYZq2b1j Kpph/ttmlTEN0UAozNU2dU1EMBUZtAqQ4UtT3nvpSRnZdUKIQvGGcFgRTl30guV+b/u4WQ6Oeb8w8 Z1QwJ99pA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIpNE-00005P-H5; Thu, 17 Sep 2020 08:34:36 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIpNB-0008Vi-DX for linux-arm-kernel@lists.infradead.org; Thu, 17 Sep 2020 08:34:34 +0000 Received: by mail-wr1-x441.google.com with SMTP id e16so1100573wrm.2 for ; Thu, 17 Sep 2020 01:34:33 -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=Pk1ggKwYhiZFij3cWsXPx/AsObXSSswRVDTN18QPE2I=; b=OqIh71Za/Sfud+/Ld2OIcnclZx0GScK1SioXnMYhhN+wJMXNO+nPqZVsSowByH13lC IA6VorWMqWg30MkyELqC6xs0OUIYHEpQ1N2DayLyrSn6ouvhsIfCAuKYtjiTW+wd3ouU jb3YvRKbbD2HnPJAhGCH53RJMDZ6i/Jg/pj2l3dAbI5yyfqfzyqgHU8awtuhdEs/sEHb J5gH3ixTa90rSdfYZcFrvEw9cFofCjgTDONXYlmxjKFrqpT2OyF+JPKkg7+0luusumjR ZI8i1Pjyu6ykougSn/5jMLvYtGPzAD6CVr/1WKJDk5qo6HFoWi/zZ+Ua9z+YFBgCzakv 8CUg== 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=Pk1ggKwYhiZFij3cWsXPx/AsObXSSswRVDTN18QPE2I=; b=LG9QnsJeLh6BV8nb2FHK+73fvHVQCLH88rK9F+v7IcGG1nIcTK+MqQlnR/TTrAPg/m TtE58hXrQY8rvZAnyvW+R/DcibJ21P3o9GEKLQu6h/QZ97/HcI4iQs5kL7ZnolMSBas+ EMDpSFsJV+I8arvqfMV1TWVBSkXF3sKkCy1HDkpHoWir7rQy5vrPiLTZwDroYUGuDcxd 2k8vnVwGlJGgi81pyKC8KdB1sB7sLR5jTRglSlmO/jJSM+/grvslEN7F5ptaRMQIfFc4 sYYiVGhnBS8Cmj0z0YDgRfo9WOszOLaMlYVItU+R5+zHydVqgquhJpXLqfgmAn5Bt61A XXbw== X-Gm-Message-State: AOAM531QEb6vZZ+He/nhrPDIo+kreW9rANkAROGx82uC4N+KH1HOITNH j2h1mRRlcNU+0n0C4sizde1nRQ== X-Google-Smtp-Source: ABdhPJx4CDiIDgawZUzofKbr1/03K2/UnXYclUCZ/yVoEIhOqk5tUiGj9MxMh78vMqiYe0X3zEL3rw== X-Received: by 2002:a5d:4645:: with SMTP id j5mr30654727wrs.230.1600331672159; Thu, 17 Sep 2020 01:34:32 -0700 (PDT) Received: from google.com ([2a01:4b00:8523:2d03:1155:1c40:3244:2fc2]) by smtp.gmail.com with ESMTPSA id s17sm39708604wrr.40.2020.09.17.01.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 01:34:31 -0700 (PDT) Date: Thu, 17 Sep 2020 09:34:30 +0100 From: David Brazdil To: Andrew Scull Subject: Re: [PATCH v2 03/10] kvm: arm64: Remove __hyp_this_cpu_read Message-ID: <20200917083430.sxe4rpwp2lrdu3hq@google.com> References: <20200903091712.46456-1-dbrazdil@google.com> <20200903091712.46456-4-dbrazdil@google.com> <20200910111225.GC93664@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200910111225.GC93664@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200917_043433_533665_9ECBBAB9 X-CRM114-Status: GOOD ( 20.19 ) 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, kernel-team@android.com, 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 , Will Deacon , 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 Hey Andrew, > > +#ifdef __KVM_NVHE_HYPERVISOR__ > > +#define __my_cpu_offset __hyp_my_cpu_offset() > > Is there a benefit to this being used for __KVM_VHE_HYPERVISOR__ too > since that is "hyp" too and doesn't need the alternative since it will > always pick EL2? Minor time and space savings, but you're right, makes sense to treat them equally. Updated in v3. > > +/* Redefine macros for nVHE hyp under DEBUG_PREEMPT to avoid its dependencies. */ > > +#if defined(__KVM_NVHE_HYPERVISOR__) && defined(CONFIG_DEBUG_PREEMPT) > > +#undef this_cpu_ptr > > +#define this_cpu_ptr raw_cpu_ptr > > +#undef __this_cpu_read > > +#define __this_cpu_read raw_cpu_read > > +#undef __this_cpu_write > > +#define __this_cpu_write raw_cpu_write > > +#endif > > This is an incomplete cherry-picked list of macros that are redefined to > remove the call to __this_cpu_preempt_check that would result in a > linker failure since that symbol is not defined for nVHE hyp. > > I remember there being some dislike of truely defining that symbol with > an nVHE hyp implementation but I can't see why. Yes, nVHE hyp is always > has preemption disabled so the implementation is just an empty function > but why is is preferrable to redefine some of these macros instead? That was my initial implementation and we could probably sway others in that direction, too. That said, I just tried it on 5.9-rc5 and there are two more dependencies. No idea what changed sinced the last time I tried, maybe I simply messed up back then. Basically, this_cpu_ptr translates to: __this_cpu_preempt_check(); per_cpu_ptr(sym, debug_smp_processor_id()) __this_cpu_preempt_check: should be empty for hyp per_cpu_ptr: needs mapping of the array of bases in hyp, otherwise easy debug_smp_processor_id: needs a clone of 'cpu_number' percpu variable Neither of these is particularly difficult to implement, and two will even be useful going forward, but it still feels too fiddly for posting this late in the 5.10 cycle. So I suggest we stick to the macro redefines for now and I'll post those patches for 5.11. WDYT? You can find the patches on branch 'topic/percpu-v3-debug-preempt' of https://android-kvm.googlesource.com/linux. David _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel