Hi Harry, On 10/07/15 10:06, harry wrote: > I want to add some functions into interrupt.S with C code to do some > operations in hyp mode with a hypcall. > > I have tried to add .global [function name] and use bl [function name], > but there will be a prefetch abort. > > So I want to know if the C code can be linked into interrupt.S and how > to achieve this. It is most likely to fail if your C code is not part of the section that gets mapped in HYP mode. So jumping there gets you an abort because this area is not covered by any HYP page table. At the moment, only the code that is between __kvm_hyp_code_start and __kvm_hyp_code_end is mapped at HYP, and that's fairly restrictive. You could adopt something similar to what we've done for arm64, where __kvm_hyp_code_{start,end} are just #defines that resolve as symbols created in vmlinux.lds.S. You could then make both interrupt.S and your C code to be part of the same .hyp.text section, using something an attribute like __attribute__((__section__(".hyp.text"))). This should ensure that all the HYP code can get mapped by create_hyp_mapping in one go. Hope this helps, M. -- Jazz is not dead. It just smells funny... _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm