Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1042627pxk; Thu, 10 Sep 2020 05:46:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC/Zq8VFKXxLGmyZY4ej700uNxcfpOavCEqAz60qTKMz07GxilhGXGTXgZ4P8qx2PJ6Isn X-Received: by 2002:a05:6402:17f6:: with SMTP id t22mr8920268edy.374.1599741962079; Thu, 10 Sep 2020 05:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599741962; cv=none; d=google.com; s=arc-20160816; b=xb0dsG+msaMY2lCgPEDAxuncYqDtzfWK1KlJpk9OqCjGOqHnXwLuPt+CyT+wmoH8LQ iMqH43VWdPNCLVtmTNNE0IjGFyaBddq7MqOEKg5o+6aPeycavr5tlTmq5pfjPUJzd6Rk USZRVtZ+qPLsJ50O+QyazlZQpJrX9qpEEPGz7na9nhNR2wuyWcYRqsNs3iTohb3UH5lT PX+cV0+Fi70ZDc+SFE9ViTv+I2iBJsc6lPYtQn3JEdbr42dDo1dSS3hZyicPjmZhbj2S OK+WqBfYXkso8opZXz+XFW0WQ5sr5+pevPN3gUrBou1r3IELLBniXt24Hgk86EE+Xyx0 necA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ou9injEFK3ynx6TLorApjrz9C+IV+NUJDgRb4FiGCd0=; b=KQF2Am0SWMWKbyBpPUidQOLs1MBXAXgUJM+h1CyZ0eSjrXMUMUwYpb3sySv6mWJ7m5 +5kr7VJlj44e0Xrjhd4TdEkS6xdJ6MuQLFbevpqvLUyzYGrC84T4wySKYjbZm1ZYB9BC wlL3xY4MXmZHwTSmbuaRRi4sJJESoOnvUZdkCfkVrdfDNfsqOmOxyqQBXx+JZz/Nidle W47Mx+D7qjreCKiPCq1v4wryHd4Ue9dcu9+9f3gkkFYnmHo0x0V86O5iqtcrot0zSMvc 9smWFUkzlIQqbs+p++FbwKkR3dksmSSbt5SbSbOIaxt8SbbMPp/IEC8sA/D6oogSzeQ/ U+mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JpErupGX; 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 d20si3320208ejb.704.2020.09.10.05.45.37; Thu, 10 Sep 2020 05:46:02 -0700 (PDT) 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=JpErupGX; 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 S1730395AbgIJMlB (ORCPT + 99 others); Thu, 10 Sep 2020 08:41:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727805AbgIJMfJ (ORCPT ); Thu, 10 Sep 2020 08:35:09 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E646DC061756 for ; Thu, 10 Sep 2020 05:34:59 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id e16so6546106wrm.2 for ; Thu, 10 Sep 2020 05:34:59 -0700 (PDT) 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=ou9injEFK3ynx6TLorApjrz9C+IV+NUJDgRb4FiGCd0=; b=JpErupGX9fulmYZvxtdV0U32w7X1pxyfApvEkhWK8zhYuxW1uI+EqU5Fjv9BaF9H/V YurieurqjypG7BJAUBnBCH5arbZ3tVER2qmEt+rAqI4sfn3j4bXg9iz0fRz0pKoPNL3y YSW2fRVwWb6wg82ODMDH5pUFWZ0GjjH48pGAH5EmstenSokAdTz7Xt7zn4OgIwRIR4l9 0fLwBGV8McXKD8aluzhihwYePyApjjulnhMvLjwOH3WO1/cwpNtD7nu9TdVZ4OCMjA8S c9CQIJkAS0fQVUjZIlIZtaLGjr0eQHoBc0Ml2c5fY6fYDFZIe4MRDXrAX2YVoKmv1DK0 bwYA== 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=ou9injEFK3ynx6TLorApjrz9C+IV+NUJDgRb4FiGCd0=; b=XqUfkq2om2vcnCJXv5EkyVfTKE9q2uUftjiWxp9/yhzJmspE9cNp79QgNwKqJZ5dhD BrmI8TnqCgt3vhrGRFQtluwYAAUrjiUlxU2Jo2WQLtCDhFXGBULi7N3YF/Sd5O0Mgl+E e6MykB6oGp8X8YWpbaxDi8uNgCj8FnEV+ynF8YGSWtqWOkkJTwDhJn7pXIYKaHQkwwlv qC9xc6i9BJws4tBroNXhkeVTDrEP3riQSGMZeEavDHL7THJ/U8gjFo+QGEM1mjk0fau2 PbJHceFO0jbAR9Ez6u07og5uU13yL2JD9IWYQgl4Rs3r+cBbjhSg7iUUo3ix5jDdlmMz 06kw== X-Gm-Message-State: AOAM532g47z9p0Fsjr3MHxrIiF2W57trAnimd6GQoxPqllmPj6u7xtZ2 8wOS5YrijqSBl3m6tWNED0hJpg== X-Received: by 2002:a5d:6886:: with SMTP id h6mr9066135wru.374.1599741297317; Thu, 10 Sep 2020 05:34:57 -0700 (PDT) Received: from google.com ([2a00:79e0:d:109:4a0f:cfff:fe4a:6363]) by smtp.gmail.com with ESMTPSA id n21sm3532461wmi.21.2020.09.10.05.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 05:34:56 -0700 (PDT) Date: Thu, 10 Sep 2020 13:34:52 +0100 From: Andrew Scull To: David Brazdil Cc: Marc Zyngier , Catalin Marinas , Will Deacon , Dennis Zhou , Tejun Heo , Christoph Lameter , Arnd Bergmann , James Morse , Julien Thierry , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arch@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v2 04/10] kvm: arm64: Remove hyp_adr/ldr_this_cpu Message-ID: <20200910123452.GD93664@google.com> References: <20200903091712.46456-1-dbrazdil@google.com> <20200903091712.46456-5-dbrazdil@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200903091712.46456-5-dbrazdil@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 03, 2020 at 11:17:06AM +0200, 'David Brazdil' via kernel-team 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 nVHE hyp mode case can be handled using the > __KVM_NVHE_HYPERVISOR__ macro. VHE selects _EL2 with alternatives. > > Signed-off-by: David Brazdil Acked-by: Andrew Scull > diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h > index 54d181177656..b392a977efb6 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 > +#ifdef __KVM_NVHE_HYPERVISOR__ > + mrs \dst, tpidr_el2 Another part that might also apply to __KVM_VHE_HYPERVISOR__. > +#else > +alternative_if_not ARM64_HAS_VIRT_HOST_EXTN > + mrs \dst, tpidr_el1 > +alternative_else > + mrs \dst, tpidr_el2 > +alternative_endif > +#endif > + .endm