From patchwork Wed Sep 22 12:47:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12510551 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=-18.2 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, 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 AAE92C433F5 for ; Wed, 22 Sep 2021 12:51:57 +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 6EA40610A0 for ; Wed, 22 Sep 2021 12:51:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6EA40610A0 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=n3/YJxCRDNMo9ovMIktftFXXqKdY+nwTnoe8+yH3eTs=; b=zIDIaGMpx9HKX+7Q6xvyqeift8 iH0myrgbTWOO0Bdfx7l2hVcmQs5ODrrW41wt1fornaIAERwGvc66p7WPvxmr8nu2cUDJdhSlzmbqA FTKU7ZfGLPshnnk5sEJz7A+Y42bcGQUb4/MfoEsWCjJPh2hf+MCb078cO9rkBHYP6z4iV9eh9PWw1 Mbstrh56k46UaTCJ/6Lh3jzIfO96zM5Wigwqtqjp/J2f4No11zb/2/79wC8Nu9QHvcuTya7+JybI3 OUN9HDChpRy1uTVbWBF8Vz7fgInfKQYSj5TOPVqC794oMXg6nOSK9VMYmZPcs4cVveZAsMsum5F0k EDW0xWpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT1hY-008Q8T-HX; Wed, 22 Sep 2021 12:50:17 +0000 Received: from mail-qt1-x849.google.com ([2607:f8b0:4864:20::849]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT1er-008Ovt-8s for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 12:47:30 +0000 Received: by mail-qt1-x849.google.com with SMTP id l22-20020a05622a175600b0029d63a970f6so8026139qtk.23 for ; Wed, 22 Sep 2021 05:47:28 -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=VDXP3setiKLnEkr+m8sXiGgb9NQ7LpnbUrrcIbXKtWo=; b=YhjUmlV5OpV1LXBTgzD8/h4cw2tRnnfej2OdpOQpSGJxMxFm+HDvY9vdNn7/RVXaxA lVbEnrUF58QW9sv1C6OK93B5CyDwhDWtQ4NMEpn/M8vw6kRj8RiFofXL2HGYyVZ46ghF oMxWjdWfsofPMRxWOOdMyIvmnVxOyner4uS2ykvqR73D33N3r/sub3jwu3PTk/Crd/c4 y3V/DEQoTtMLQ7dGuaD7wLT3jw6R5oSx2QT8EDVkWoffehArauEXCYepe5rAYc01TdzY vbQSAEObj8/viDQul62w2oFY9l+j0cxFaDKLITiZVWrv7+OFhyHSy1SFp7xEU/TMu9yI 5KqA== 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=VDXP3setiKLnEkr+m8sXiGgb9NQ7LpnbUrrcIbXKtWo=; b=pQmC2A+xZMu3hEyej8lH3JvXS54kVrQyOT0otJKYETmewCoVkY7TPr/zx8FzmNGWx9 LYFKhLkA0z9EbmIvRZh+PwDsiMpAAqhp7ylPQmKbdUp564rseOn9KhJrN29hcXgZdRAk h7+VyqFpfTIxQ+BYT8ciCKGg7O60O1P4A3nLuTtBFqFVar6g3pAy4IQJU5BLUur0uG1e 7pDkfZ+vwyQR1z1x4vpdNUY2GKxPMm+KC0H1hqtSPB3Xt6FcZCCgsHNYPy5zOWZK6SP5 F11o5yWxwVLeYDCY0xadrm5SnjedIVmJpRCh4SXM6jrCTB2XKTz+SNfS3O5qvl86QwSj 3vCw== X-Gm-Message-State: AOAM533A6nTyZ9CY+nBwL1AonWi0IDKzhhzOUkKXKiGkJUEwhG+DTfFl 6xAT49mH0vWmtITkbkyGlt7LDgHxdA== X-Google-Smtp-Source: ABdhPJyQbCBi9wL/tzdvEaSavXwKPtQuvp/ahZuW35rtc+EuWLIOI43tUp6sSo2sedY/Dgz5GrvXBg5Ung== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a25:8881:: with SMTP id d1mr15958608ybl.289.1632314847844; Wed, 22 Sep 2021 05:47:27 -0700 (PDT) Date: Wed, 22 Sep 2021 13:47:02 +0100 In-Reply-To: <20210922124704.600087-1-tabba@google.com> Message-Id: <20210922124704.600087-11-tabba@google.com> Mime-Version: 1.0 References: <20210922124704.600087-1-tabba@google.com> X-Mailer: git-send-email 2.33.0.464.g1972c5931b-goog Subject: [PATCH v6 10/12] 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-20210922_054729_392038_58A1FBBB X-CRM114-Status: GOOD ( 12.54 ) 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 ef8456c54b18..13163be83756 100644 --- a/arch/arm64/kvm/hyp/nvhe/sys_regs.c +++ b/arch/arm64/kvm/hyp/nvhe/sys_regs.c @@ -19,6 +19,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; static inline void inject_undef64(struct kvm_vcpu *vcpu)