Hello! I am new to the CHERI project, and am trying to perform an experiment on how the capabilities are handled in the ISA. I have CheriBSD running in qemu, and have successfully cross-compiled some C code to run on it and demonstrated to myself that CHERI blocked an out of bounds memory access. I would like to know where in the source code the ISA is being extended for this functionality. I've looked through the OS code, and it is of course mostly all FreeBSD. If someone could point me in the right direction, I would be very appreciative. Also, if this is not the place to ask about this, please let me know a more appropriate forum. Thank you!
Discussion is in https://github.com/CTSRD-CHERI/cheribsd/issues/1535, but to summarise, the OS does not perform the checks, the hardware does, so there is no code in CheriBSD to perform the capability checks. As you note it's a property of the ISA, which is not a part of an OS but the instruction set implemented by a piece of hardware.
In the case of running on QEMU, the hardware is emulated like any other QEMU architecture, but that is not part of CheriBSD, it's part of QEMU.
Thanks so much Jessica for the reply. Just a quick follow-up: is it feasible to modify the ISA that QEMU is running with, or would that be a monumental task? I don't have a lot of low-level programming experience, so I don't want to get in too deep too quick. Thanks again.