shut down realm VM when it is large enough
Hi all, I am working with cca-full/v3 branch of linux-cca along with cca/v3 of qemu to create realm VM. I also use shrinkwrap which downloads and uses the latest version of TF-RMM and TF-A. What I faced is the below error after running poweroff command inside the realm that is 1750MB in size:
Stopping dropbear sshd: OK
Stopping network: OK
Seeding 256 bits and crediting
Saving 256 bits of creditable seed for next boot
Stopping klogd: OK
Stopping syslogd: OK
umount: devtmpfs busy - remounted read-only
umount: can't unmount /: Invalid argument
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system poweroff
[ 136.359191] reboot: Power [ 390.934735] rcu: INFO: rcu_preempt self-detected stall on CPU
[ 390.934817] rcu: 1-....: (20999 ticks this GP) idle=1b3c/1/0x4000000000000000 softirq=426/426 fqs=5249
[ 390.934993] rcu: (t=21000 jiffies g=549 q=10 ncpus=8)
[ 390.935093] CPU: 1 PID: 189 Comm: qemu-system-aar Not tainted 6.10.0-rc1-g d901c27a #1
[ 390.935226] Hardware name: FVP Base RevC (DT)
[ 390.935302] pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=-)
[ 390.935436] pc : realm_unmap_range_private+0x29c/0x2a0
[ 390.935556] lr : realm_unmap_range_private+0x298/0x2a0
[ 390.935676] sp : ffff800080d8ba30
[ 390.935746] x29: ffff800080d8ba30 x28: 0000000000000000 x27: 000000009910f000
[ 390.935929] x26: 000f800000000000 x25: 0000010000000000 x24: 0010000000000000
[ 390.936116] x23: ffffffffffffffff x22: 00000000c4000155 x21: 0000000880bcc000
[ 390.936301] x20: ffff800080135df0 x19: 000000009910e000 x18: 0000000000000001
[ 390.936485] x17: 0000000000000000 x16: 0000000000800006 x15: 0000000000000000
[ 390.936665] x14: 0000000000000002 x13: 0000000000000002 x12: 0000000000054c3f
[ 390.936843] x11: 0000000000000000 x10: ffff000801ace80c x9 : 0000000000000800
[ 390.937026] x8 : 0000000000000820 x7 : 0000000000000000 x6 : 0000000000000000
[ 390.937203] x5 : 000f000800bcc000 x4 : 00000000995de000 x3 : 0000000000000000
[ 390.937385] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000
[ 390.937562] Call trace:
[ 390.937619] realm_unmap_range_private+0x29c/0x2a0
[ 390.937741] kvm_realm_unmap_range+0x134/0x138
[ 390.937861] __unmap_stage2_range+0x60/0x7c
[ 390.937990] kvm_free_stage2_pgd+0xa0/0xd4
[ 390.938127] kvm_arch_flush_shadow_all+0x1c/0x34
[ 390.938269] kvm_mmu_notifier_release+0x30/0x84
[ 390.938409] __mmu_notifier_release+0x78/0x1e0
[ 390.938551] exit_mmap+0x270/0x288
[ 390.938665] __mmput+0x38/0x154
[ 390.938795] mmput+0x50/0x5c
[ 390.938921] do_exit+0x26c/0x904
[ 390.939035] do_group_exit+0x34/0x90
[ 390.939147] pid_child_should_wake+0x0/0x5c
[ 390.939274] invoke_syscall+0x48/0x118
[ 390.939410] el0_svc_common.constprop.0+0x40/0xe0
[ 390.939557] do_el0_svc+0x1c/0x28
[ 390.939689] el0_svc+0xac/0xdc
[ 390.939820] el0t_64_sync_handler+0x100/0x12c
[ 390.939966] el0t_64_sync+0x190/0x194
Worth to mention I did not see similar error for a normal world VM of size 1750MB, moreover I did not see this error with realm VM that is 450MB. Therefore, it should be somehow related to memory management of realm VMs when their size is greater than a threshold.
Cheers,
Sina