Closed fdawg4l closed 7 years ago
Ping @dougm and @caglar10ur.
I'm not sure I see the benefit here. IsVirtualWorld()
is supposed to protect non-vmware environment from those backdoor-induced panic()
s.
I'd love to get rid of the cgo dependency, but given that programs would still have to use sigma/bdoor
to be correct, that would still not achieve that goal.
@sigma After quite a bit of googling, I figured out how to knock on the backdoor to test if it's there without causing a segfault.
Also, we now check the HV bit in the CPU ID as well as the extended CPU ID level for the Hypervisor string. After passing those checks, we knock the backdoor.
cc: @caglar10ur and @dougm
@sigma I think this is as good as we're going to get it. I think iopl
is the right way to go and gets us the best behavior without being too obscure. Please let me know if you want to see any more changes. Thanks!
Done.
This change has LOTs of commits. Let's make good use of that Squash and Merge feature of GH. :-)
We still need to solve the PANIC issue. If run in a non-virtual world, the runtime will panic.
This is the last place which requires CGO in this package. I thought the benefit is worth the tradeoff.