[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] xen/arm: stack check instrumentation



Hi,

On 29/07/2024 20:40, Stewart Hildebrand wrote:
On 7/29/24 14:50, Julien Grall wrote:
Hi again,

On 29/07/2024 15:24, Stewart Hildebrand wrote:
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index aac6c599f878..b4890eec7ec4 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -2325,6 +2325,51 @@ void asmlinkage leave_hypervisor_to_guest(void)
           arm_smccc_1_1_smc(ARM_SMCCC_ARCH_WORKAROUND_2_FID, 0, NULL);
   }
   +#ifdef CONFIG_DEBUG
+DEFINE_PER_CPU(unsigned int, stack_check_nesting);
+DEFINE_PER_CPU(unsigned char *, stack_base);

While looking at the code, I just realized that this should be equivalent to 
current->arch.base.

current->arch.stack

That's true only after the idle vcpu stacks have been allocated.

So do we actually need stack_base?

This is a way to enable stack instrumentation much earlier during boot
when we are still using the static boot stack.

Sure. But we are only partially checking the static boot stack. I am not entirely sure if there is any value for that because at that point the stack would be barely used.

Anyway, this is only for debug build so far, so I am ok to keep it.

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.