tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

libnvmm: mem assist



Here is a patch [1] that implements the empty nvmm_mem_assist(). I also
wrote a tester [2], that can be converted to ATF later.

The matter is that in a real machine, the devices can be memory-mapped - like
the LAPIC page, located at address 0xFEE00000. Typically it means that each
time the kernel writes something at this address, commands are "sent" to the
LAPIC controller.

To reflect this behavior in the virtualization world, the virtualizer must
unmap such pages, intercept any fault occurring there, emulate the
modification, and restart the guest at the next instruction.

This patch implements that in libnvmm: a decoder (FSM) and a small
instruction emulator. The libnvmm(3) man page already contains the doc for
nvmm_mem_assist().

We support only a limited (and ~sufficient) number of instructions: MOV, OR,
AND and XOR.

Sending this here in case a disassembly expert wants to review. I expect to
do more polishing anyway.

[1] https://m00nbsd.net/garbage/nvmm/memassist.diff
[2] https://m00nbsd.net/garbage/nvmm/testasm.zip


Home | Main Index | Thread Index | Old Index