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=-7.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FSL_HELO_FAKE,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 02075C43461 for ; Thu, 10 Sep 2020 12:35:03 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 6C5CA20BED for ; Thu, 10 Sep 2020 12:35:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="JpErupGX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C5CA20BED Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E5D8E4B3AB; Thu, 10 Sep 2020 08:35:01 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uTv44hB5Ctpb; Thu, 10 Sep 2020 08:35:00 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id DFE2D4B2F3; Thu, 10 Sep 2020 08:35:00 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7AC144B294 for ; Thu, 10 Sep 2020 08:34:59 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7-9hP2LeqTop for ; Thu, 10 Sep 2020 08:34:58 -0400 (EDT) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 7C9094B2F3 for ; Thu, 10 Sep 2020 08:34:58 -0400 (EDT) Received: by mail-wr1-f65.google.com with SMTP id o5so6466099wrn.13 for ; Thu, 10 Sep 2020 05:34:58 -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=OiG1UWU+hFkqcaYQ36aWuNIy3HpZ/BwcKOIAApa6rZmtbgN4wfEBO9XmvgUL0RfiTI Q4hqcDxkFCzd3XE/f9OVpL4REIJTBrfbCWd211sxgPjmLJ7Z+vg9cBAqJcxXdr6CT/NY hu+3fCJNYBFLj8Kd+ZkeUwDEOkBCFHmojwZseKvQrlucX3+//TRQ1csW7mtsvG4ch3lA rQhFNEFAcFqnKYAjZRwRYgQZ1u+BMnqy17PWrvQGp/WYd4dMMxVXECxtkH0DsI0mvDwW 2P8LdBJ/4tjgjPcDkbUUXUGa8lG4ffQ1CuGTrnI9fylcyJr+kxACR8KC2R1EbgU47nQO YulA== X-Gm-Message-State: AOAM533Cb5nGY7t3uZx2wxEdwVp+MWCx3tUX91/EIku8DbgZyCCP8Uv7 wA5o/hDmM1aP+czu9mQlpZAXzQ== X-Google-Smtp-Source: ABdhPJzW0hcZaP/tw8LsHLMPTKiwkkYHFromXeW07uLdryNq4J0OhAM1tb62eb6pB/v/hKExJM8Mhg== 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 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-Disposition: inline In-Reply-To: <20200903091712.46456-5-dbrazdil@google.com> Cc: linux-arch@vger.kernel.org, kernel-team@android.com, Arnd Bergmann , Marc Zyngier , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Tejun Heo , Dennis Zhou , Christoph Lameter , Will Deacon , kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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 _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 030FFC433E2 for ; Thu, 10 Sep 2020 12:39:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B677721D7E for ; Thu, 10 Sep 2020 12:39:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="JpErupGX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730688AbgIJMi7 (ORCPT ); Thu, 10 Sep 2020 08:38:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730619AbgIJMfJ (ORCPT ); Thu, 10 Sep 2020 08:35:09 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6238C061573 for ; Thu, 10 Sep 2020 05:34:58 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id a17so6516109wrn.6 for ; Thu, 10 Sep 2020 05:34:58 -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=KbO4SwVAALobF/kL4LmF+ItoAw2ZMOSkJF0bpACDW5fqWr2vKZ6dOw8Zmffcm+TmWv aO85oxVgOK7mNGnYregf/LRqNN702JMcpBW/nhCKhJ+NGGsP9Q0tpRYex749ezeLoRpZ S5RRCoOREoZ8iM1YViYyR7By/qZMOBIAXsR5Vz07vGlKqhWq0kIVbsELUSowQZ/uOxOH AGg5lHvgApafP7U1aifyl4ppUoDj0nCVe5HMyIyiJsxutsOrnR6ceIXWJEOWRLuh04sY rpr64U4+6svafhBlVF8S8L0qOvlt+sSs9xMH4FvqwMbSqvfjM5oU5Jllcl7MkIUUj9yy 6Asg== X-Gm-Message-State: AOAM533om9VDe/YyumrY6/WZbqFw4eB0bAZwr0bwhWbG8RYStiD2JZzH ijUM5kmwt4VlUICG3thvk/0d7Q== X-Google-Smtp-Source: ABdhPJzW0hcZaP/tw8LsHLMPTKiwkkYHFromXeW07uLdryNq4J0OhAM1tb62eb6pB/v/hKExJM8Mhg== 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-arch-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arch@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 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=-7.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 5BDC8C07548 for ; Thu, 10 Sep 2020 12:36:15 +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 F08E2208FE for ; Thu, 10 Sep 2020 12:36:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dH4NKZzE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="JpErupGX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F08E2208FE 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=IitWDV7gZ0zrvAXWsmf82rONAhUoqioMqRwfxlCoZG4=; b=dH4NKZzEf9vnckKv+zlQi8lia owYmeW4g+P4r2zfNFj4u1Zl/idQs+izY3Id6aLWRjKG6LZGgypVwM3aWkobiD/XRGcRL+y5/ZDd66 scVLA5w11VtkT942vZ6X1Kg0mvi4qMosjKxvkXsg8+NkWvtmSpjDupIDycTPs7nE3LHVuIHyOg8pw qY3YCjlSF5AzRMtju0KwUeFWebB/TB8SxaN/PYzaT/mo8SIUkxQ3GA7Wce7q3wPmoDPeNlIPZ2LsQ 2Pzmar+HA8MvDz624rNVksUaQx1xD0q5wsp+4/BnPaaSRASGy+zsglAU67+K49q9gtqaH3zyfNmLa rVXqqewIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGLn3-0004n6-DL; Thu, 10 Sep 2020 12:35:01 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGLn0-0004mG-Cp for linux-arm-kernel@lists.infradead.org; Thu, 10 Sep 2020 12:34:59 +0000 Received: by mail-wr1-x442.google.com with SMTP id e16so6546105wrm.2 for ; Thu, 10 Sep 2020 05:34:58 -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=KVjkqIfinUYq/R+ACGCewzZzVZJCp/UNg0t4GMaMewISlRZPuRdnyiKpc06NIZiPhy 3H9L9049PRc6QyIMatLcFFsabAolms3aa1aNubME0POAHcAjwI6BcpUUYwUR35SzCDMg 7JrHDkaJntuWgrHWOyY53WoNDJ5NdguSJC7B961fFEcLRBoGRxz8Qk41XssnELl/C9bM 44bW5AOLz3pH0q+aVVuLazURVomOb9a77KOaxvik2AlWViTG0L5PIVEvN96CpytimQDr rJInzW1qEz4P/guVA4XtNciOVAXFjlh39Zb96ycDUsXUD7UKwOJ1EVsNA9KAaBbQYjtw pLMA== X-Gm-Message-State: AOAM532CwJ2kA1/JpqoQvJgph7WAR0dKAxRgLaI1L10tGIsXmGBQCFJm e6I1FKfC+XOaZMcQ+eqAyoNhzg== X-Google-Smtp-Source: ABdhPJzW0hcZaP/tw8LsHLMPTKiwkkYHFromXeW07uLdryNq4J0OhAM1tb62eb6pB/v/hKExJM8Mhg== 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 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-Disposition: inline In-Reply-To: <20200903091712.46456-5-dbrazdil@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200910_083458_458443_48E23296 X-CRM114-Status: GOOD ( 18.16 ) 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: linux-arch@vger.kernel.org, kernel-team@android.com, Arnd Bergmann , 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 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel