|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 05/12] Placeholder for handling Group1 register traps
Hi Manish, On 12/03/18 12:42, mjaggi@xxxxxxxxxxxxxxxxxx wrote: From: Manish Jaggi <manish.jaggi@xxxxxxxxxx> Since this is a SoC errata and trapping of certain group1 registers should not affect the normal flow. A new file vsysreg_errata.c is added. Function vgic_v3_handle_cpuif_access is called from do_trap_guest_sync if ARM64_WORKAROUND_CAVIUM_30115 capability is found. A flag skip_hyp_tail is introduced in struct cpu_info. This flag specifies that leave_hypervisor_tail not to be called when handling group1 traps under this errata. Please give some rationale in the commit message why leave_hypervisor_tail is skipped on the errata. Signed-off-by: Manish Jaggi <manish.jaggi@xxxxxxxxxx> --- xen/arch/arm/arm64/Makefile | 1 + xen/arch/arm/arm64/vsysreg_errata.c | 28 ++++++++++++++++++++++++++++ The name of the file does not make sense, the errata is not about sysreg. It is about vGIC. Please rename it to vgic-v3-sr.c. xen/arch/arm/traps.c | 20 ++++++++++++++++++++ xen/include/asm-arm/arm64/traps.h | 3 ++- xen/include/asm-arm/current.h | 1 + 5 files changed, 52 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile index 718fe44455..19440c3d8c 100644 --- a/xen/arch/arm/arm64/Makefile +++ b/xen/arch/arm/arm64/Makefile @@ -11,3 +11,4 @@ obj-y += smpboot.o obj-y += traps.o obj-y += vfp.o obj-y += vsysreg.o +obj-$(CONFIG_CAVIUM_ERRATUM_30115) += vsysreg_errata.o diff --git a/xen/arch/arm/arm64/vsysreg_errata.c b/xen/arch/arm/arm64/vsysreg_errata.c new file mode 100644 index 0000000000..6af162bdf7 --- /dev/null +++ b/xen/arch/arm/arm64/vsysreg_errata.c @@ -0,0 +1,28 @@ Missing copyright header. You should use false/true when using bool. No plain integer. + + local_irq_disable(); Please add a comment explain why IRQs are disabled. Missing emacs magic. I am not a big fan of #ifdef in the code. I think it would be better to stub the vgic_v3_handle_cpuif_access. + if ( cpus_have_cap(ARM64_WORKAROUND_CAVIUM_30115) ) cpus_have_cap is expensive to use in hot path. This is because the function is going to check is the bits is set on every exit. You want to use check_workaround_* for that purpose as this will be replaced by an alternative. vgic_v3_handle_cpuif_access is returning a bool. + get_cpu_info()->skip_hyp_tail = 0; Same remark as above about bool and integer. But I think this one is not necessary. skip_hyp_tail is going to be false by default. So if you reset to false in the return path when it is true, you avoid true.
I don't think the #ifdef is necessary here. Supporting to skip the hypervisor tail is a nice feature to have. + if ( get_cpu_info()->skip_hyp_tail ) You want this to be an unlikely(...).
Why removing the newline?
You should just reuse some bits of the padding (i.e 'pad' field) here. bool skip_hyp_tail:1; unsigned int pad:31; Also, some documentation of the code would be highly appreciated. };static inline struct cpu_info *get_cpu_info(void) Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |