schedule: add magic number at the bottom of schedule stack

Add this magic number to prevent potential overflow when dumping
host stack.

Tracked-On: #2455
Signed-off-by: Tw <wei.tan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Tw 2019-01-30 14:56:29 +08:00 committed by wenlingz
parent efc64d778f
commit 39ffd29aa3

View File

@ -8,6 +8,7 @@
#include <schedule.h>
#include <security.h>
#include <virtual_cr.h>
#include <init.h>
inline uint64_t vcpu_get_gpreg(const struct acrn_vcpu *vcpu, uint32_t reg)
{
@ -637,6 +638,7 @@ static uint64_t build_stack_frame(struct acrn_vcpu *vcpu)
rsp &= ~(CPU_STACK_ALIGN - 1UL);
sp = (uint64_t *)rsp;
*sp-- = SP_BOTTOM_MAGIC;
*sp-- = (uint64_t)run_sched_thread; /*return address*/
*sp-- = 0UL; /* flag */
*sp-- = 0UL; /* rbx */