|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v6 1/3] xen/arm: add support for run_in_exception_handler()
On 16.01.21 18:19, Julien Grall wrote: Hi Juergen, On 16/01/2021 10:33, Juergen Gross wrote:Add support to run a function in an exception handler for Arm. Do it as on x86 via a bug_frame, but pass the function pointer via a register (this needs to be done that way, because inline asm support for 32-bit Arm lacks the needed functionality to reference an arbitrary function via the bugframe). Use the same BUGFRAME_* #defines as on x86 in order to make a future common header file more easily achievable. Signed-off-by: Juergen Gross <jgross@xxxxxxxx> --- V4: - new patch V5: - adjust BUG_FRAME() macro (Jan Beulich) - adjust arm linker script (Jan Beulich) - drop #ifdef x86 in common/virtual_region.c V6: - use register for function address (Arm32 build failure noticed by Julien Grall)Thank you for trying to sort out the issue on Arm32 :).+/*+ * Unfortunately gcc for arm 32-bit doesn't support the "i" constraint, so + * the easiest way to implement run_in_exception_handler() is to pass the+ * to be called function in a fixed register.There are a few uses of "i" in Linux Arm32 (such as jump label), therefore I am pretty confident "i" works at least in some situation.I did some more digging this afternoon. Our use of "i" is very similar to Linux, so I decided to look at the GCC flags used.It turns out that Linux will always build with -fno-pie on Arm (either 32 or 64) whereas Xen will let the compiler to decide (PIE is enabled by on my compiler). No, it is just to have an interrupt frame to print out. Basically it is just a "normal" function call with no parameters and return value via an interrupt. So other than the BUG_ON() the registers are quite uninteresting, it is nothing meant to be used for diagnosis AFAICS. Juergen Attachment:
OpenPGP_0xB0DE9DD628BF132F.asc Attachment:
OpenPGP_signature
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |