On 2018-01-29 11:25, Ralf Ramsauer wrote:
> Hi Claudio,
> 
> On 01/29/2018 10:15 AM, Claudio Scordino wrote:
>> Hi all,
>>
>> I'm porting Jailhouse on the imx8 EVK board.
>>
>> After implementing the uart driver (thanks, Ralf) I've been able of
>> successfully running the "jailhouse enable" command.
>>
>> However, the "jailhouse cell create" deadlocks the machine with the
>> following error message:
>>
>>     FATAL: unhandled trap (exception class 0x17)
> This means Jailhouse is missing a trap handler (see
> hypervisor/arch/arm64/traps.c:185).
> 
> The exception class 0x17 stands for:
> hypervisor/arch/arm64/include/asm/sysregs.h:#define ESR_EC_SMC64
>        0x17
> 
> So we're missing a PSCI handler, because this is the only path in
> handle_smc() that can return TRAP_UNHANDLED:
>         if (!IS_PSCI_32(regs[0]) && !IS_PSCI_64(regs[0]))
>                 return TRAP_UNHANDLED;
> 
> And those definitions are:
> hypervisor/arch/arm-common/include/asm/psci.h:#define IS_PSCI_32(hvc)
>                (((hvc) >> 24) == 0x84)
> hypervisor/arch/arm-common/include/asm/psci.h:#define IS_PSCI_64(hvc)
>                (((hvc) >> 24) == 0xc4)
> 
> So looks like we have some unimplemented PSCI/SMC call.
>>     Cell state before exception:
>>      pc: ffff00000808eb60   lr: ffff00000852cbf8 spsr: 200001c5     EL1
> What's behind PC? Could you also share your config with us?
>>      sp: ffff8000b20afbe0  esr: 17 1 0000000
>>      x0: 00000000c2000000   x1: 0000000000000004   x2: 0000000000000040
> PSCI calls store their function id in x0.
> 
> And here we have 0xc2000000. In case of SMC64, we shr by 24 bits, which
> means 0xc2000000 >> 24 = 0xc2 Jailhouse expects 0xc4 in case of PSCI. Hmm.
> 
> So this doesn't look like a typical PSCI call to me (just looked at the
> PSCI platform design document, 0xc2000000 is not valid). Looks like this
> is some other platform specific SMC. Is there another monitor running?
> 
> So who emits this call?

"#define CONFIG_CRASH_CELL_ON_PANIC 1" will tell us because Linux will
generate a backtrace on this provoked crash.

> 
> Just a guess: your root cell is probably trying to offline the CPU,
> emits the PSCI and crashes.

- power management
- some driver that is implemented in firmware instead of Linux (we have
  this with the RTC and nice UEFI firmware on the Seattle)

Jan
-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to