@Cap, you would need to use the following kernel functions to accomplish buffer allocation before using the
HVC instruction via something like
struct page *k_page;
k_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
At this point you can get the virtual address of this page via:
You can then typecast this VA to whatever data structure you want to operate on within the kernel.
Then when you are ready to issue the hypercall (via the
HVC instruction) pass the physical address of the buffer via:
If you are using
uhcallkmod_hvc as your function to issue the
HVC instruction, then the buffer parameter to that function should be the physical address as you obtained above using
Don’t forget to use
__free_page(k_page) once you are done with using the page buffer.
Let me know if you run into any issues.
Coming to think of it we should make a
libkhcall (the kernel mode dual of
libuhcall) that has similar functionality. But we can get to that once you have this working.
Hope this helps!