|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH 2/3] plat/common: Implement a few extra registers stub helpers on arm64
Hi, On 9/26/19 9:20 AM, Jia He wrote: On arm64, we don't need the extra registers during context switching so far. This patch decouple the arch specific structures/functions info arch related files. AFAICT, the patch adding x86 header in sw_ctx.c were committed last January. It would be good to understand how this is suddently an issue. If this is because of one series not yet merged, then it should be squashed in it. If not, an explanation in the commit message to explain the exact problem (possibly compilation issue?) is the best. Signed-off-by: Jia He <justin.he@xxxxxxx> --- plat/common/include/arm/arm64/cpu.h | 25 +++++++++++++++++++++++++ plat/common/include/x86/cpu.h | 10 ++++++++++ plat/common/sw_ctx.c | 10 +++++----- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/plat/common/include/arm/arm64/cpu.h b/plat/common/include/arm/arm64/cpu.h index 1495192..298424e 100644 --- a/plat/common/include/arm/arm64/cpu.h +++ b/plat/common/include/arm/arm64/cpu.h @@ -32,7 +32,12 @@ * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. */+#ifndef __PLAT_COMMON_ARM64_CPU_H__+#define __PLAT_COMMON_ARM64_CPU_H__ TBH, this belongs to a separate patch with ... + #include <inttypes.h> +#include <uk/essentials.h> +#include <sw_ctx.h>/* Define macros to access IO registers */ This is a bit a waste for Arm and also quite dangerous because extregs is not going to be NULL but pointing just after the end of the allocated space. Couldn't we try to abstract it further? Maybe by providing a function that will allocate the structure and initialize arch specific things? Something like: ctx = arch_alloc_ctx(allocator); where arch_alloc_ctx for x86 would be implemented as sz = ALIGN_UP(sizeof(struct sw_ctx), ...) + ...; ctx = uk_malloc(..., sz); ctx->extregs = ... memset(ctx->extregs, 0, ...) save_ctx_regs(); return ctx; For arm, it would be: return uk_malloc(..., sizeof(struct sw_ctx)); Cheers, -- Julien Grall _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |