From: Shannon Zhao <shannon.zhao@linux•alibaba.com>
To: kvmarm@lists•cs.columbia.edu, maz@kernel•org,
james.morse@arm•com, suzuki.poulose@arm•com,
christoffer.dall@arm•com
Cc: linux-kernel@vger•kernel.org, linux-arm-kernel@lists•infradead.org
Subject: [PATCH RFC 4/7] KVM: vgic: Add hyp uninitialize function
Date: Thu, 24 Oct 2019 18:27:47 +0800 [thread overview]
Message-ID: <1571912870-18471-5-git-send-email-shannon.zhao@linux.alibaba.com> (raw)
In-Reply-To: <1571912870-18471-1-git-send-email-shannon.zhao@linux.alibaba.com>
When KVM ARM exits, it needs to cleanup vgic setup by kvm_vgic_hyp_init.
Signed-off-by: Shannon Zhao <shannon.zhao@linux•alibaba.com>
---
include/kvm/arm_vgic.h | 1 +
virt/kvm/arm/arm.c | 1 +
virt/kvm/arm/vgic/vgic-init.c | 7 +++++++
3 files changed, 9 insertions(+)
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index af4f09c..7f44ebb 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -339,6 +339,7 @@ struct vgic_cpu {
void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu);
int kvm_vgic_map_resources(struct kvm *kvm);
int kvm_vgic_hyp_init(void);
+void kvm_vgic_hyp_uninit(void);
void kvm_vgic_init_cpu_hardware(void);
int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int intid,
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
index da32c9b..0c60074 100644
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -1724,6 +1724,7 @@ int kvm_arch_init(void *opaque)
void kvm_arch_exit(void)
{
kvm_perf_teardown();
+ kvm_vgic_hyp_uninit();
hyp_cpu_pm_exit();
}
diff --git a/virt/kvm/arm/vgic/vgic-init.c b/virt/kvm/arm/vgic/vgic-init.c
index 6f50c42..cd48047 100644
--- a/virt/kvm/arm/vgic/vgic-init.c
+++ b/virt/kvm/arm/vgic/vgic-init.c
@@ -550,3 +550,10 @@ int kvm_vgic_hyp_init(void)
kvm_get_running_vcpus());
return ret;
}
+
+void kvm_vgic_hyp_uninit(void)
+{
+ cpuhp_remove_state(CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING);
+ free_percpu_irq(kvm_vgic_global_state.maint_irq,
+ kvm_get_running_vcpus());
+}
--
1.8.3.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-10-24 10:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 10:27 [PATCH RFC 0/7] Support KVM being compiled as a kernel module on arm64 Shannon Zhao
2019-10-24 10:27 ` [PATCH RFC 1/7] KVM: ARM: call hyp_cpu_pm_exit on correct fail and exit path Shannon Zhao
2019-10-24 10:27 ` [PATCH RFC 2/7] KVM: arch_timer: Fix resource leak on error path Shannon Zhao
2019-10-24 10:27 ` [PATCH RFC 3/7] KVM: vgic: make vgic parameters work well for module Shannon Zhao
2019-10-24 10:27 ` Shannon Zhao [this message]
2019-10-24 10:27 ` [PATCH RFC 5/7] KVM: arch_timer: Add hyp uninitialize function Shannon Zhao
2019-10-24 10:27 ` [PATCH RFC 6/7] KVM: arm/arm64: Move target table register into register table init function Shannon Zhao
2019-10-24 10:27 ` [PATCH RFC 7/7] KVM: ARM: Support KVM being compiled as a kernel module Shannon Zhao
2019-10-24 10:58 ` [PATCH RFC 0/7] Support KVM being compiled as a kernel module on arm64 James Morse
2019-10-24 13:41 ` Marc Zyngier
2019-10-25 2:48 ` Shannon Zhao
2019-10-25 10:12 ` Christoffer Dall
2019-10-25 10:43 ` Marc Zyngier
2019-10-25 2:24 ` Shannon Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1571912870-18471-5-git-send-email-shannon.zhao@linux.alibaba.com \
--to=shannon.zhao@linux$(echo .)alibaba.com \
--cc=christoffer.dall@arm$(echo .)com \
--cc=james.morse@arm$(echo .)com \
--cc=kvmarm@lists$(echo .)cs.columbia.edu \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=maz@kernel$(echo .)org \
--cc=suzuki.poulose@arm$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox