diff options
Diffstat (limited to 'vmmon.patch')
-rw-r--r-- | vmmon.patch | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/vmmon.patch b/vmmon.patch index 27939af40f99..e960a58a905c 100644 --- a/vmmon.patch +++ b/vmmon.patch @@ -204,3 +204,100 @@ index cf4197b..ef88a22 100644 printk(KERN_ERR "%s: Couldn't verify write to uva 0x%p with size %" FMTSZ"u\n", __func__, p, size); +From 41413a9b6e660a93600a438944d85b6f51eb680c Mon Sep 17 00:00:00 2001 +From: Michal Kubecek <mkubecek@suse.cz> +Date: Tue, 5 Mar 2019 13:21:35 +0100 +Subject: [PATCH] vmmon: use KERNEL_DS rather than get_ds() + +Commit 736706bee329 ("get rid of legacy 'get_ds()' function") in v5.1-rc1 +removed get_ds() helper. As this helper always returned KERNEL_DS on x86_64 +since the architecture was introduced (and even on i386, it did so since +v2.1.0), simply use KERNEL_DS regardless of kernel version. +--- + vmmon-only/linux/hostif.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c +index ef88a22..8ca17de 100644 +--- a/vmmon-only/linux/hostif.c ++++ b/vmmon-only/linux/hostif.c +@@ -2183,7 +2183,7 @@ isVAReadable(VA r) // IN: + int ret; + + old_fs = get_fs(); +- set_fs(get_ds()); ++ set_fs(KERNEL_DS); + r = APICR_TO_ADDR(r, APICR_VERSION); + ret = HostIF_CopyFromUser(&dummy, r, sizeof dummy); + set_fs(old_fs); +@@ -2384,7 +2384,7 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN: + } + + old_fs = get_fs(); +- set_fs(get_ds()); ++ set_fs(KERNEL_DS); + + { + struct poll_wqueues table; +@@ -2513,7 +2513,7 @@ HostIF_SemaphoreSignal(uint64 *args) // IN: + } + + old_fs = get_fs(); +- set_fs(get_ds()); ++ set_fs(KERNEL_DS); + + /* + * Always write sizeof(uint64) bytes. This works fine for eventfd and +From 2af9d566d0ccc78a93b46a79d23902e5ba2bc933 Mon Sep 17 00:00:00 2001 +From: Michal Kubecek <mkubecek@suse.cz> +Date: Sat, 9 Mar 2019 11:11:29 +0100 +Subject: [PATCH] vmmon: fix return type of vm_operations_struct::fault handler + +Commit 3d3539018d2c ("mm: create the new vm_fault_t type") in mainline +5.1-rc1 changed the definition of vm_fault_t type to unsigned to catch +vm_operations_struct::fault handlers which still have int as return value. +LinuxDriverFault() in vmmon module is one of those. + +As handler return type was changed by commit 1c8f422059ae ("mm: change +return type to vm_fault_t") in 4.17-rc1, make LinuxDriverFault() always +return vm_fault_t and define vm_fault_t as int when building against +a pre-4.17 kernel. +--- + vmmon-only/linux/driver.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c +index 92a3529..248a95d 100644 +--- a/vmmon-only/linux/driver.c ++++ b/vmmon-only/linux/driver.c +@@ -73,6 +73,9 @@ static Bool LinuxDriverCheckPadding(void); + + struct VMXLinuxState linuxState; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) ++typedef int vm_fault_t; ++#endif + + /* + *---------------------------------------------------------------------- +@@ -97,9 +100,9 @@ long LinuxDriver_Ioctl(struct file *filp, u_int iocmd, + + static int LinuxDriver_Close(struct inode *inode, struct file *filp); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +-static int LinuxDriverFault(struct vm_fault *fault); ++static vm_fault_t LinuxDriverFault(struct vm_fault *fault); + #else +-static int LinuxDriverFault(struct vm_area_struct *vma, struct vm_fault *fault); ++static vm_fault_t LinuxDriverFault(struct vm_area_struct *vma, struct vm_fault *fault); + #endif + static int LinuxDriverMmap(struct file *filp, struct vm_area_struct *vma); + +@@ -594,7 +597,7 @@ LinuxDriver_Close(struct inode *inode, // IN + *----------------------------------------------------------------------------- + */ + +-static int ++static vm_fault_t + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) + LinuxDriverFault(struct vm_fault *fault) //IN/OUT + #else |