|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] arm64: rewrite io r/w helper to avoid kvm crash.
Hi, On 15/05/2020 06:53, Jianyong Wu wrote: For now, unikraft will crash on arm64 in kvm mode if it compiled using s/it compiled/it was compiled/ optimize mode. Because compiler will choose post-index str intrs to s/compiler/a compiler/ or the compiler. s/intrs/instructions/ write device memory. Unluckily, arm64 virtualization extension does only provides syndrome information for a limited subset of load/store s/does only provides/only provides/ instructions, that means we can't use load/store with writeback addressing mode to access mmio device. To avoid the compiler do those optimization, io read/write helpers should s/do/to do/ I think. be rewitten by inline assembly with volatile constraint. After this, s/by/using/ unikraft can work fine on arm64. Signed-off-by: Jianyong Wu <jianyong.wu@xxxxxxx> --- plat/common/include/arm/arm64/cpu.h | 84 ++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/plat/common/include/arm/arm64/cpu.h b/plat/common/include/arm/arm64/cpu.h index 93ad13b..994d2f2 100644 --- a/plat/common/include/arm/arm64/cpu.h +++ b/plat/common/include/arm/arm64/cpu.h @@ -41,31 +41,65 @@ #include <uk/alloc.h> #include <uk/assert.h>-/* Define macros to access IO registers */ s/constrain/constrainst/ + * registers to avoid compiler use load/store intrns of writeback + * addressing mode which will cause crash when running in kvm mode. This is not specific to KVM mode. This will happening on any hypervisor unless they decode the instruction (which is quite expensive). NIT: Would it be possible to macro-ize this? Regardless this question: Reviewed-by: Julien Grall <julien@xxxxxxx> Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |