Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1794025pxb; Sat, 23 Jan 2021 05:58:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzn8L5N/kJtoyJfGYidyS5soZK3I/dQ/uO56mD4tWP5VpntRVfwLC2xnb58U3BwQs/8Ts+8 X-Received: by 2002:a05:6402:144:: with SMTP id s4mr7070062edu.63.1611410313214; Sat, 23 Jan 2021 05:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611410313; cv=none; d=google.com; s=arc-20160816; b=cGgu4R+31WNnqzjcm+DPyD4ar9bv+QdOfhaGbsFIUvK44dX6n3WzepfF8OH3qxV3VN VhxQ3MCceaLbdJcyVFU8S3GO0sl6PsW8krbbj/CDzZbstA30yzkN/0hj7VXZIDiJ46DP b+0qzI0mxJbX4xd8S2nqYvGWcJlbYKOQbPQSgyUCfo3gm3fdYsehsRxhNGJw9XKBw7Gs QPlEemnS112fsRqZUsfcT4HqBp+8fCUTt6WqrTQlh0uT15GHXLHeUQcJHd0syOLxKY8k M61xz9HyS47U7XUEo+Opz9gzmMMQIEvWuw/R9e4UYINl0eJd0UBk4An2wmWM78UQlT3l qAAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=5k8odDx5YO5hhR5kS0tWF6VhT/X6U6IJREWJPmva1Tc=; b=voVhcTpOq2Gw+WZniCfjz/ImTnSw794CzL77ZSM2qCD9tIb45ciJduQr9E5vSrJQQO ZgY6Do2KJGByjzcM1JC0Xp9qOzUzohhfi/GKxnOkeKvKUcKmxKbmljv0Xn3711foBZ5X wB6ba7a2ZrTbLAmQzDIE58z9K2b+tnpdDDweF/gjzMoeSBmrt/UORSK/hquvIgYKv0M/ mHjjYaJqu6ylbpu+MCnmheiND4/73ckFhd0Pr03j1MJjsdMQ3c40r5BjSAR0ybm2KIm4 WlycD+z2SBev3FleYgav2dHEVslaZY8gCIs4mXRPLgYANQABvQUkFxVmQmbE8UWuu4Ow r53w== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr15si4092069ejc.287.2021.01.23.05.58.08; Sat, 23 Jan 2021 05:58:33 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725827AbhAWNzd (ORCPT + 99 others); Sat, 23 Jan 2021 08:55:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:60362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725275AbhAWNza (ORCPT ); Sat, 23 Jan 2021 08:55:30 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 A30BB22B48; Sat, 23 Jan 2021 13:54:49 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1l3JNH-009bsW-PK; Sat, 23 Jan 2021 13:54:47 +0000 Date: Sat, 23 Jan 2021 13:54:47 +0000 Message-ID: <87y2gjkbbs.wl-maz@kernel.org> From: Marc Zyngier To: David Brazdil Cc: kvmarm@lists.cs.columbia.edu, Catalin Marinas , Will Deacon , James Morse , Julien Thierry , Suzuki K Poulose , Ard Biesheuvel , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 8/8] KVM: arm64: Remove hyp_symbol_addr In-Reply-To: <20210105180541.65031-9-dbrazdil@google.com> References: <20210105180541.65031-1-dbrazdil@google.com> <20210105180541.65031-9-dbrazdil@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: dbrazdil@google.com, kvmarm@lists.cs.columbia.edu, catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, ardb@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 05 Jan 2021 18:05:41 +0000, David Brazdil wrote: > > Hyp code used the hyp_symbol_addr helper to force PC-relative addressing > because absolute addressing results in kernel VAs due to the way hyp > code is linked. This is not true anymore, so remove the helper and > update all of its users. > > Acked-by: Ard Biesheuvel > Signed-off-by: David Brazdil > --- > arch/arm64/include/asm/kvm_asm.h | 26 ------------------------ > arch/arm64/kvm/hyp/include/hyp/switch.h | 4 ++-- > arch/arm64/kvm/hyp/nvhe/hyp-smp.c | 4 ++-- > arch/arm64/kvm/hyp/nvhe/psci-relay.c | 24 +++++++++++----------- > arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c | 2 +- > 5 files changed, 17 insertions(+), 43 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h > index 8a33d83ea843..22d933e9b59e 100644 > --- a/arch/arm64/include/asm/kvm_asm.h > +++ b/arch/arm64/include/asm/kvm_asm.h > @@ -199,32 +199,6 @@ extern void __vgic_v3_init_lrs(void); > > extern u32 __kvm_get_mdcr_el2(void); > > -#if defined(GCC_VERSION) && GCC_VERSION < 50000 > -#define SYM_CONSTRAINT "i" > -#else > -#define SYM_CONSTRAINT "S" > -#endif > - > -/* > - * 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) : SYM_CONSTRAINT (&s)); \ > - addr; \ > - }) > - This hunk is going to conflict in a fairly benign way with the removal of the GCC workaround which I think Will queued for 5.12. I'll work something out... Thanks, M. -- Without deviation from the norm, progress is not possible.