Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31c032e989 |
No files matched your search
@@ -31,7 +31,7 @@ $(DRIVER)-y := $(subst $(SRCROOT)/, , $(patsubst %.c, %.o, \
|
||||
$(SRCROOT)/bootstrap/*.c)))
|
||||
|
||||
clean:
|
||||
rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions .cache.mk \
|
||||
rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions \
|
||||
Module.symvers Modules.symvers Module.markers modules.order \
|
||||
$(foreach dir,linux/ common/ vmcore/ bootstrap/ \
|
||||
./,$(addprefix $(dir),.*.cmd .*.o.flags *.o)))
|
||||
@@ -47,11 +47,9 @@
|
||||
|
||||
#ifdef __linux__
|
||||
# include "driver-config.h"
|
||||
/*
|
||||
* linux/frame.h dates back to 4.6-rc1, we need the STACK_FRAME_NON_STANDARD
|
||||
* definition from it which is there from the start.
|
||||
*/
|
||||
# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
|
||||
# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
|
||||
# include <linux/objtool.h>
|
||||
# elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
|
||||
# include <linux/frame.h>
|
||||
# endif
|
||||
#endif
|
||||
@@ -141,7 +139,7 @@ CPDATA const VMCrossPageData cpDataTemplate = {
|
||||
|
||||
.monTask.IOMapBase = sizeof(Task64),
|
||||
|
||||
.monGDTR.limit = VMMON_GDT_LIMIT,
|
||||
.monGDTR.limit = GDT_LIMIT,
|
||||
.monGDTR.offset = GDT_START_VA,
|
||||
|
||||
.shadowDR[6].ureg64 = DR6_DEFAULT,
|
||||
|
||||
@@ -110,7 +110,7 @@ EXTERN int HostIF_SemaphoreWait(VMDriver *vm,
|
||||
Vcpuid vcpuid,
|
||||
uint64 *args);
|
||||
|
||||
EXTERN int HostIF_SemaphoreSignal(uint64 *args);
|
||||
EXTERN int HostIF_SemaphoreSignal(VMDriver *vm, uint64 *args);
|
||||
|
||||
EXTERN void HostIF_SemaphoreForceWakeup(VMDriver *vm, const VCPUSet *vcs);
|
||||
EXTERN void HostIF_IPI(VMDriver *vm, const VCPUSet *vcs);
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#ifndef __COMPAT_POLL_H__
|
||||
#define __COMPAT_POLL_H__
|
||||
|
||||
#include <linux/poll.h>
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0))
|
||||
|
||||
#ifndef __poll_t
|
||||
typedef unsigned int __poll_t;
|
||||
#endif
|
||||
|
||||
static inline __poll_t compat_vfs_poll(struct file *file,
|
||||
struct poll_table_struct *pt)
|
||||
{
|
||||
if (unlikely(!file->f_op->poll))
|
||||
return DEFAULT_POLLMASK;
|
||||
return file->f_op->poll(file, pt);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static inline __poll_t compat_vfs_poll(struct file *file,
|
||||
struct poll_table_struct *pt)
|
||||
{
|
||||
return vfs_poll(file, pt);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __COMPAT_POLL_H__ */
|
||||
@@ -148,7 +148,7 @@ PtrToVA64(void const *ptr) // IN
|
||||
* the NT specific VMX86_DRIVER_VERSION.
|
||||
*/
|
||||
|
||||
#define VMMON_VERSION (398 << 16 | 0)
|
||||
#define VMMON_VERSION (401 << 16 | 0)
|
||||
#define VMMON_VERSION_MAJOR(v) ((uint32) (v) >> 16)
|
||||
#define VMMON_VERSION_MINOR(v) ((uint16) (v))
|
||||
|
||||
@@ -533,6 +533,8 @@ typedef struct IPIVectors {
|
||||
*/
|
||||
typedef struct VMCreateBlock {
|
||||
VA64 bsBlob; // IN: User VA of the VMM bootstrap blob.
|
||||
VA64 vmmonData; // IN: User VA of a userlevel scratch area
|
||||
// required by the Linux vmmon
|
||||
uint32 bsBlobSize; // IN: Size of VMM bootstrap blob.
|
||||
uint32 numVCPUs; // IN: Number of VCPUs.
|
||||
uint16 vmid; // OUT: VM ID for the created VM.
|
||||
|
||||
@@ -421,9 +421,7 @@ VMCrossPageData;
|
||||
|
||||
#define MX_WAITINTERRUPTED 3
|
||||
#define MX_WAITTIMEDOUT 2
|
||||
#define MX_WAITNORMAL 1 // Must equal one; see linux module code.
|
||||
#define MX_WAITERROR 0 // Use MX_ISWAITERROR() to test for error.
|
||||
#define MX_WAITNORMAL 1
|
||||
#define MX_WAITERROR 0
|
||||
|
||||
// Any zero or negative value denotes error.
|
||||
#define MX_ISWAITERROR(e) ((e) <= MX_WAITERROR)
|
||||
#endif
|
||||
@@ -51,14 +51,14 @@
|
||||
* it can use a single cross GDT).
|
||||
*/
|
||||
|
||||
#define VMMON_GDT_SIZE (sizeof(Descriptor) * NUM_VALID_SEGMENTS)
|
||||
#define VMMON_GDT_LIMIT (VMMON_GDT_SIZE - 1)
|
||||
#define GDT_SIZE (sizeof(Descriptor) * NUM_VALID_SEGMENTS)
|
||||
#define GDT_LIMIT (GDT_SIZE - 1)
|
||||
|
||||
#define IRB_SIZE 32 /* Interrupt redirection bitmap. */
|
||||
#define TSS_SIZE (sizeof(Task64) + IRB_SIZE)
|
||||
|
||||
#define GDT_START_VA (VPN_2_VA(GDT_AND_TASK_START))
|
||||
#define TASK_START_VA (VPN_2_VA(GDT_AND_TASK_START) + VMMON_GDT_SIZE)
|
||||
#define TASK_START_VA (VPN_2_VA(GDT_AND_TASK_START) + GDT_SIZE)
|
||||
|
||||
/*
|
||||
* vmkBoot uses some of the lower-numbered segments, as do host kernels on
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*********************************************************
|
||||
* Copyright (C) 2002-2019 VMware, Inc. All rights reserved.
|
||||
* Copyright (C) 2002-2020 VMware, Inc. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -44,10 +44,11 @@
|
||||
# include "str.h" /* Str_Snprintf */
|
||||
# define VCS_SNPRINTF Str_Snprintf
|
||||
#elif defined MONITOR_APP
|
||||
# include <stdio.h> /* libc snprintf */
|
||||
# if defined WIN32
|
||||
# define VCS_SNPRINTF _snprintf
|
||||
# include "str.h" /* Str_Snprintf */
|
||||
# define VCS_SNPRINTF Str_Snprintf
|
||||
# else
|
||||
# include <stdio.h> /* libc snprintf */
|
||||
# define VCS_SNPRINTF snprintf
|
||||
# endif
|
||||
#elif defined VMM || defined VMKERNEL
|
||||
|
||||
@@ -67,7 +67,6 @@ extern "C" {
|
||||
#if defined (VMKPANIC)
|
||||
#include "vmk_assert.h"
|
||||
#else /* !VMKPANIC */
|
||||
#include <linux/kernel.h>
|
||||
#define _ASSERT_PANIC(name) \
|
||||
Panic(_##name##Fmt "\n", __FILE__, __LINE__)
|
||||
#define _ASSERT_PANIC_BUG(bug, name) \
|
||||
@@ -108,7 +107,7 @@ NORETURN void Panic_NoSave(const char *fmt, ...) PRINTF_DECL(1, 2);
|
||||
} while(0)
|
||||
|
||||
#else
|
||||
#define Panic panic
|
||||
NORETURN void Panic(const char *fmt, ...) PRINTF_DECL(1, 2);
|
||||
#endif
|
||||
|
||||
void LogThrottled(uint32 *count, const char *fmt, ...) PRINTF_DECL(2, 3);
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
#define INCLUDE_ALLOW_VMCORE
|
||||
#include "includeCheck.h"
|
||||
|
||||
#include <asm/processor-flags.h>
|
||||
|
||||
#define X86_MAX_INSTR_LEN 15 /* Max byte length of an x86 instruction. */
|
||||
|
||||
#define NUM_IDT_VECTORS 256
|
||||
@@ -77,9 +75,7 @@
|
||||
#define CR3_PDB_MASK 0xfffff000
|
||||
#define CR3_IGNORE 0xFFF
|
||||
#define PAE_CR3_IGNORE 0x1F
|
||||
#ifndef CR3_PCID_MASK
|
||||
#define CR3_PCID_MASK 0xFFF
|
||||
#endif
|
||||
#define CR3_NO_FLUSH (1ULL << 63)
|
||||
|
||||
#define CR4_VME 0x00000001
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#ifndef _X86MSR_H_
|
||||
#define _X86MSR_H_
|
||||
#include <asm/msr-index.h>
|
||||
#define INCLUDE_ALLOW_USERLEVEL
|
||||
#define INCLUDE_ALLOW_VMX
|
||||
|
||||
@@ -152,9 +151,7 @@ MSRQuery;
|
||||
#define MSR_TSX_CTRL_RTM_DISABLE (1ULL << 0)
|
||||
#define MSR_TSX_CTRL_CPUID_CLEAR (1ULL << 1)
|
||||
|
||||
#ifndef MSR_MISC_FEATURES_ENABLES
|
||||
#define MSR_MISC_FEATURES_ENABLES 0x140
|
||||
#endif
|
||||
|
||||
/* Intel Core Architecture and later: use only architected counters. */
|
||||
#define IA32_MSR_PERF_CAPABILITIES 0x345
|
||||
@@ -489,9 +486,7 @@ MSRQuery;
|
||||
#define MSR_K7_HWCR_SSEDIS 0x00008000ULL // Disable SSE bit
|
||||
#define MSR_K7_HWCR_MONMWAITUSEREN 0x00000400ULL // Enable MONITOR/MWAIT CPL>0
|
||||
#define MSR_K7_HWCR_TLBFFDIS 0x00000040ULL // Disable TLB Flush Filter
|
||||
#ifndef MSR_K7_HWCR_SMMLOCK
|
||||
#define MSR_K7_HWCR_SMMLOCK 0x00000001ULL // Lock SMM environment
|
||||
#endif
|
||||
|
||||
#ifndef MSR_K8_SYSCFG
|
||||
#define MSR_K8_SYSCFG 0xc0010010
|
||||
@@ -717,11 +712,7 @@ typedef unsigned char MTRRType;
|
||||
/*
|
||||
* MISC_FEATURES_ENABLES bits
|
||||
*/
|
||||
#ifdef MSR_MISC_FEATURES_ENABLES_CPUID_FAULT
|
||||
#define MSR_MISC_FEATURES_ENABLES_CPUID_FAULTING MSR_MISC_FEATURES_ENABLES_CPUID_FAULT
|
||||
#else
|
||||
#define MSR_MISC_FEATURES_ENABLES_CPUID_FAULTING 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -676,7 +676,7 @@ LinuxDriverReadTSC(void *data, // OUT: TSC values
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
__always_inline static Bool
|
||||
__attribute__((always_inline)) static Bool
|
||||
LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
|
||||
{
|
||||
TSCDelta tscDelta;
|
||||
@@ -799,6 +799,7 @@ LinuxDriver_Ioctl(struct file *filp, // IN:
|
||||
} else {
|
||||
device->vm = vm;
|
||||
args.vmid = vm->userID;
|
||||
vm->vmhost->vmmonData = (void *__user)args.vmmonData;
|
||||
retval = HostIF_CopyToUser((VA64)ioarg, &args, sizeof args);
|
||||
}
|
||||
break;
|
||||
@@ -1256,7 +1257,7 @@ LinuxDriver_Ioctl(struct file *filp, // IN:
|
||||
}
|
||||
|
||||
case IOCTL_VMX86_WRITE_PAGE: {
|
||||
#ifdef VMX86_DEVEL
|
||||
#if VMX86_DEVEL
|
||||
VMMReadWritePage req;
|
||||
|
||||
retval = HostIF_CopyFromUser(&req, ioarg, sizeof req);
|
||||
|
||||
+63
-46
@@ -76,7 +76,6 @@
|
||||
|
||||
#include "pgtbl.h"
|
||||
#include "versioned_atomic.h"
|
||||
#include "compat_poll.h"
|
||||
|
||||
#if !defined(CONFIG_HIGH_RES_TIMERS)
|
||||
#error CONFIG_HIGH_RES_TIMERS required for acceptable performance
|
||||
@@ -2348,16 +2347,23 @@ HostIF_VMLockIsHeld(VMDriver *vm) // IN
|
||||
static Bool
|
||||
isVAReadable(VA r) // IN:
|
||||
{
|
||||
mm_segment_t old_fs;
|
||||
uint32 dummy;
|
||||
int ret;
|
||||
|
||||
r = APICR_TO_ADDR(r, APICR_VERSION);
|
||||
#ifdef HAVE_GET_KERNEL_NOFAULT
|
||||
ret = get_kernel_nofault(dummy, (void *)r);
|
||||
#else
|
||||
{
|
||||
mm_segment_t old_fs;
|
||||
|
||||
old_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
r = APICR_TO_ADDR(r, APICR_VERSION);
|
||||
|
||||
ret = HostIF_CopyFromUser(&dummy, r, sizeof dummy);
|
||||
set_fs(old_fs);
|
||||
|
||||
}
|
||||
#endif
|
||||
return ret == 0;
|
||||
}
|
||||
#endif
|
||||
@@ -2523,8 +2529,10 @@ HostIF_GetPerfCtrVector(void)
|
||||
* Perform the semaphore wait (P) operation, possibly blocking.
|
||||
*
|
||||
* Result:
|
||||
* 1 (which equals MX_WAITNORMAL) if success,
|
||||
* negated error code otherwise.
|
||||
* On success: MX_WAITINTERRUPTED (3) if interrupted by a Unix signal.
|
||||
* MX_WAITTIMEDOUT (2) if the timeout occurred.
|
||||
* MX_WAITNORMAL (1) if the event was raised.
|
||||
* On error: MX_WAITERROR (0) on generic error.
|
||||
*
|
||||
* Side-effects:
|
||||
* None
|
||||
@@ -2551,10 +2559,15 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
|
||||
if (file == NULL) {
|
||||
return MX_WAITERROR;
|
||||
}
|
||||
if (file->f_op->poll == NULL) {
|
||||
fput(file);
|
||||
Warning("%s: File poll operation is NULL\n", __func__);
|
||||
return MX_WAITERROR;
|
||||
}
|
||||
|
||||
poll_initwait(&table);
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
mask = compat_vfs_poll(file, &table.pt);
|
||||
mask = file->f_op->poll(file, &table.pt);
|
||||
if (!(mask & (POLLIN | POLLERR | POLLHUP))) {
|
||||
vm->vmhost->vcpuSemaTask[vcpuid] = current;
|
||||
schedule_timeout(timeoutms * HZ / 1000); // convert to Hz
|
||||
@@ -2575,18 +2588,17 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
|
||||
#else
|
||||
res = kernel_read(file, &value, sizeof value, &file->f_pos);
|
||||
#endif
|
||||
if (res == sizeof value) {
|
||||
res = MX_WAITNORMAL;
|
||||
} else {
|
||||
if (res == 0) {
|
||||
res = -EBADF;
|
||||
}
|
||||
}
|
||||
|
||||
fput(file);
|
||||
|
||||
if (res == sizeof value) {
|
||||
return MX_WAITNORMAL;
|
||||
}
|
||||
if (res == 0) {
|
||||
res = -EBADF;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle benign errors:
|
||||
* Handle various errors:
|
||||
* EAGAIN is MX_WAITTIMEDOUT.
|
||||
* The signal-related errors are all mapped into MX_WAITINTERRUPTED.
|
||||
*/
|
||||
@@ -2605,6 +2617,10 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
|
||||
case -EBADF:
|
||||
res = MX_WAITERROR;
|
||||
break;
|
||||
default:
|
||||
Warning("Unexpected error: %s err=%d\n", __FUNCTION__, res);
|
||||
res = MX_WAITERROR;
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -2658,7 +2674,6 @@ HostIF_SemaphoreForceWakeup(VMDriver *vm, // IN:
|
||||
* On error: MX_WAITINTERRUPTED (3) if interrupted by a Unix signal (we
|
||||
* can block on a preemptive kernel).
|
||||
* MX_WAITERROR (0) on generic error.
|
||||
* Negated system error (< 0).
|
||||
*
|
||||
* Side-effects:
|
||||
* None
|
||||
@@ -2667,57 +2682,64 @@ HostIF_SemaphoreForceWakeup(VMDriver *vm, // IN:
|
||||
*/
|
||||
|
||||
int
|
||||
HostIF_SemaphoreSignal(uint64 *args) // IN:
|
||||
HostIF_SemaphoreSignal(VMDriver *vm, // IN:
|
||||
uint64 *args) // IN:
|
||||
{
|
||||
struct file *file;
|
||||
int res;
|
||||
int signalFD = args[1];
|
||||
uint64 value = 1; // make an eventfd happy should it be there
|
||||
struct file *file;
|
||||
|
||||
file = vmware_fget(signalFD);
|
||||
if (!file) {
|
||||
return MX_WAITERROR;
|
||||
if (file == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Always write sizeof(uint64) bytes. This works fine for eventfd and
|
||||
* pipes. The data written is formatted to make an eventfd happy should
|
||||
* it be present.
|
||||
*
|
||||
* Upstream Linux changed the function parameter types/ordering in 4.14.0.
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
|
||||
res = kernel_write(file, (char *)&value, sizeof value, file->f_pos);
|
||||
#else
|
||||
res = kernel_write(file, &value, sizeof value, &file->f_pos);
|
||||
#endif
|
||||
|
||||
if (res == sizeof value) {
|
||||
res = MX_WAITNORMAL;
|
||||
if (file->f_op->write != NULL) {
|
||||
/*
|
||||
* PR2650348 - The kernel_write function signature changed in the vanilla
|
||||
* kernel in 4.14.0 and the signature update was backported before that
|
||||
* point in a kernel used by OpenSUSE 15.1 so call the function directly
|
||||
* instead of via the wrapper.
|
||||
*
|
||||
* Kernel 5.10 removed the set_fs functionality which means a user pointer
|
||||
* must be passed into the write function or a -EFAULT will be returned.
|
||||
*/
|
||||
res = file->f_op->write(file, vm->vmhost->vmmonData, sizeof (uint64),
|
||||
&file->f_pos);
|
||||
} else {
|
||||
Warning("%s: File write operation is NULL\n", __func__);
|
||||
res = -ENOTSUPP;
|
||||
}
|
||||
|
||||
fput(file);
|
||||
|
||||
if (res == sizeof (uint64)) {
|
||||
return MX_WAITNORMAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle benign errors:
|
||||
* Handle various errors:
|
||||
* EAGAIN is MX_WAITTIMEDOUT.
|
||||
* The signal-related errors are all mapped into MX_WAITINTERRUPTED.
|
||||
*/
|
||||
|
||||
switch (res) {
|
||||
case -EAGAIN:
|
||||
// The pipe is full, so it is already signalled. Success.
|
||||
res = MX_WAITNORMAL;
|
||||
break;
|
||||
/* The pipe is full, so it is already signalled. Success. */
|
||||
return MX_WAITNORMAL;
|
||||
case -EINTR:
|
||||
case -ERESTART:
|
||||
case -ERESTARTSYS:
|
||||
case -ERESTARTNOINTR:
|
||||
case -ERESTARTNOHAND:
|
||||
res = MX_WAITINTERRUPTED;
|
||||
break;
|
||||
return MX_WAITINTERRUPTED;
|
||||
default:
|
||||
Warning("Unexpected error: %s err=%d\n", __FUNCTION__, res);
|
||||
return MX_WAITERROR;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -3242,12 +3264,9 @@ static int
|
||||
HostIFFastClockThread(void *unused) // IN:
|
||||
{
|
||||
int res;
|
||||
mm_segment_t oldFS;
|
||||
unsigned int rate = 0;
|
||||
unsigned int prevRate = 0;
|
||||
|
||||
oldFS = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
allow_signal(SIGKILL);
|
||||
|
||||
while ((rate = linuxState.fastClockRate) > MIN_RATE) {
|
||||
@@ -3270,8 +3289,6 @@ HostIFFastClockThread(void *unused) // IN:
|
||||
}
|
||||
|
||||
out:
|
||||
set_fs(oldFS);
|
||||
|
||||
/*
|
||||
* Do not exit thread until we are told to do so.
|
||||
*/
|
||||
|
||||
@@ -92,6 +92,11 @@ typedef struct VMHost {
|
||||
* as pages for "AWE" guest memory.
|
||||
*/
|
||||
struct PhysTracker *AWEPages;
|
||||
/*
|
||||
* Pointer to a userlevel 64-bit area containing the value 1.
|
||||
* This is used for HostIF_SemaphoreSignal.
|
||||
*/
|
||||
void *__user vmmonData;
|
||||
} VMHost;
|
||||
|
||||
#endif
|
||||
@@ -180,7 +180,7 @@ skipTaskSwitch:;
|
||||
}
|
||||
|
||||
case MODULECALL_SEMASIGNAL: {
|
||||
retval = HostIF_SemaphoreSignal(crosspage->args);
|
||||
retval = HostIF_SemaphoreSignal(vm, crosspage->args);
|
||||
|
||||
if (retval == MX_WAITINTERRUPTED) {
|
||||
crosspage->moduleCallInterrupted = TRUE;
|
||||
@@ -362,7 +362,13 @@ skipTaskSwitch:;
|
||||
default:
|
||||
Warning("ModuleCall %d not supported\n", crosspage->moduleCallType);
|
||||
}
|
||||
ASSERT(retval == (uint64)((uint32)retval));
|
||||
|
||||
if (retval != (uint64)((uint32)retval)) {
|
||||
Warning("Unexpected error in modulecall %u (%llu)\n",
|
||||
crosspage->moduleCallType, retval);
|
||||
bailValue = USERCALL_SWITCHERR;
|
||||
goto bailOut;
|
||||
}
|
||||
crosspage->retval = (uint32)retval;
|
||||
#if defined(__linux__)
|
||||
cond_resched(); // Other kernels are preemptible
|
||||
|
||||
@@ -32,6 +32,6 @@ $(DRIVER)-y := driver.o hub.o userif.o netif.o bridge.o procfs.o smac_compat.o \
|
||||
####
|
||||
|
||||
clean:
|
||||
rm -rf $(DRIVER).o $(DRIVER).mod.o $(DRIVER).mod.c $(DRIVER).ko .cache.mk \
|
||||
rm -rf $(DRIVER).o $(DRIVER).mod.o $(DRIVER).mod.c $(DRIVER).ko \
|
||||
.tmp_versions Module.symvers Modules.symvers Module.markers \
|
||||
modules.order $($(DRIVER)-y) .*.cmd .*.o.flags
|
||||
+7
-6
@@ -66,7 +66,7 @@
|
||||
#endif
|
||||
|
||||
#if LOGLEVEL >= 4
|
||||
static u64 vnetTime;
|
||||
static struct timeval vnetTime;
|
||||
#endif
|
||||
|
||||
typedef struct VNetBridge VNetBridge;
|
||||
@@ -693,7 +693,7 @@ VNetBridgeReceiveFromVNet(VNetJack *this, // IN: jack
|
||||
|
||||
netif_rx_ni(clone);
|
||||
# if LOGLEVEL >= 4
|
||||
vnetTime = ktime_get_ns();
|
||||
do_gettimeofday(&vnetTime);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
@@ -1490,11 +1490,12 @@ VNetBridgeReceiveFromDev(struct sk_buff *skb, // IN: packet to receive
|
||||
|
||||
# if LOGLEVEL >= 4
|
||||
{
|
||||
u64 now;
|
||||
|
||||
now = ktime_get_ns();
|
||||
struct timeval now;
|
||||
do_gettimeofday(&now);
|
||||
LOG(3, (KERN_DEBUG "bridge-%s: time %d\n",
|
||||
bridge->name, (int)((now - vnetTime) / NSEC_PER_USEC)));
|
||||
bridge->name,
|
||||
(int)((now.tv_sec * 1000000 + now.tv_usec)
|
||||
- (vnetTime.tv_sec * 1000000 + vnetTime.tv_usec))));
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*********************************************************
|
||||
* Copyright (C) 2002,2018 VMware, Inc. All rights reserved.
|
||||
* Copyright (C) 2002,2018,2020 VMware, Inc. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -4327,7 +4327,7 @@ LookupTypeClass(unsigned short typeValue) // IN: ethernet type
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if _WIN32
|
||||
#ifdef _WIN32
|
||||
_Use_decl_annotations_
|
||||
#endif
|
||||
void
|
||||
|
||||
@@ -561,7 +561,12 @@ VNetCsumCopyDatagram(const struct sk_buff *skb, // IN: skb to copy
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if COMPAT_LINUX_VERSION_CHECK_LT(5, 10, 0)
|
||||
csum = csum_and_copy_to_user(skb->data + offset, curr, len, 0, &err);
|
||||
#else
|
||||
csum = csum_and_copy_to_user(skb->data + offset, curr, len);
|
||||
err = (csum == 0) ? -EFAULT : 0;
|
||||
#endif
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
@@ -575,8 +580,14 @@ VNetCsumCopyDatagram(const struct sk_buff *skb, // IN: skb to copy
|
||||
const void *vaddr;
|
||||
|
||||
vaddr = kmap(skb_frag_page(frag));
|
||||
#if COMPAT_LINUX_VERSION_CHECK_LT(5, 10, 0)
|
||||
tmpCsum = csum_and_copy_to_user(vaddr + skb_frag_off(frag),
|
||||
curr, skb_frag_size(frag), 0, &err);
|
||||
#else
|
||||
tmpCsum = csum_and_copy_to_user(vaddr + skb_frag_off(frag),
|
||||
curr, skb_frag_size(frag));
|
||||
err = (tmpCsum == 0) ? -EFAULT : 0;
|
||||
#endif
|
||||
kunmap(skb_frag_page(frag));
|
||||
|
||||
if (err) {
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <linux/pci_ids.h>
|
||||
|
||||
/* LSILogic 53C1030 Parallel SCSI controller
|
||||
* LSILogic SAS1068 SAS controller
|
||||
*/
|
||||
@@ -55,10 +53,7 @@
|
||||
* VMware HD Audio codec
|
||||
* VMware HD Audio controller
|
||||
*/
|
||||
#ifndef PCI_VENDOR_ID_VMWARE
|
||||
#define PCI_VENDOR_ID_VMWARE 0x15AD
|
||||
#endif
|
||||
|
||||
#define PCI_DEVICE_ID_VMWARE_SVGA3 0x0406
|
||||
#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405
|
||||
#define PCI_DEVICE_ID_VMWARE_SVGA 0x0710
|
||||
@@ -76,11 +71,7 @@
|
||||
#define PCI_DEVICE_ID_VMWARE_1394 0x0780
|
||||
#define PCI_DEVICE_ID_VMWARE_BRIDGE 0x0790
|
||||
#define PCI_DEVICE_ID_VMWARE_ROOTPORT 0x07A0
|
||||
|
||||
#ifndef PCI_DEVICE_ID_VMWARE_VMXNET3
|
||||
#define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0
|
||||
#endif
|
||||
|
||||
#define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0
|
||||
#define PCI_DEVICE_ID_VMWARE_82574 0x07D0
|
||||
#define PCI_DEVICE_ID_VMWARE_AHCI 0x07E0
|
||||
|
||||
Reference in new issue
Block a user