vmm: refactor userspace's emsr_fakewrite() master origin/master current
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 22 Aug 2019 18:46:45 +0000 (14:46 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 22 Aug 2019 18:46:45 +0000 (14:46 -0400)
commit9a1c439dbbb95dd110892e139ce9dee639476884
tree20528b219c47b8b4b526a991f1100aae8412f07d
parent446203ffe66fef5a6674e86162609e5dec4795d5
vmm: refactor userspace's emsr_fakewrite()

The old fakewrite would attempt to do a readmsr, which will fail.
However, we only need to do a readmsr if we read before writing.  Most
uses of this will do a write first.

Note that rdmsr and wrmsr will fail from userspace.  The MSR emulation
code is mostly just an unused copy of the kernel's, but it's useful to
prototype changes in userspace without requiring a kernel reboot.  i.e.
this is for debugging.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/vmm/vmxmsr.c