From: Volodymyr Babchuk Date: Tue, 10 Oct 2017 15:52:43 +0000 (+0300) Subject: arm: traps: check if SMC was conditional before handling it X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1123 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=307cf4c4fd6d17d6cd27e04fb821d412e6471938;p=xen.git arm: traps: check if SMC was conditional before handling it Trapped SMC instruction can fail condition check on ARMv8 architecture (ARM DDI 0487B.a page D7-2271). So we need to check if condition was meet. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index ace5a43322..5b91e6c340 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2199,6 +2199,12 @@ static void do_trap_smc(struct cpu_user_regs *regs, const union hsr hsr) { int rc = 0; + if ( !check_conditional_instr(regs, hsr) ) + { + advance_pc(regs, hsr); + return; + } + if ( current->domain->arch.monitor.privileged_call_enabled ) rc = monitor_smc();