Page MenuHomeFreeBSD

Add support for hypervisor check on x86
ClosedPublic

Authored by sjg on Oct 17 2019, 8:48 PM.

Details

Summary

Add support for hypervisor check on x86

Add ficl words for isvirtualized
and move ficl inb and outb words to ficl/x86/sysdep.c
so can be shared by i386 and amd64

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sjg created this revision.Oct 17 2019, 8:48 PM
sjg edited the summary of this revision. (Show Details)Oct 17 2019, 8:49 PM
sjg added reviewers: imp, kevans, stevek.
sjg retitled this revision from Allow loader.efi to identify non-standard boot setup to Add support for hypervisor check on x86.
sjg added a reviewer: bcran.Oct 17 2019, 9:39 PM
imp accepted this revision.Oct 17 2019, 10:44 PM

Looks reasonably sane. Saw one magic number. Would like lua implementation, but won't block this based on that.

stand/libsa/x86/hypervisor.c
50 ↗(On Diff #63415)

Magic number?

This revision is now accepted and ready to land.Oct 17 2019, 10:44 PM
sjg added inline comments.Oct 18 2019, 12:28 AM
stand/libsa/x86/hypervisor.c
50 ↗(On Diff #63415)

Yes, the same bare number shows up in sys/x86/x86/identcpu.c identify_hypervisor_cpuid_base() which refers to a vmware kb article
if I read that correctly 0x40000000 is the hypervisor identifier

sjg updated this revision to Diff 63466.Oct 18 2019, 10:35 PM
sjg edited the summary of this revision. (Show Details)

put x86,machine symlinks in include/

This revision now requires review to proceed.Oct 18 2019, 10:35 PM
bdrewery accepted this revision.Oct 18 2019, 10:41 PM
bdrewery added a subscriber: bdrewery.

I only reviewed defs.mk. Looks fine.

stand/defs.mk
229 ↗(On Diff #63466)

I know this is pre-existing (and in kmod.mk) but what is this? I don't see the point.

This revision is now accepted and ready to land.Oct 18 2019, 10:41 PM
sjg added inline comments.Oct 18 2019, 11:06 PM
stand/defs.mk
229 ↗(On Diff #63466)

It's making path an absolute path. realpath $$path would do as well

bdrewery added inline comments.Oct 19 2019, 12:28 AM
stand/defs.mk
229 ↗(On Diff #63466)

Oh I was thinking zsh here which considers path == PATH. I see now.

This revision was automatically updated to reflect the committed changes.