[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] xen/arm: Software Step ARMv8 - PC stuck on instruction
Hey Julien,
Would you mind sharing the latest version of your code? Of course not. This is the current version: asmlinkage void leave_hypervisor_tail(void)This code does still the same. Check if domain flag is set, if so check if SS bit has to be set. If Domain flag is not set, clear SS related bits. Did you look where the PCs point to? Is it your kernel module? Yes. I compared it with my Linux Image (using objdump) and found that these instructions are within a spinlock (the function is called _raw_spin_lock to be exact). My module is always loaded around the address 0xffff0000008e0000. Also I could see that its not the case that the addresses are printed twice but the VM just keeps within the spinlock (which created problems with printing). By tracing every single step I could determine the function sequence that is called. It starts out with an <el1_irq> and stops with an <hrtimer_interrupt> that keeps getting locked in <_raw_spin_lock>. In order to solve this, I compared my solution with the KVM one, where I saw (at least for my understanding) that they disable Interrupts for the VM. In the KVM file: /kvm/virt/arm/arm.c the function "kvm_arch_vcpu_ioctl_run" handles the running of the VM. The "kvm_arm_setup_debug" function does the same steps as I do in order to enable software step exceptions. So I can't see any difference there. I also modified xen-access so that the singlestepp will be startet with an SMC from the Guest. Additionally i wrote a second test kernel module which only executes an SMC and than will be stopped. I can trace the two SMCs and than the course to the spinlock (I put the trace below). While in the spinlock the VM won't response to anything. But after disabling singlestep it starts to work again. Enabled singlestep directly (not with an SMC) results in the VM to be locked in the spinlock immediately. There is also a problem with using printk within my module for the same reason. It will always end in the spinlock. One reason I could imaging is that because I'm singlestepping everything, including timer interrupts, there will be problems with the scheduling of the VM. This results in, not meeting the conditions to exit the spinlock. I hope i made the situation as clear as possible. Thank you for your help Florian This is the function trace obtained by singlestepping every instruction until the system reached the spinlock below. The two SMCs from my Module are needed for my xen-access implementation to ensure that the SS starts withing my module root@avocet:~# ./xen-access -m 1 singlestep _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |