From patchwork Wed Jul 14 09:55:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12376503 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=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 0D340C07E9A for ; Wed, 14 Jul 2021 09:57:27 +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 C380661040 for ; Wed, 14 Jul 2021 09:57:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C380661040 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=gWlvemn2vdnW/8houaGYzrOgiZ5f1AwWuwe97sX4F7E=; b=Qht4tmhY/ZJKZM 8Hcb+QotTzalAij5mg/HhgUnjnGo88rFHLBXN/EjsrJ17X4CbyyFD6aG0lzWTkFQ31lt/fhIPaPpq a4xJG2zWZVWfuEitD2EolJ+FWhi6lc8EjGpJ33Sh+5Zk/AME/ud6Rxl5u2CQbsTCvhP1n98KqK0py rZ5XmnW1VuLluNpaWYDDaYp70dd8nTtUSVCLl/UR1KRGXdhfRIkjmhvzwuXNsNMnQ1b/AM2szKZHc BxdPEoPJdv8CyFglh5989VH+EAdzJL4tbiUB6Cvws7xCRJeIxlTlDEa2PMZYcenDoijudP8XWTlk1 8r4Rsc4bEcAQ03sJRWbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3bbr-00Cxwe-Ey; Wed, 14 Jul 2021 09:55:19 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3bbm-00Cxu2-Nq for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 09:55:16 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BA0851FB; Wed, 14 Jul 2021 02:55:06 -0700 (PDT) Received: from monolith.cable.virginm.net (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AE0DC3F774; Wed, 14 Jul 2021 02:55:05 -0700 (PDT) From: Alexandru Elisei To: maz@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Cc: james.morse@arm.com, suzuki.poulose@arm.com Subject: [PATCH 0/5] KVM: arm64: Cleanups and one optimization Date: Wed, 14 Jul 2021 10:55:56 +0100 Message-Id: <20210714095601.184854-1-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210714_025514_863325_62A5697A X-CRM114-Status: GOOD ( 10.88 ) 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 The first four patches are cosmetic and aim to remove the inconsistencies I noticed around ctxt_sys_reg/vcpu_sys_reg and how feature bits are checked. The last patch is a minor optimization to the way KVM disables profiling when running with VHE disabled. Based on v5.14-rc1. The changes touch quite a lot of code, I'm happy to rebase on another branch if necessary. Boot tested on an odroid c4 with 4k, 16k and 64k guests running on 4k, 16k and 64k hosts (so 3 x 3 tests in total). Alexandru Elisei (5): KVM: arm64: Move vcpu_has_feature() to asm/kvm_host.h KVM: arm64: Use vcpu_has_feature() to check the feature bits KVM: arm64: Rename __vcpu_sys_reg -> vcpu_sys_reg KVM: arm64: Add __vcpu_sys_reg() KVM: arm64: nVHE: Remove unneeded isb() when modifying PMSCR_EL1 arch/arm64/include/asm/kvm_emulate.h | 7 +-- arch/arm64/include/asm/kvm_host.h | 13 +++-- arch/arm64/kvm/arch_timer.c | 20 ++++---- arch/arm64/kvm/arm.c | 5 +- arch/arm64/kvm/fpsimd.c | 2 +- arch/arm64/kvm/guest.c | 6 +-- arch/arm64/kvm/hyp/exception.c | 4 +- arch/arm64/kvm/hyp/include/hyp/switch.h | 6 +-- arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 12 ++--- arch/arm64/kvm/hyp/nvhe/debug-sr.c | 1 - arch/arm64/kvm/pmu-emul.c | 58 +++++++++++----------- arch/arm64/kvm/psci.c | 2 +- arch/arm64/kvm/reset.c | 12 ++--- arch/arm64/kvm/sys_regs.c | 54 ++++++++++---------- arch/arm64/kvm/sys_regs.h | 4 +- include/kvm/arm_psci.h | 2 +- 16 files changed, 103 insertions(+), 105 deletions(-)