From patchwork Tue Aug 17 08:11:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12440865 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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 1AF0AC4338F for ; Tue, 17 Aug 2021 08:21:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D59E460E52 for ; Tue, 17 Aug 2021 08:21:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D59E460E52 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ibIbEwNy5xkVs1gIFzpVzBbyq1D8q59cjDXlPUDZXoU=; b=GYWx17fo4nvb1s0pCvlgU7rG4v EePAdEaE7sGhliuUwkC0/DAYKhR6Ycv5LH+2BdPaNB4p2nC2JJPVE+/Dm2L4IsHTfAI78yEnuyLQN cyP3iEowwllyUI2smvRmmkJxnfkxp30dDoLW0LkBZiA5C1OfQmkByHeLxu/AcELKLWi6LRRds1ks1 cHYWVnMWsCetPszAXXseFPOVzNYXY1EM1+TaU5KalmZeG78L6uvYRJCN4Sbe8srlWRMDyQAdh9Ll6 ev2BTe9+BbHU0u9CxMK/jZh+CVDXEAqy078X2kuU0bDZrLjBTdvPCcNuQWHT7b5ec6YOFeYaw80i3 zlajsAcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mFuJP-001YJG-K4; Tue, 17 Aug 2021 08:19:08 +0000 Received: from mail-qv1-xf49.google.com ([2607:f8b0:4864:20::f49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mFuCb-001VJH-9m for linux-arm-kernel@lists.infradead.org; Tue, 17 Aug 2021 08:12:08 +0000 Received: by mail-qv1-xf49.google.com with SMTP id iw1-20020a0562140f2100b0035f58985cecso6977358qvb.10 for ; Tue, 17 Aug 2021 01:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=CiI5OAhgkZ42MHJT2zFxCH5sP5MyitED8/DF2mknSW8=; b=N2qruQnB57J1upAsUBNREhuAR3StiZe2QzZ5sJCUFNr7a3zSqoFVSMrJWMj6bHPTUK sVdDMSI+dJ/2JRgJ8G7NYagBFHT+BsSJASB/c9Y9FZjN/j1EhQL8ZYFI4QrA0gDqs0jC 2elLEehk23jjYdR5Hx9ZvwyBJA3KuoaOl8qY7/L784YKX0c0FHWN+05BCelz8E5rfgYS 9OXpPNBscLSGqXjwGNMw8ANyt8vZVJGLDn81YtH5QtnkigIIlnlB/oZD6JA5no2Yliw9 UaUriYgFKVvMl273Yj5Z1x3GVVDTMO/Ctqzlkz4vX+gat3oxvr4o7/kY7fAK+aF7UkLF u4mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=CiI5OAhgkZ42MHJT2zFxCH5sP5MyitED8/DF2mknSW8=; b=uHHudVHbQ5Pj+3+3y2I8WqU6Zx+91Z5PFfIk8TOlF40cBBa2frKkHGmzSc7Dy7E1Q0 gbVDmUkd2Ty5R+9glAE200nmYlTTOUpimFPFLYJUu5c3ZZeQtc2gH2gxgPAhSuDbxZS3 41UYhOneOBgaxirTEbMMA2dJP6/U017tWi8RyFrJZ69BDDXfVpk8QLenpA+GBdDDoGn6 zn7ZBamZBxDiXJxf/aFji5+OLq8uTiuMkHw+zXjVrNnsUPIoj0v8v/FPPnOQkPSr7Sdx YoCcdUbMnrFnt69gaKU1bvhNKqIRNPa0LraAEQBVk5BIBbjAM9SenM4rTPtSgUl4P4yt ZXSQ== X-Gm-Message-State: AOAM533exkS2jzX67nLGpnV4CD4gyth+Okd9I8XRfaz1C7sYz9ShJgdc jKzV9y8AoUyrxS7XWOxAiUL9+c3t1w== X-Google-Smtp-Source: ABdhPJx3EYuucuTVJB6wfR0mR5/W7Jcy3V7XAywnfoLLIN/YNpK/SPf6PSNDn9Ub/h9uKoQlJkPSo44QGg== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a05:6214:10c4:: with SMTP id r4mr2134781qvs.58.1629187923801; Tue, 17 Aug 2021 01:12:03 -0700 (PDT) Date: Tue, 17 Aug 2021 09:11:32 +0100 In-Reply-To: <20210817081134.2918285-1-tabba@google.com> Message-Id: <20210817081134.2918285-14-tabba@google.com> Mime-Version: 1.0 References: <20210817081134.2918285-1-tabba@google.com> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog Subject: [PATCH v4 13/15] KVM: arm64: Move sanitized copies of CPU features From: Fuad Tabba To: kvmarm@lists.cs.columbia.edu Cc: maz@kernel.org, will@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, mark.rutland@arm.com, christoffer.dall@arm.com, pbonzini@redhat.com, drjones@redhat.com, oupton@google.com, qperret@google.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, tabba@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210817_011205_435552_B3381043 X-CRM114-Status: GOOD ( 11.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move the sanitized copies of the CPU feature registers to the recently created sys_regs.c. This consolidates all copies in a more relevant file. No functional change intended. Acked-by: Will Deacon Signed-off-by: Fuad Tabba --- arch/arm64/kvm/hyp/nvhe/mem_protect.c | 6 ------ arch/arm64/kvm/hyp/nvhe/sys_regs.c | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c b/arch/arm64/kvm/hyp/nvhe/mem_protect.c index d938ce95d3bd..925c7db7fa34 100644 --- a/arch/arm64/kvm/hyp/nvhe/mem_protect.c +++ b/arch/arm64/kvm/hyp/nvhe/mem_protect.c @@ -25,12 +25,6 @@ struct host_kvm host_kvm; static struct hyp_pool host_s2_pool; -/* - * Copies of the host's CPU features registers holding sanitized values. - */ -u64 id_aa64mmfr0_el1_sys_val; -u64 id_aa64mmfr1_el1_sys_val; - static const u8 pkvm_hyp_id = 1; static void *host_s2_zalloc_pages_exact(size_t size) diff --git a/arch/arm64/kvm/hyp/nvhe/sys_regs.c b/arch/arm64/kvm/hyp/nvhe/sys_regs.c index cd126d45cbcc..d641bae0467d 100644 --- a/arch/arm64/kvm/hyp/nvhe/sys_regs.c +++ b/arch/arm64/kvm/hyp/nvhe/sys_regs.c @@ -20,6 +20,8 @@ */ u64 id_aa64pfr0_el1_sys_val; u64 id_aa64pfr1_el1_sys_val; +u64 id_aa64mmfr0_el1_sys_val; +u64 id_aa64mmfr1_el1_sys_val; u64 id_aa64mmfr2_el1_sys_val; /*