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=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 B25F4C43465 for ; Fri, 18 Sep 2020 09:07:07 +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 5AABA208DB for ; Fri, 18 Sep 2020 09:07:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AAqZuLs/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="RW9Go77W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AABA208DB 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=9Gsc1aRQg87/gR0UxuAjiaoowogrzYfty4zRdmGIleU=; b=AAqZuLs/P5sEcK254vrdvWQnq vGWyKxMgEorDVcNCNou+cS34LRMX+nh/YwCc55wy2MHic0O1im3NaSo4I1W2ywgIChAmVLWlVvuw4 97dtOClL6tm7YZp4lTvy9EtDfQxHLQepF3y2OfOPsBNHaJQEXFRZkMdZ07IcZzl+JdyYqVi6L3imW 7ktoXEE/NDpnoNxfggcp8ayyE8J74wdZiebfRabAnmMCoLDJK8VOSlCTx55YuipZDjqYH9mR3pyyl IZvrnyFivASGxJfT/g4oW5Z7rPrcBZzZ8itdXcHlEDcrYQ7ygBjPqjdI8dsAMUDGDgkfgSt3tHWtz PCrsOan9A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJCKt-0007PV-K3; Fri, 18 Sep 2020 09:05:43 +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 1kJCKq-0007OI-DH for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2020 09:05:41 +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 E677D20684; Fri, 18 Sep 2020 09:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600419939; bh=8bbkGB04wpb31wFP8bwL1MzqYlfmTRKDty4Y+cqJkqs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RW9Go77Wx9GYu/FTIOjFFIKGYaoJQirk92/zZmytjdUrm67V87Lxb3ZtGXddUhikA y0b+5uBv4Qb+wfOCqKhzOzwoifzGdX575HxGkW8mgmedHIXMHX44v/XngCe+JAGMS7 UimHKWTCG8MVKk0k7OI0G4qumwIfcUNQgpQyH1uE= Date: Fri, 18 Sep 2020 10:05:33 +0100 From: Will Deacon To: David Brazdil Subject: Re: [PATCH v3 05/11] kvm: arm64: Remove hyp_adr/ldr_this_cpu Message-ID: <20200918090533.GE30834@willie-the-truck> References: <20200916173439.32265-1-dbrazdil@google.com> <20200916173439.32265-6-dbrazdil@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200916173439.32265-6-dbrazdil@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-20200918_050540_518743_64FBD66E X-CRM114-Status: GOOD ( 19.12 ) 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: Suzuki K Poulose , Catalin Marinas , linux-kernel@vger.kernel.org, James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , Tejun Heo , Dennis Zhou , Christoph Lameter , kernel-team@android.com, kvmarm@lists.cs.columbia.edu, Julien Thierry , Andrew Scull 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 06:34:33PM +0100, David Brazdil wrote: > The hyp_adr/ldr_this_cpu helpers were introduced for use in hyp code > because they always needed to use TPIDR_EL2 for base, while > adr/ldr_this_cpu from kernel proper would select between TPIDR_EL2 and > _EL1 based on VHE/nVHE. > > Simplify this now that the hyp mode case can be handled using the > __KVM_VHE/NVHE_HYPERVISOR__ macros. > > Acked-by: Andrew Scull > Signed-off-by: David Brazdil > --- > arch/arm64/include/asm/assembler.h | 27 +++++++++++++++++---------- > arch/arm64/include/asm/kvm_asm.h | 14 +------------- > arch/arm64/kvm/hyp/hyp-entry.S | 2 +- > 3 files changed, 19 insertions(+), 24 deletions(-) > > diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h > index 54d181177656..f79231a0f949 100644 > --- a/arch/arm64/include/asm/assembler.h > +++ b/arch/arm64/include/asm/assembler.h > @@ -218,6 +218,21 @@ lr .req x30 // link register > str \src, [\tmp, :lo12:\sym] > .endm > > + /* > + * @dst: destination register (32 or 64 bit wide) > + */ > + .macro this_cpu_offset, dst > +#if defined(__KVM_NVHE_HYPERVISOR__) || defined(__KVM_VHE_HYPERVISOR__) > + mrs \dst, tpidr_el2 > +#else > +alternative_if_not ARM64_HAS_VIRT_HOST_EXTN > + mrs \dst, tpidr_el1 > +alternative_else > + mrs \dst, tpidr_el2 > +alternative_endif > +#endif Cosmetic, but I think it would be cleaner just to define two variants of the macro here: #if defined(__KVM_NVHE_HYPERVISOR__) || defined(__KVM_VHE_HYPERVISOR__) .macro this_cpu_offset, dst mrs \dst, tpidr_el2 .endm #else .macro this_cpu_offset, dst alternative_if_not ARM64_HAS_VIRT_HOST_EXTN mrs \dst, tpidr_el1 alternative_else mrs \dst, tpidr_el2 alternative_endif .endm #endif (and should we have a shorthand __HYPERVISOR define to avoid the NVHE || VHE logic?) With that: Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel