From patchwork Sun Oct 10 14:56:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12548609 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DF8EC433F5 for ; Sun, 10 Oct 2021 15:01:40 +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 3AE4460F55 for ; Sun, 10 Oct 2021 15:01:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3AE4460F55 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=QsQSBPZyWG4ZfO6n2zntSKAcMZ4rtqmiwug1+e6+Wgw=; b=PRsvwmaD3ofCL+Z5hweniRb/Je +0vmR2pkU6p5ODBvgYxvLZRa82CUmFncFJU4wDBFi1dXOGm226AP8/4tIQa6z2prUvNgBTo0+F+KT jcwUJNGG+GHt/OluMjHxmEshJNRi7uC0WLMtaNHwaC58JwJTB+lX6GpHZR3gmOorgLjZ+kkOUIpee k5DY9JBNLeTD525BJrhuYMFgr2RU6Rj2d774cUCz7GWYhA3t8yne6zLSzFQPez2OkaXXkJKhkH2yc LB8pcj3OghnfMnEmVbKbff8srREaghmsjeuOwgwiPXGe1C4nNxThen4f3afd0HJSaq9peVxg7mY6i BM8txVXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZaHw-006z4o-Tx; Sun, 10 Oct 2021 14:58:57 +0000 Received: from mail-wr1-x449.google.com ([2a00:1450:4864:20::449]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZaG4-006yKa-1L for linux-arm-kernel@lists.infradead.org; Sun, 10 Oct 2021 14:57:01 +0000 Received: by mail-wr1-x449.google.com with SMTP id j19-20020adfb313000000b00160a9de13b3so11187531wrd.8 for ; Sun, 10 Oct 2021 07:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=NjmzICmgs/1/SRU9S1PIoFoU/QO2NcwvWdQNYWVlfS8=; b=qJXoTWLIck34aUq2vWI+yRaH1p2dPNKc5RilSQ2TjF15hJYVdQuO5LFwBiwz2+s7qL qxbP45kiEkCMKWlfQnu0m2Ry0UozRA/bQwdyQBMnYT2sR9IB7G/hdRavPrAKAzpQ1wLk mCYRuz3EEmXPvrUPcSUfqr4t9T97djcmNdiProPKbbscCqxiiSgwL7Ov9itNNYvmbuVy RaLpTyex5ZZ8iJc6mYhQaB8nfl44lpN2GSxh5GKhsI9iQtd9zOI1xXGC7Oh7EimAOYif AdVJAh6lq2JOqJuQW0F5Gx9eKRg76zaPBFYIdO9frERP5eKgKLoEgc7b36X5DA1/8/Gl nFzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=NjmzICmgs/1/SRU9S1PIoFoU/QO2NcwvWdQNYWVlfS8=; b=aTARN50UDQOYRV3Z7Pzb/++wM2t/UqAOjHwP4QjjBiRy/IosdMd9v6csI9aM9+BnKI 68L5rP8iwYgCRAr/SKgb18NRTv6dngVx7Rruw2irq1WMv0uOLpAAd3OcDFR60kbj/p3Y crRBb54Nx4+6W6b0ePxZ9iq+0LhNGxygv9MWqA0MAg6bBaid8QUBpLcCH4t5K0aFerq7 /vacJuIIvQXXktxJsk8s1hSaRZ7z0wWs/w1vY8Pk17F6KLfbeEdltq3PcTcfPCTzDTem iz+hfBY9JYdbLFMPk1PHnNZCC6dkWv4sOmnwjxMqpwV35Q6cuzv91nSKDNZ3ZIuFWmP5 UVNw== X-Gm-Message-State: AOAM530EaipyihsqgbB6KvmLdG0wkZl+vtCqqNIgbsYSr7QTUTYHOqjX lEwgItSnrZLt2ZdvPoqy1Oh7G94yhw== X-Google-Smtp-Source: ABdhPJyaRIw2i8Vmfc3FxfbM4wwoieTXOLpMnD+P+7LcGqnctSEbohnVUEjCI/49CwnkqLd//Ok/pbYkGw== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a1c:19c4:: with SMTP id 187mr15371722wmz.149.1633877817910; Sun, 10 Oct 2021 07:56:57 -0700 (PDT) Date: Sun, 10 Oct 2021 15:56:34 +0100 In-Reply-To: <20211010145636.1950948-1-tabba@google.com> Message-Id: <20211010145636.1950948-10-tabba@google.com> Mime-Version: 1.0 References: <20211010145636.1950948-1-tabba@google.com> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [PATCH v8 09/11] 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-20211010_075700_130449_DEFA9FD9 X-CRM114-Status: GOOD ( 11.64 ) 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 2a07d63b8498..f6d96e60b323 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; - 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 6e3ea49af302..6bde2dc5205c 100644 --- a/arch/arm64/kvm/hyp/nvhe/sys_regs.c +++ b/arch/arm64/kvm/hyp/nvhe/sys_regs.c @@ -21,6 +21,8 @@ u64 id_aa64pfr0_el1_sys_val; u64 id_aa64pfr1_el1_sys_val; u64 id_aa64isar0_el1_sys_val; u64 id_aa64isar1_el1_sys_val; +u64 id_aa64mmfr0_el1_sys_val; +u64 id_aa64mmfr1_el1_sys_val; u64 id_aa64mmfr2_el1_sys_val; /*