Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3850737pxb; Tue, 10 Nov 2020 01:25:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2dGbTkdVcNN8ONsMWqXgyZNZUfigR3SQIt+GmcKABprXEleVNbeucTL+k9OajxbNmjs9m X-Received: by 2002:aa7:db48:: with SMTP id n8mr20658106edt.123.1605000353979; Tue, 10 Nov 2020 01:25:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605000353; cv=none; d=google.com; s=arc-20160816; b=LZlOcIXrcuvS0TYgi/lv5F77BhCSiTHEWhzMFD5QTcsEGHZSONTIeRaDSj//uax+6F 67LLLOfzjdtY5sjnV+cIBvhlcFZujRPoUARPIx5FHBShhI1Va11ZNvHOcCZ2F8vFxY91 XXpPCz2BMK6C6+bov6/I7lHi9doUMPQvamxTodCsY2L31CwEwhlUCxzqHtY5EBcOurLo xEiLRfeCpSpdk0g2m221h0xHaIQQuoSx5GJmoGroQduEFERYpdseWr7J+EG9NBRLidsy BchKgrBsBS084/8PwmwMMxi8p1Z4eFPniLpm68UBlDOqr4Apf989+T/b6IsV8fDdrwTx t56g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ieiicjOVe5riWnNrGnNnOrGqxp8ieWPyQM5kKffkvIM=; b=uOdUM/RCO5hOWmKuQuAwukUMk4QbwcQKXJJR573Z0hjJHkw1xpaRqq4xFDFmMx1C2v lu/Q/OEn2wH9gxeJisnUmex2q3J1eScNWU9fy5/QQyK/iNM8Uqa4alZS7z1lNhyaZZ8W Gqs/EWLHPY6ao3k7CaR1gUkGsuDbQ18Kcy+Mb1ULQZVm6Xkue4w8z2flJQdQzHWFJ3mX FiUWklAoKFxE730pkyPPG3hei9qOpnYOqsnhT77UiYsmiO53DwGosvvcODbmtvwNr/jh a9pUbDti7dd7OXYK+DDSiWd0w7s8nolVJHgBaV/NyQn8qs11UaWZDTqzgEovJ0HJPa0F KqkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=onpjg59A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id uz28si8481430ejb.599.2020.11.10.01.25.31; Tue, 10 Nov 2020 01:25:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=onpjg59A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726986AbgKJJYJ (ORCPT + 99 others); Tue, 10 Nov 2020 04:24:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbgKJJYI (ORCPT ); Tue, 10 Nov 2020 04:24:08 -0500 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 701A5C0613CF for ; Tue, 10 Nov 2020 01:24:08 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id h2so2289553wmm.0 for ; Tue, 10 Nov 2020 01:24:08 -0800 (PST) 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=ieiicjOVe5riWnNrGnNnOrGqxp8ieWPyQM5kKffkvIM=; b=onpjg59Abm3k/FX1eLLE+4S8TaHOTOxJQpqlR1b9xO2ff40pv8k9S77fKMkdTIZLWo Bh04quAn5x4D2JXa07xkgK5jMzsHoH6lxOJSVSMfaNKgpiNR85WlPOvpeKq3x07s0gOE i6coaA1gTlFR2JR3uPkHuiGNlae1Ayeh+rpIWAImirMVVOho58G848Bx7tzkckBQdpen b/ByI6ZrBCQ1V05YD4/qQSoG6rwTFV67xgf1ogX4l+ClrYWbNxM9XTnmai5pjFCUA2rA VSinRm1J4g/2haCwW2bCDPJCsjEZUJBu5Yhp5pR/2Flo9QLXkUKG+6/CeHZscobnT22D oggQ== 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=ieiicjOVe5riWnNrGnNnOrGqxp8ieWPyQM5kKffkvIM=; b=Gn9H3rInXhcLobnf5C/KwDgGuox9r8i4qL25Az0ulezvfqJ1xU/7YP4ZQVcgyA+FPU DyBMRC2brw8ONbu0w0yh4VPdj2dz6NEBxXciswZNRTjQESpbYm9xGfPj9Rzgm3ZcjI02 t9SA0ZheJ7a0rF7ZJitwfldi4rN2DRu7lvSU29R/NgLP2V2mew3UbzgxGIf6ZfVGJ5FC hnf7jnzCcMnBsPhM3M03CGhhe/J6Hlhafpk3NYccRFP5pqDYt9Qg7gIg0YLpuRO8OJVd somnNFQZPBlidBFb0EWtV8I0cKBczc4/vnar89ZG9MaUSPqFcMWM/owUC2aEGeSviR7+ xkMA== X-Gm-Message-State: AOAM532V2ujBjabCrBJJuB+yBjHaZ0NtnOj2h2J1SNt7ExXWx1IFAJRm Yi8R0GN17gKxEq8/KuF0U3fQgA== X-Received: by 2002:a1c:63c4:: with SMTP id x187mr3704674wmb.172.1605000246872; Tue, 10 Nov 2020 01:24:06 -0800 (PST) Received: from google.com ([2a01:4b00:8523:2d03:870:7715:aaa1:475e]) by smtp.gmail.com with ESMTPSA id q17sm1248351wro.36.2020.11.10.01.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 01:24:05 -0800 (PST) Date: Tue, 10 Nov 2020 09:24:04 +0000 From: David Brazdil To: Marc Zyngier Cc: Quentin Perret , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, James Morse , Julien Thierry , Suzuki K Poulose , Catalin Marinas , Will Deacon , Dennis Zhou , Tejun Heo , Christoph Lameter , Mark Rutland , Lorenzo Pieralisi , Andrew Scull , Andrew Walbran , kernel-team@android.com Subject: Re: [PATCH v1 17/24] kvm: arm64: Add __hyp_pa_symbol helper macro Message-ID: <20201110092404.lduvqjpjzeea57vi@google.com> References: <20201109113233.9012-1-dbrazdil@google.com> <20201109113233.9012-18-dbrazdil@google.com> <20201109165933.GA447754@google.com> <1951645a457232caeca323bec2af5408@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1951645a457232caeca323bec2af5408@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 09, 2020 at 06:10:05PM +0000, Marc Zyngier wrote: > On 2020-11-09 16:59, Quentin Perret wrote: > > Hey David, > > > > On Monday 09 Nov 2020 at 11:32:26 (+0000), David Brazdil wrote: > > > Add helper macro for computing the PA of a kernel symbol in nVHE hyp > > > code. This will be useful for computing the PA of a PSCI CPU_ON entry > > > point. > > > > > > Signed-off-by: David Brazdil > > > --- > > > arch/arm64/kvm/hyp/nvhe/psci.c | 10 ++++++++++ > > > 1 file changed, 10 insertions(+) > > > > > > diff --git a/arch/arm64/kvm/hyp/nvhe/psci.c > > > b/arch/arm64/kvm/hyp/nvhe/psci.c > > > index b0b5df590ba5..7510b9e174e9 100644 > > > --- a/arch/arm64/kvm/hyp/nvhe/psci.c > > > +++ b/arch/arm64/kvm/hyp/nvhe/psci.c > > > @@ -20,6 +20,16 @@ s64 hyp_physvirt_offset; > > > > > > #define __hyp_pa(x) ((phys_addr_t)((x)) + hyp_physvirt_offset) > > > > > > +#define __hyp_pa_symbol(sym) \ > > > + ({ \ > > > + extern char sym[]; \ > > > + unsigned long kern_va; \ > > > + \ > > > + asm volatile("ldr %0, =%1" : "=r" (kern_va) \ > > > + : "S" (sym)); \ > > > + kern_va - kimage_voffset; \ > > > + }) > > > + > > > > Could this be simplified to __hyp_pa(hyp_symbol_addr(sym))? That would > > avoid the dependency on kimage_voffset. Ah, didn't see that one. Ok, removing this patch. > > I'm going to move away from evaluating kimage_voffset at runtime anyway, > see [1]. Awesome! One more dependency gone. > > Thanks, > > M. > > [1] https://lore.kernel.org/r/20201109175923.445945-1-maz@kernel.org > -- > Jazz is not dead. It just smells funny...