aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2023-05-11 15:00:53 +0000
committerMark Johnston <markj@FreeBSD.org>2023-05-11 15:00:53 +0000
commit272525b73b6548d84b3cea84579c6dd9a1e0a961 (patch)
tree17e7f61fd5dc00d5d1b45da52cfee5270a379c12
parent04622b63cde823ee844f8d076fd207e979591889 (diff)
downloadsrc-272525b73b6548d84b3cea84579c6dd9a1e0a961.tar.gz
src-272525b73b6548d84b3cea84579c6dd9a1e0a961.zip
vmm: Fix casts around kmem_malloc/free() calls
This is a direct commit to stable/13. Reported by: Jenkins
-rw-r--r--sys/amd64/vmm/amd/svm.c4
-rw-r--r--sys/amd64/vmm/intel/vmx.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c
index d295401a9043..bd0c4db20b3d 100644
--- a/sys/amd64/vmm/amd/svm.c
+++ b/sys/amd64/vmm/amd/svm.c
@@ -168,7 +168,7 @@ svm_modcleanup(void)
smp_rendezvous(NULL, svm_disable, NULL, NULL);
if (hsave != NULL)
- kmem_free(hsave, (mp_maxid + 1) * PAGE_SIZE);
+ kmem_free((vm_offset_t)hsave, (mp_maxid + 1) * PAGE_SIZE);
return (0);
}
@@ -272,7 +272,7 @@ svm_modinit(int ipinum)
svm_npt_init(ipinum);
/* Enable SVM on all CPUs */
- hsave = kmem_malloc((mp_maxid + 1) * PAGE_SIZE, M_WAITOK | M_ZERO);
+ hsave = (void *)kmem_malloc((mp_maxid + 1) * PAGE_SIZE, M_WAITOK | M_ZERO);
smp_rendezvous(NULL, svm_enable, NULL, NULL);
return (0);
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index 8b8f8fe6cb25..fe8f9b40a7d0 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -621,7 +621,7 @@ vmx_modcleanup(void)
smp_rendezvous(NULL, vmx_disable, NULL, NULL);
if (vmxon_region != NULL)
- kmem_free(vmxon_region, (mp_maxid + 1) * PAGE_SIZE);
+ kmem_free((vm_offset_t)vmxon_region, (mp_maxid + 1) * PAGE_SIZE);
return (0);
}
@@ -957,7 +957,7 @@ vmx_modinit(int ipinum)
vmx_msr_init();
/* enable VMX operation */
- vmxon_region = kmem_malloc((mp_maxid + 1) * PAGE_SIZE,
+ vmxon_region = (void *)kmem_malloc((mp_maxid + 1) * PAGE_SIZE,
M_WAITOK | M_ZERO);
smp_rendezvous(NULL, vmx_enable, NULL, NULL);