From 24d7c448e49e3dc2abbf3bc804247fb30410775a Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Tue, 6 Sep 2022 13:04:50 +0200 Subject: Fix kvm-amd module --- Makefile | 2 +- kmod/kvm.c | 16 +++++++--------- patch.diff | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 57ceecd..33be001 100755 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ PWD := $(shell pwd) .PHONY: all reset clean prepare build -all: reset clean prepare build test/eviction test/access test/kvm test/sev +all: reset clean prepare build test/eviction test/access test/kvm test/sev test/sev-es clean: $(MAKE) -C $(KERNEL_SOURCE) SUBDIRS=arch/x86/kvm clean diff --git a/kmod/kvm.c b/kmod/kvm.c index e2cae07..b79ba7f 100644 --- a/kmod/kvm.c +++ b/kmod/kvm.c @@ -270,7 +270,7 @@ cachepc_kvm_ioctl(struct file *file, unsigned int cmd, unsigned long argp) { void __user *arg_user; uint32_t u32; - int r; + int ret; arg_user = (void __user *)argp; switch (cmd) { @@ -279,9 +279,9 @@ cachepc_kvm_ioctl(struct file *file, unsigned int cmd, unsigned long argp) if (!arg_user) return -EINVAL; if (copy_from_user(&u32, arg_user, sizeof(uint32_t))) return -EFAULT; - r = smp_call_function_single(2, + ret = smp_call_function_single(2, cachepc_kvm_single_access_test, &u32, true); - WARN_ON(r != 0); + WARN_ON(ret != 0); if (copy_to_user(arg_user, &u32, sizeof(uint32_t))) return -EFAULT; break; @@ -290,9 +290,9 @@ cachepc_kvm_ioctl(struct file *file, unsigned int cmd, unsigned long argp) if (!arg_user) return -EINVAL; if (copy_from_user(&u32, arg_user, sizeof(uint32_t))) return -EFAULT; - r = smp_call_function_single(2, + ret = smp_call_function_single(2, cachepc_kvm_single_eviction_test, &u32, true); - WARN_ON(r != 0); + WARN_ON(ret != 0); if (copy_to_user(arg_user, &u32, sizeof(uint32_t))) return -EFAULT; break; @@ -301,9 +301,9 @@ cachepc_kvm_ioctl(struct file *file, unsigned int cmd, unsigned long argp) if (!arg_user) return -EINVAL; if (copy_from_user(&u32, arg_user, sizeof(uint32_t))) return -EFAULT; - r = smp_call_function_single(2, + ret = smp_call_function_single(2, cachepc_kvm_init_pmc_ioctl, &u32, true); - WARN_ON(r != 0); + WARN_ON(ret != 0); break; default: return -EINVAL; @@ -364,5 +364,3 @@ cachepc_kvm_exit(void) cachepc_release_ds(cachepc_ctx, cachepc_ds); cachepc_release_ctx(cachepc_ctx); } - - diff --git a/patch.diff b/patch.diff index 1ccac49..c75a13a 100755 --- a/patch.diff +++ b/patch.diff @@ -27,7 +27,7 @@ index b804444e16d4..66a4d56e331a 100644 vmx/evmcs.o vmx/nested.o vmx/posted_intr.o -kvm-amd-y += svm/svm.o svm/vmenter.o svm/pmu.o svm/nested.o svm/avic.o svm/sev.o +kvm-amd-y += svm/svm.o svm/vmenter.o svm/pmu.o svm/nested.o svm/avic.o svm/sev.o \ -+ svm/cachepc/cachepc.o svm/cachepc/util.o svm/cachepc/kvm.o ++ svm/cachepc/cachepc.o svm/cachepc/util.o obj-$(CONFIG_KVM) += kvm.o obj-$(CONFIG_KVM_INTEL) += kvm-intel.o -- cgit v1.2.3-71-gd317