* ***SPAM*** KVM on ARM: How to add some functions into interrupt.S with C code?
@ 2015-07-10 9:06 harry
2015-07-10 13:38 ` Marc Zyngier
0 siblings, 1 reply; 2+ messages in thread
From: harry @ 2015-07-10 9:06 UTC (permalink / raw)
To: kvmarm
[-- Attachment #1.1: Type: text/plain, Size: 329 bytes --]
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.
Thank you for help.
[-- Attachment #1.2: Type: text/html, Size: 994 bytes --]
[-- Attachment #2: Type: text/plain, Size: 151 bytes --]
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ***SPAM*** KVM on ARM: How to add some functions into interrupt.S with C code?
2015-07-10 9:06 ***SPAM*** KVM on ARM: How to add some functions into interrupt.S with C code? harry
@ 2015-07-10 13:38 ` Marc Zyngier
0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2015-07-10 13:38 UTC (permalink / raw)
To: harry, kvmarm
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...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-10 13:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-10 9:06 ***SPAM*** KVM on ARM: How to add some functions into interrupt.S with C code? harry
2015-07-10 13:38 ` Marc Zyngier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.