On Thu, 22 Oct 2020, Alex Bennée wrote:
Stefano Stabellini stefano.stabellini@xilinx.com writes: (XEN) Check compatible for node /a(XEN) Loading d0 initrd from 00000000aefac000 to 0x0000000028200000-0x0000000029eedb66 (XEN) Loading d0 DTB to 0x0000000028000000-0x0000000028005ed9 (XEN) Initial low memory virq threshold set at 0x4000 pages. (XEN) Scrubbing Free RAM in background (XEN) Std. Loglevel: All (XEN) Guest Loglevel: All (XEN) *************************************************** (XEN) PLEASE SPECIFY dom0_mem PARAMETER - USING 512M FOR NOW (XEN) ***************************************************
This is a problem, especially if you are booting Debian 512MB are not going to be enough. It might also be the reason for the hang below.
Try to add something like: dom0_mem=2G to the Xen command line.
(XEN) 3... 2... 1... (XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input) (XEN) Check compatible for node /chosen/module@b0c9b000 (XEN) cplen 17 (XEN) multiboot,module (XEN) Check compatible for node /chosen/module@aefac000 (XEN) cplen 17 (XEN) multiboot,module (XEN) Freed 340kB init memory. (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER4 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER8 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER12 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER16 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER20 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER24 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER28 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER32 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER36 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER40 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER0 (XEN) d0v1: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER0 (XEN) d0v2: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER0 (XEN) d0v3: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER0 (XEN) d0v0: vGICD: unhandled word write 0x00000000000001 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000000002 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000000004 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000000008 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000000010 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000000020 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000000040 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000000080 to ICPENDR8 (XEN) physdev.c:16:d0v0 PHYSDEVOP cmd=25: not implemented (XEN) physdev.c:16:d0v0 PHYSDEVOP cmd=15: not implemented (XEN) physdev.c:16:d0v0 PHYSDEVOP cmd=15: not implemented (XEN) d0v0: vGICD: unhandled word write 0x00000000000100 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000000200 to ICPENDR8 (XEN) d0v3: vGICD: unhandled word write 0x00000000000400 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000000800 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000001000 to ICPENDR8 (XEN) d0v2: vGICD: unhandled word write 0x00000000002000 to ICPENDR8 (XEN) d0v2: vGICD: unhandled word write 0x00000000004000 to ICPENDR8 (XEN) d0v2: vGICD: unhandled word write 0x00000000008000 to ICPENDR8 (XEN) d0v2: vGICD: unhandled word write 0x00000000010000 to ICPENDR8 (XEN) d0v2: vGICD: unhandled word write 0x00000000020000 to ICPENDR8 (XEN) d0v2 Unhandled SMC/HVC: 0x82000001 (XEN) d0v3: vGICD: unhandled word write 0x00000000040000 to ICPENDR8 (XEN) d0v3: vGICD: unhandled word write 0x00000000080000 to ICPENDR8 (XEN) d0v2 Unhandled SMC/HVC: 0x82000002 (XEN) d0v3: vGICD: unhandled word write 0x00000000100000 to ICPENDR8 (XEN) d0v2: vGICD: unhandled word write 0x00000000200000 to ICPENDR8 (XEN) d0v0: vGICD: unhandled word write 0x00000000400000 to ICPENDR8 (XEN) d0v1: vGICD: unhandled word write 0x00000000800000 to ICPENDR8 (XEN) d0v1: vGICD: unhandled word write 0x00000001000000 to ICPENDR8 (XEN) d0v1: vGICD: unhandled word write 0x00000002000000 to ICPENDR8 (XEN) d0v1: vGICD: unhandled word write 0x00000004000000 to ICPENDR8 (XEN) d0v1: vGICD: unhandled word write 0x00000008000000 to ICPENDR8 (XEN) d0v1 Unhandled SMC/HVC: 0x82000001 (XEN) d0v3 Unhandled SMC/HVC: 0x82000002 (XEN) d0v3: vGICD: unhandled word write 0x00000010000000 to ICPENDR8 (XEN) d0v3: vGICD: unhandled word write 0x00000020000000 to ICPENDR8 (XEN) d0v3: vGICD: unhandled word write 0x00000040000000 to ICPENDR8 (XEN) d0v3: vGICD: unhandled word write 0x00000080000000 to ICPENDR8 (XEN) d0v3: vGICD: unhandled word write 0x00000000000001 to ICPENDR12 (XEN) d0v3 Unhandled SMC/HVC: 0x82000001 (XEN) d0v1 Unhandled SMC/HVC: 0x82000002 (XEN) d0v1: vGICD: unhandled word write 0x00000000000002 to ICPENDR12 (XEN) d0v1: vGICD: unhandled word write 0x00000000000004 to ICPENDR12 (XEN) d0v1: vGICD: unhandled word write 0x00000000000008 to ICPENDR12 (XEN) d0v1: vGICD: unhandled word write 0x00000000000010 to ICPENDR12 (XEN) d0v1: vGICD: unhandled word write 0x00000000000020 to ICPENDR12 (XEN) d0v1 Unhandled SMC/HVC: 0x82000001 (XEN) d0v1 Unhandled SMC/HVC: 0x82000002
I suspect the ICPENDR problem is not an issue anymore. We are seeing another hang, maybe due to the lack of dom0_mem or something else.
The "Unhandled SMC/HVC" messages are interesting: Xen blocks SMC calls by default. The dom0 kernel here is trying to make two SiP calls, Xen blocks them and returns "unimplemented". I don't know if it causes any issues to the kernel but I can imagine that the kernel driver might refuse to continue. It is typically a firmware driver (drivers/firmware).
If the two calls are actually required to boot, then Xen should have a 'mediator' driver to filter the calls allowed from the ones that are not allowed. See for instance xen/arch/arm/platforms/xilinx-zynqmp-eemi.c. As a test, the appended patch allows all SMC calls for dom0:
diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c index a36db15fff..821c15852a 100644 --- a/xen/arch/arm/vsmc.c +++ b/xen/arch/arm/vsmc.c @@ -286,10 +286,32 @@ static bool vsmccc_handle_call(struct cpu_user_regs *regs)
if ( !handled ) { - gprintk(XENLOG_INFO, "Unhandled SMC/HVC: %#x\n", funcid); + if ( is_hardware_domain(current->domain) ) + { + struct arm_smccc_res res; + + arm_smccc_1_1_smc(get_user_reg(regs, 0), + get_user_reg(regs, 1), + get_user_reg(regs, 2), + get_user_reg(regs, 3), + get_user_reg(regs, 4), + get_user_reg(regs, 5), + get_user_reg(regs, 6), + get_user_reg(regs, 7), + &res); + + set_user_reg(regs, 0, res.a0); + set_user_reg(regs, 1, res.a1); + set_user_reg(regs, 2, res.a2); + set_user_reg(regs, 3, res.a3); + } + else + { + gprintk(XENLOG_INFO, "Unhandled SMC/HVC: %#x\n", funcid);
- /* Inform caller that function is not supported. */ - set_user_reg(regs, 0, ARM_SMCCC_ERR_UNKNOWN_FUNCTION); + /* Inform caller that function is not supported. */ + set_user_reg(regs, 0, ARM_SMCCC_ERR_UNKNOWN_FUNCTION); + } }
return true;