Commit Graph
39 Commits
Author SHA1 Message Date
Michal Kubecek 7d4e4be1e0 vmmon: fix indirect call with retpoline build
Build against kernel with retpoline support issues warning

  objtool: Task_Switch()+0x425: indirect call found in RETPOLINE build

This is because an indirect call in TaskSwitchToMonitor() is encoded using
inline assembler so that it bypasses retpoline generation. For this
purpose, macro CALL_NOSPEC exists since v4.15-rc8 (and has been backported
into some distribution kernels with the rest of retpoline support). Use the
macro if available and fallback to the original code if not.
p15.5.1-k4.16 p15.5.1-k4.17
2019-11-14 08:14:32 +01:00
Michal Kubecek 11a8f46f56 vmmon: fix always_inline attribute usage
Function declared with __attribute__((always_inline)) should also be
declared as inline, otherwise gcc issues a warning "always_inline function
might not be inlinable". It's just cosmetic but getting rid of known
harmless warnings makes it easier to spot actual problems. Use the
__always_inline macro for LinuxDriverSyncReadTSCs() as this is how always
inline functions should be declared in kernel code.
2019-11-14 08:14:32 +01:00
Michal Kubecek 908eb62bc0 vmmon: use standard definition of MSR_K7_HWCR_SMMLOCK if available
The MSR_K7_HWCR_SMMLOCK macro is defined in mainline since commit
18c71ce9c882 ("x86/CPU/AMD: Add the Secure Encrypted Virtualization CPU
feature") in v4.16-rc1.
2019-11-14 08:14:32 +01:00
Theo Bertacchini c733170d6e modules: remove .cache.mk on make clean
Remove .cache.mk inside vmmon-only and vmnet-only when executing
"make clean". This file can cause issues when upgrading gcc as make will
still look for includes inside older gcc includes directory.

File .cache.mk with cache of generated variables was created by build since
kernel v4.15-rc1, commit 3298b690b21c ("kbuild: Add a cache for generated
variables") until the feature was removed in v4.18-rc1, commit e08d6de4e532
("kbuild: remove kbuild cache").
p15.5.1-k4.15
2019-11-14 08:14:32 +01:00
Michal Kubecek ef4688dd22 vmmon: quick workaround for objtool warnings
As discussed in

  https://bugzilla.suse.com/show_bug.cgi?id=1059674

the reason for multiple objtool warnings is the fact that vmmon module
defines its own Panic() function which never returns. While it is marked as
such which is used by the compiler for optimization, there is no way to
find this from object file.

While this seems innocuous, it might result in problems with unwinder
later. The quickest way around is to replace vmmon's own Panic() with
standard kernel panic() until a cleaner solution is found.
p15.5.1-k4.14
2019-11-14 08:14:32 +01:00
Michal Kubecek cdd3a827ba vmmon: use standard definition of CR3_PCID_MASK if available
The CR3_PCID_MASK is defined in mainline asm/processor-flags.h since
commit 6c690ee1039b ("x86/mm: Split read_cr3() into read_cr3_pa() and
__read_cr3()") in v4.13-rc1.
p15.5.1-k4.13
2019-11-14 08:14:32 +01:00
Michal Kubecek b83f9b1693 vmmon: use standard definition of MSR_MISC_FEATURES_ENABLES if available
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.
p15.5.1-k4.12
2019-11-14 08:14:32 +01:00
Michal Kubecek 58629b994e vmnet: use standard definition of PCI_VENDOR_ID_VMWARE_VMXNET3 if available
The PCI_DEVICE_ID_VMWARE_VMXNET3 macro is defined in mainline pci_ids.h
since commit b1226c7db1d9 ("vmxnet3: Move PCI Id to pci_ids.h") in
v4.10-rc1.
p15.5.1-k4.10 p15.5.1-k4.11
2019-11-14 08:14:32 +01:00
Michal Kubecek aa80bb7211 vmnet: use standard definition of PCI_VENDOR_ID_VMWARE if available
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.
p15.5.1-k4.9
2019-11-14 08:14:32 +01:00
Michal Kubecek 93cbadb262 modules: do not override CC command line options
Workstation/Player 15.5.0 tries to guess the right retpoline (Spectre)
related compiler command line options, resulting in objtool warnings like

  warning: objtool: .text.__x86_indirect_thunk_rbp+0x0: unsupported intra-function call
  warning: objtool: If this is a retpoline, please patch it in with alternatives and annotate

e.g. in vmmon-only/common/memtrack.o (but also many others).

This seems wrong; out-of-tree modules should be built with the same
compiler options that were used to build the kernel they are built against.
Distribution kernel devel packages usually make sure this is the way so let
them do their job.
2019-11-14 08:14:32 +01:00
Michal Kubecek e8cb62956a vmmon: fix wrong VMX86_DEVEL test
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.
2019-11-14 08:14:32 +01:00
Michal Kubecek 87feab5f03 import Player 15.5.1 module sources p15.5.1 2019-11-14 07:56:57 +01:00
Michal Kubecek 6daa6921e7 import Player 15.5.0 module sources p15.5.0 2019-09-21 00:11:26 +02:00
Michal Kubecek 193db5638c Merge branch 'master' into player 2019-09-21 00:10:31 +02:00
Michal Kubecek 85ede6aae9 misc: fix wrong directory name in INSTALL (fixes #36)
Fix wrong directory name in one of the examples.
2019-09-09 08:38:27 +02:00
Michal Kubecek 1f8ca44e74 import Player 15.1.0 module sources p15.1.0 2019-05-15 07:06:02 +02:00
Michal Kubecek 3686288fcb import Player 15.0.1 module sources p15.0.1 p15.0.2 p15.0.3 p15.0.4 2018-11-12 07:48:28 +01:00
Michal Kubecek 3d8f309653 import Player 15.0.0 module sources p15.0.0 2018-10-02 19:09:36 +02:00
Michal Kubecek 56b2ba7686 import Player 14.1.3 module sources p14.1.3 p14.1.4 p14.1.5 p14.1.6 p14.1.7 2018-08-20 07:28:17 +02:00
Michal Kubecek 7c61516e73 Merge branch 'master' into player 2018-05-27 16:13:48 +02:00
Michal Kubecek 16c49e52d4 misc: clean copies of vmmon.o and vmnet.o in top level makefile
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.
2018-05-27 16:08:30 +02:00
Michal Kubecek 7ee6cd4520 import Player 14.1.2 module sources p14.1.2 2018-05-23 18:14:05 +02:00
Michal Kubecek 5791987f56 Merge branch 'master' into player 2018-04-02 15:37:18 +02:00
Michal Kubecek 77a6966b97 misc: warn if branch is marked as retired
When "make" or "make install is issued on branch marked as retired, warn
user about the fact.
2018-04-02 15:31:34 +02:00
Michal Kubecek 0b2713797e Merge branch 'master' into player 2018-02-04 21:50:37 +01:00
Michal Kubecek 625084e96a misc: add INSTALL document
Add file INSTALL explaining how to use the repository (get patched sources,
build the modules and install them).
2018-02-04 21:48:58 +01:00
Michal Kubecek 1d91cc5b6a misc: add 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".
2018-02-04 21:48:58 +01:00
Michal Kubecek 6fd497d954 misc: update README
Fix a type and clarify the part about building against older kernels.
2018-02-02 18:09:09 +01:00
Michal Kubecek 3fc524fd27 misc: ignore .cache.mk
Add .cache.mk files to .gitignore.
2018-02-02 18:08:41 +01:00
Michal Kubecek 3e445144a1 import Player 14.1.1 module sources p14.1.1 2018-01-12 13:51:34 +01:00
Michal Kubecek 82f569a212 import Player 14.1.0 module sources p14.1.0 2017-12-25 09:47:38 +01:00
Michal Kubecek 455d4d9368 import Player 14.0.0 module sources p14.0.0 2017-09-30 20:31:15 +02:00
Michal Kubecek 027dd56418 import Player 12.5.7 module sources p12.5.7 2017-06-30 19:11:22 +02:00
Michal Kubecek 0e634ffbf1 import Player 12.5.6 module sources p12.5.6 2017-05-31 10:06:51 +02:00
Michal Kubecek c62c78e908 import Player 12.5.5 module sources p12.5.5 2017-05-31 09:20:00 +02:00
Michal Kubecek 4f648692e4 import Player 12.5.2 module sources p12.5.2 2017-05-31 09:19:26 +02:00
Michal Kubecek 42b8a690c5 misc: add README 2017-05-31 09:18:08 +02:00
Michal Kubecek fdbf9db517 misc: add .gitignore 2017-05-31 08:48:52 +02:00
Michal Kubeček f0d7d2e384 Initial commit 2017-05-31 08:45:16 +02:00