From patchwork Mon May 17 16:05:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12262353 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=-22.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 139CFC433ED for ; Mon, 17 May 2021 16:07:54 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 8658760E0B for ; Mon, 17 May 2021 16:07:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8658760E0B 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=desiato.20200630; 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=l2LYn0/NfiFbLhL+K4VUTEdbiwmkc8+wHjv2eXGwMR4=; b=jbzf4zWSS8ok5SHhWjM9cm4FC/ +qb3Bn/CeNKezZcUQpdcKBI6MR/FrZKMRMxIA+u1XkVTasqUos3eJ/xX7xBQvGfqPM/LgIUSSr8it 8ETgakeyZILADHI/cqcWqaHGYKJNfe5qJAC8Ex1pBSoH3WfoMHgHKwuOYe2OxlXuGRNZirumX57Hg cXkNx7QMvNkDRRSNBQtrC3G+wF8KY6vuZwzXgIL3XHBsGna8mhKiKxkP1rC89O+PbHiCpYfShguBh T3Bb+EoSqDr3Xc8SPFVD9fRtmaz5KyRcUOxrMMbEp9Wq2P6YBRmbvytbmg5k7iGxKSYkbPJWVym0P 4yySf4OQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lifkH-00FVnC-Ur; Mon, 17 May 2021 16:05:30 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lifkB-00FVmj-U4 for linux-arm-kernel@desiato.infradead.org; Mon, 17 May 2021 16:05:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=ctd/s2k73wnJU+GQtV0/T4jaIMWaIBLcRBcD42C+img=; b=2zdV+edjF0M4JHA4okiq6RgVjH PCPUtnn+/Xaa/ZZcCegRTA+6Sdj3mtGYLCscVXGSptnpR50BwOJDiLksHHpV+OdIHpIUO5SiuCiBC KtF2toyururqt2a9LvUHJLpOSMKzcz+qV7ksnGEoePFccalPdX8HoyNzy3wS3KjRO2ZrQzq7VQzan o81DHidb99II8N3UoQjsC5tDbJTz6FGGbmUCqb2ta3otDNAXCegUDAnly546txnOd+MDEkxdeCUkW zAx3XO0uMq/C7LEO9ZaT+l7FN+PuE7XdLy7MAMP9l2uFGJjZeSSd9wOmP7pUyRBTRef9248uVQao2 KbURsywA==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lifk9-00DxbO-2Y for linux-arm-kernel@lists.infradead.org; Mon, 17 May 2021 16:05:22 +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 8211E106F; Mon, 17 May 2021 09:05:14 -0700 (PDT) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9C2B23F73D; Mon, 17 May 2021 09:05:13 -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] KVM: arm64: Consolidate functions to skip an instruction into skip_instr.h Date: Mon, 17 May 2021 17:05:45 +0100 Message-Id: <20210517160545.699995-1-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_090521_229604_F36A8812 X-CRM114-Status: GOOD ( 12.29 ) 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 function prototype kvm_skip_instr32() is used only by the hyp code, so it makes more sense to live in the hyp specific header file adjust_pc.h. Since __adjust_pc() has been moved to kvm_asm.h so it can be used by the generic code, rename adjust_pc.h -> skip_instr.h to avoid confusion and to better reflect the purpose of the remaining functions. Signed-off-by: Alexandru Elisei --- Based on git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvmarm-fixes-5.13-1 arch/arm64/include/asm/kvm_emulate.h | 1 - arch/arm64/kvm/hyp/aarch32.c | 1 + arch/arm64/kvm/hyp/exception.c | 2 +- .../arm64/kvm/hyp/include/hyp/{adjust_pc.h => skip_instr.h} | 6 ++++-- arch/arm64/kvm/hyp/include/hyp/switch.h | 2 +- arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c | 2 +- arch/arm64/kvm/hyp/vgic-v3-sr.c | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) rename arch/arm64/kvm/hyp/include/hyp/{adjust_pc.h => skip_instr.h} (90%) diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index f612c090f2e4..436b77e6d1e8 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h @@ -34,7 +34,6 @@ enum exception_type { }; bool kvm_condition_valid32(const struct kvm_vcpu *vcpu); -void kvm_skip_instr32(struct kvm_vcpu *vcpu); void kvm_inject_undefined(struct kvm_vcpu *vcpu); void kvm_inject_vabt(struct kvm_vcpu *vcpu); diff --git a/arch/arm64/kvm/hyp/aarch32.c b/arch/arm64/kvm/hyp/aarch32.c index f98cbe2626a1..65ea395d81f3 100644 --- a/arch/arm64/kvm/hyp/aarch32.c +++ b/arch/arm64/kvm/hyp/aarch32.c @@ -10,6 +10,7 @@ * Author: Christoffer Dall */ +#include #include #include #include diff --git a/arch/arm64/kvm/hyp/exception.c b/arch/arm64/kvm/hyp/exception.c index 11541b94b328..ac03ad63c1b4 100644 --- a/arch/arm64/kvm/hyp/exception.c +++ b/arch/arm64/kvm/hyp/exception.c @@ -10,7 +10,7 @@ * Author: Christoffer Dall */ -#include +#include #include #include diff --git a/arch/arm64/kvm/hyp/include/hyp/adjust_pc.h b/arch/arm64/kvm/hyp/include/hyp/skip_instr.h similarity index 90% rename from arch/arm64/kvm/hyp/include/hyp/adjust_pc.h rename to arch/arm64/kvm/hyp/include/hyp/skip_instr.h index 4fdfeabefeb4..d3ece9a90751 100644 --- a/arch/arm64/kvm/hyp/include/hyp/adjust_pc.h +++ b/arch/arm64/kvm/hyp/include/hyp/skip_instr.h @@ -7,12 +7,14 @@ * Author: Marc Zyngier */ -#ifndef __ARM64_KVM_HYP_ADJUST_PC_H__ -#define __ARM64_KVM_HYP_ADJUST_PC_H__ +#ifndef __ARM64_KVM_HYP_SKIP_INSTR_H__ +#define __ARM64_KVM_HYP_SKIP_INSTR_H__ #include #include +void kvm_skip_instr32(struct kvm_vcpu *vcpu); + static inline void kvm_skip_instr(struct kvm_vcpu *vcpu) { if (vcpu_mode_is_32bit(vcpu)) { diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h index e4a2f295a394..13578c1e91a6 100644 --- a/arch/arm64/kvm/hyp/include/hyp/switch.h +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h @@ -7,7 +7,7 @@ #ifndef __ARM64_KVM_HYP_SWITCH_H__ #define __ARM64_KVM_HYP_SWITCH_H__ -#include +#include #include #include diff --git a/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c b/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c index 87a54375bd6e..a11790cc42b4 100644 --- a/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c +++ b/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c @@ -4,7 +4,7 @@ * Author: Marc Zyngier */ -#include +#include #include #include diff --git a/arch/arm64/kvm/hyp/vgic-v3-sr.c b/arch/arm64/kvm/hyp/vgic-v3-sr.c index 39f8f7f9227c..756cde8125ef 100644 --- a/arch/arm64/kvm/hyp/vgic-v3-sr.c +++ b/arch/arm64/kvm/hyp/vgic-v3-sr.c @@ -4,7 +4,7 @@ * Author: Marc Zyngier */ -#include +#include #include #include