Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp150990yba; Fri, 5 Apr 2019 04:03:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZw0oaEl+9ynWw/r0yTYB1CAbhLY0PUIxm8QFDhAYQi4s9jCr2odr0eSr30Dwnctbi2A3e X-Received: by 2002:a63:df43:: with SMTP id h3mr11607631pgj.294.1554462199648; Fri, 05 Apr 2019 04:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554462199; cv=none; d=google.com; s=arc-20160816; b=qpkXy9uGAiHO1FX7H+0HUflGFdNJjGPfEjvlGm9F+cDOECFFyHBt+FQgMWGnXIal5v 88/4xL/FDqtVmut161JIVf3M1Pp9z6JjbtFlLw4glmJAkjb8v105yv9Kjf9bPszxtyPA s5f4SfYek6c38cx14+bYXEeD7vRFmtsPnhghp8qwvjiEB/mvmcNcGu24fo0gEdBoTLok byIaWVBlwXikl9bcBMS0ec46CAD80G/s1PzukjX4igxAwuAoMeL5mDIcXfoUufSsOZtj 1lrBAtDZo4ruNmhtIh9PzMTIdcNmHIainXkAq787eRU6OTO4wdZoBWNWRV/h9mLgtpGz OkSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WiDN0xwJ91dXylughqspp/Sl6i3qMfdwG0OpZLl5jlU=; b=oc/hoZRPFh+JoWdWjTEJUm2He3abHbtthkyHlGKfme6nuRooLndUWeGum+2VjDwfnV DENeOsmaiEg4kElD5DhX5sD3sI9kg7D4fmxvL8IashVVCxWgNf5mx0vHuJ3c5ADBlYdF RHBPaqoqykTivk24sIBj3XwutEDanSV4gqp4/EYzMRXa3rxTrjnY6d3jt6GXMlT1CeS8 t3fgm19Ngbnqtc8nBwEPB+fZfzofjb8/nl184fZ/B20al5YrTjS9FeO1n2Bisj8KH8h4 1M3CXIhQLvxvG0hdBQ3CgiEAEC0S4vCHkOlAgnO+E6DaSAxYwDjflI6zNxZ89kcrVfpZ 9CNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n125si13429590pgn.389.2019.04.05.04.03.03; Fri, 05 Apr 2019 04:03:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730788AbfDELCY (ORCPT + 99 others); Fri, 5 Apr 2019 07:02:24 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45990 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730546AbfDELCY (ORCPT ); Fri, 5 Apr 2019 07:02:24 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8202E168F; Fri, 5 Apr 2019 04:02:23 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D89863F557; Fri, 5 Apr 2019 04:02:21 -0700 (PDT) Date: Fri, 5 Apr 2019 12:02:19 +0100 From: Dave Martin To: Amit Daniel Kachhap Cc: linux-arm-kernel@lists.infradead.org, Marc Zyngier , Catalin Marinas , Will Deacon , Kristina Martsenko , kvmarm@lists.cs.columbia.edu, Ramana Radhakrishnan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 3/9] KVM: arm64: Move hyp_symbol_addr to fix dependency Message-ID: <20190405110219.GQ3567@e103592.cambridge.arm.com> References: <1554172037-4516-1-git-send-email-amit.kachhap@arm.com> <1554172037-4516-4-git-send-email-amit.kachhap@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1554172037-4516-4-git-send-email-amit.kachhap@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 02, 2019 at 07:57:11AM +0530, Amit Daniel Kachhap wrote: > Currently hyp_symbol_addr is placed in kvm_mmu.h which is mostly > used by __hyp_this_cpu_ptr in kvm_asm.h but it cannot include > kvm_mmu.h directly as kvm_mmu.h uses kvm_ksym_ref which is > defined inside kvm_asm.h. Hence, hyp_symbol_addr is moved inside > kvm_asm.h to fix this dependency on each other. > > Also, hyp_symbol_addr corresponding counterpart, kvm_ksym_ref, > is already in kvm_asm.h, making it more sensible to move > kvm_symbol_addr to the same file. > > Suggested by: James Morse > Signed-off-by: Amit Daniel Kachhap > Reviewed-by: Julien Thierry > Cc: Marc Zyngier > Cc: Christoffer Dall > Cc: kvmarm@lists.cs.columbia.edu > --- > > Changes since v7: > * Slight change in commit message [Julien Thierry]. > > arch/arm64/include/asm/kvm_asm.h | 20 ++++++++++++++++++++ > arch/arm64/include/asm/kvm_mmu.h | 20 -------------------- > 2 files changed, 20 insertions(+), 20 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h > index f5b79e9..57a07e8 100644 > --- a/arch/arm64/include/asm/kvm_asm.h > +++ b/arch/arm64/include/asm/kvm_asm.h > @@ -80,6 +80,26 @@ extern void __vgic_v3_init_lrs(void); > > extern u32 __kvm_get_mdcr_el2(void); > > +/* > + * Obtain the PC-relative address of a kernel symbol > + * s: symbol > + * > + * The goal of this macro is to return a symbol's address based on a > + * PC-relative computation, as opposed to a loading the VA from a > + * constant pool or something similar. This works well for HYP, as an > + * absolute VA is guaranteed to be wrong. Only use this if trying to > + * obtain the address of a symbol (i.e. not something you obtained by > + * following a pointer). > + */ > +#define hyp_symbol_addr(s) \ > + ({ \ > + typeof(s) *addr; \ > + asm("adrp %0, %1\n" \ > + "add %0, %0, :lo12:%1\n" \ > + : "=r" (addr) : "S" (&s)); \ > + addr; \ > + }) > + Do we need to include in vgic-v2-cpuif-proxy.c now? Otherwise, Reviewed-by: Dave Martin