[RFC PATCH 7/7] target-arm: Hacky implementation of kvm_arch_reset_vcpu() for KVM ARM64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We need to "Feed the kernel back its initial register state" using KVM
ioctls for KVM ARM64 (just like KVM ARM). This means we need to save
the "initial register state" in kvm_arch_init_vcpu() which is not the
case for KVM ARM64 right now. In simpler work, we are depended upon
VCPU register init/save/restore for implementing kvm_arch_reset_vcpu().

This patch adds a hacky implementation of kvm_arch_reset_vcpu() which
only works for "mach-virt". As-per this hacky implemenation, we re-init
the VCPU using kvm_arch_init_vcpu() so that all registers of VCPU are
set to their reset values by in-kernel KVM code.

Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@xxxxxxxxxx>
Signed-off-by: Anup Patel <anup.patel@xxxxxxxxxx>
---
 target-arm/kvm64.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c
index d303046..b64909d 100644
--- a/target-arm/kvm64.c
+++ b/target-arm/kvm64.c
@@ -205,4 +205,12 @@ int kvm_arch_get_registers(CPUState *cs)
 
 void kvm_arch_reset_vcpu(CPUState *cs)
 {
+    /* TODO: Feed the kernel back its initial register state */
+
+    /* For now just re-init VCPU so that all registers are
+     * set to their respective reset values. This will work
+     * for "mach-virt" only because for "mach-virt" we have
+     * start-pc set to zero.
+     */
+    kvm_arch_init_vcpu(cs);
 }
-- 
1.7.9.5

_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm




[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux