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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 4B2DEC2D0A3 for ; Mon, 9 Nov 2020 17:01:26 +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 F39BD2074F for ; Mon, 9 Nov 2020 17:01:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pHXxmp+X"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="ub6t8/MO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F39BD2074F 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=kGSXX05sTPtyaVpZFahgj23x1QX/DKdzWyNSeb06gWg=; b=pHXxmp+Xegku0o3Vr5aZ/8dJs BhEEMTrEw8oFQWPRnpm5+5t8MFyL2EF+LucQJfhNfOOPxiGwasKoy8Jh49jgGAt7cIk106fcPfMyI ncqLUCjK4eVpfAflM91WoU4ho5SrTL/ugPMgFpVuDrxRiNBjnkuvcn5GFmRbdhhLS/vDI17H6vyD/ d6XL1uozQUMGyIn9XpvJwOt1Um9B4NA3ppJLc+YbEoZuLQcC3VQ15/fcAhQdTOVSONGowTWIy7Qn2 e8z3a6S5SSWJJfr1qopg4Jmq9RZet19A8lFoSPIv+AZPFg/zMvFJU21pS73xeDzR+R8zyR7l1xdLT ZlypwnmgQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcAW7-0006fq-Fh; Mon, 09 Nov 2020 16:59:43 +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 1kcAW4-0006f8-Na for linux-arm-kernel@lists.infradead.org; Mon, 09 Nov 2020 16:59:41 +0000 Received: by mail-wr1-x441.google.com with SMTP id d12so7936493wrr.13 for ; Mon, 09 Nov 2020 08:59:38 -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=/xpU6aOe7zsc2ojDYPHqW1B2hesNecHBAri6xa34+HU=; b=ub6t8/MOSTRAo1q64ajRgsXANVnqPQ0Z+9yCni3FNC/THKKkF0KWrlmaz4Olll8n91 kVKuS1MZQFSC+t2hiWbsvar3jXt0qc4njXZbFuvLN1ktikhMbKhhMP1Wc8q/Yv/TPP+b hJ/NE1YGg+VVLbCCGwZqOoijzhJ6rvi/OyPoa3eCHndq0cb9TzQ80jQHnMpFHsHFbMsW Ft2Z4y5VsrwEdcbniSqDvm5r6hrmmARhroKk1GDg7iOaPJ7T8d6t7PSsh9AjUU6TsIIy MB6nqhIpOYeFZ/s894F5jblZArz/cSbk1ckM9cDku2Kgjpo3YCxBR4jSgQsufS9ldBO0 c6tw== 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=/xpU6aOe7zsc2ojDYPHqW1B2hesNecHBAri6xa34+HU=; b=F8vOC7ELRyiSOy+YaEVE84AwZ1ZeB9sGcOas13cp8geSGNfjC8Co/At5b1PtRh5cd1 qD+nGEFYgpTj8tqT8ET1J3zct6YV77wudcPokHWVe2QPKig2wQ3k5QCOl5uNXMi80EvC G2FWBNj66XU+8tx28z4ri8chtoER23mqb9+IdAFAmn0FUNG2Yxnvcjedaw2KnA2f8iSK Qx9bVHAfez/Q3oJgSQdve2YjvJE8VtG79hWt4//z4pF3MFuxzDGO2o5bm7FA6/udPi/D RnWgNn2L6I+i/eneFPaWXzubXoDOawQfCdpmXmOI2KQfeoUyRQFePJoDavKLLeQXQL7J 9sPA== X-Gm-Message-State: AOAM531BMRQfYNto90Ts6+LYolmSlXNRplabCD2YPP/JcvkQNe3qyuqo 4lDlgWbbhubc8j1TX49dGJpwISWxA9PJdYUk X-Google-Smtp-Source: ABdhPJxTSTLsT2jswsky+1lrZdCHipmnbSyPEtOAfZOAYkuKuCpAmY1FsIwpQPGF3duv+aoj3xTxKw== X-Received: by 2002:a5d:6689:: with SMTP id l9mr12801967wru.134.1604941177704; Mon, 09 Nov 2020 08:59:37 -0800 (PST) Received: from google.com ([2a00:79e0:d:210:f693:9fff:fef4:a7ef]) by smtp.gmail.com with ESMTPSA id b8sm7527771wrv.57.2020.11.09.08.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 08:59:37 -0800 (PST) Date: Mon, 9 Nov 2020 16:59:33 +0000 From: Quentin Perret To: David Brazdil Subject: Re: [PATCH v1 17/24] kvm: arm64: Add __hyp_pa_symbol helper macro Message-ID: <20201109165933.GA447754@google.com> References: <20201109113233.9012-1-dbrazdil@google.com> <20201109113233.9012-18-dbrazdil@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201109113233.9012-18-dbrazdil@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201109_115940_835715_01297B10 X-CRM114-Status: GOOD ( 18.47 ) 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: Mark Rutland , kernel-team@android.com, Lorenzo Pieralisi , Andrew Walbran , 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 , 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 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. Thanks, Quentin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel