CTSRD-CHERI / qemu

QEMU with support for CHERI
Other
52 stars 28 forks source link

'savevm' monitor command crashes QEMU. #205

Open jacobbramley opened 1 year ago

jacobbramley commented 1 year ago
(qemu) savevm test
qemu-system-morello: ../../qemu/migration/../target/cheri-common/cheri-compressed-cap/cheri_compressed_cap_common.h:474: cc128_addr_t cc128_compress_raw(const cc128_cap_t *): Assertion `(!csp->cr_tag || cc128_get_reserved(csp) == 0) && "Unknown reserved bits set it tagged capability"' failed.
jrtc27 commented 1 year ago

If that's the output you get you must have an old build of Morello QEMU, it's using cc128m not cc128 these days (historically cc128 was re-defined for Morello but that meant software couldn't use both at the same time, so now they're encoding formats with distinct names). I instead see:

Assertion failed: (field->size == sizeof(cc128m_cap_t)), function put_cap128m_register, file vmstate-types.c, line 405.
jrtc27 commented 1 year ago

Oh, hm, except that never made it from dev to qemu-cheri... should fix that

jrtc27 commented 1 year ago

Pushed some fixes to dev. It still doesn't work in general as we have no handling for memory tags and co-processor registers that aren't special cased will lose metadata, but it doesn't crash QEMU any more.

jacobbramley commented 1 year ago

Could it print a warning message or similar? It's nice that it doesn't kill the VM now but I'm worried that it now gives the illusion of working.

lion10 commented 1 year ago

Same problem, when I save a snapshot, it raises a segmentation fault.

Screenshot from 2022-10-14 15-19-49