Harvey-OS / harvey

A distributed operating system
https://harvey-os.org/
MIT License
1.44k stars 105 forks source link

WIP: change rdmsr to be safe #1172

Closed rminnich closed 2 years ago

rminnich commented 2 years ago

Add labels in rdmsr to indicate which path to take on a failure.

Add GPF handler.

In GPF handler, switch on ureg->pc value, and if an address is handled, fix uref->pc.

This is basically what is done in linux, minus all the fancy ELF and linker set machinations. It will work just fine.

Signed-off-by: Ronald G. Minnich rminnich@gmail.com

rminnich commented 2 years ago

This works, I like the switch as opposed to the if, the assembly is basically the same and the switch gives a pattern for future handlers; but I like dan's assembly code and will probably change to match his suggestion. But the next step is to change the name and type signature of rdmsr, so I'll make those tweaks in the next pass. Thanks everyone for the reviews!!