The MSR_MISC_FEATURES_ENABLES macro is defined in mainline since commit
ab6d9468631a ("x86/msr: Rename MISC_FEATURE_ENABLES to
MISC_FEATURES_ENABLES") in v4.12-rc1.
The MSR_MISC_FEATURES_ENABLES_CPUID_FAULT macro is defined in mainline
since commit e9ea1e7f53b8 ("x86/arch_prctl: Add ARCH_[GET|SET]_CPUID") in
v4.12-rc1.
When building against kernel 4.12 and newer, macro name GDT_SIZE used in
(vmmon) include/segs.h collides with macro defined in (kernel source)
arch/x86/include/asm/segment.h, resulting in its redefinition.
To prevent potential problems, rename vmmon's GDT_SIZE to VMMON_GDT_SIZE
and GDT_LIMIT to VMMON_GDT_LIMIT. (There is no GDT_LIMIT in mainline kernel
source but let's be consistent.)
The PCI_VENDOR_ID_VMWARE macro is defined in mainline pci_ids.h since
commit 94e57fea6202 ("PCI: Move PCI_VENDOR_ID_VMWARE to pci_ids.h")
in v3.18-rc1.
Both the version check for include of <linux/frame.h> in common/crosspage.c
and the comment explaining it are wrong for multiple reasons:
1. <linux/frame.h> was introduced in v4.6-rc1, not v4.5-rc5
2. ANNOTATE_INTRA_FUNCTION_CALL was introduced in v5.8-rc1, not v5.7
3. Even if it were, the check should use ">=", not ">"
4. Most important, the code in fact needs STACK_FRAME_NON_STANDARD
Without the definition of STACK_FRAME_NON_STANDARD, build against vanilla
5.7 kernel fails on objtool error (but succeeds against 5.7.1, because of
the mistake from point 3).
Change the check from "> 5.7" to ">= 4.6" to get STACK_FRAME_NON_STANDARD
whenever available and update the explaining comment.
If VMX86_DEVEL macro is not defined, preprocessor warns when it is tested
with "#if" in vmmon-only/linux/driver.c. As VMX86_DEVEL is tested with
"#ifdef" everywhere else, change this one test to match the rest.
Makefiles in *-only copy the object file module is created from into the
parent directory but do not delete them on "make clean". Clean these files
up in "clean" target of top level makefile.
Add a top level makefile to make common tasks easier. Supported targets:
make - build modules
make install - install modules (honors DESTDIR)
make clean - clean up
make tarballs - create source tarballs from current HEAD
Note: "make tarballs" uses "git archive" so that it only works in a local
copy of the git repository, not in a directory created by unpacking
a tarball.
Add *.tar to .gitignore to hide tarballs created by "make tarballs".