FreeBSD Bugzilla – Attachment 244203 Details for
Bug 219913
emulators/virtualbox-ose-kmod: if the MAXCPU option is not the default for the running kernel, then 'kldload vboxdrv.ko' will result in a kernel panic
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
updated patch
patch2.txt (text/plain), 5.49 KB, created by
Craig Leres
on 2023-08-18 21:11:19 UTC
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Craig Leres
Created:
2023-08-18 21:11:19 UTC
Size:
5.49 KB
patch
obsolete
>diff --git a/emulators/virtualbox-ose-kmod/Makefile b/emulators/virtualbox-ose-kmod/Makefile >index 49fe419235d..42118f5dbb3 100644 >--- a/emulators/virtualbox-ose-kmod/Makefile >+++ b/emulators/virtualbox-ose-kmod/Makefile >@@ -1,5 +1,6 @@ > PORTNAME= virtualbox-ose > PORTVERSION= 6.1.46 >+PORTREVISION= 1 > CATEGORIES= emulators > MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/ > PKGNAMESUFFIX= -kmod >diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile >index 45eac8c9e2b..55a8f5ac632 100644 >--- a/emulators/virtualbox-ose/Makefile >+++ b/emulators/virtualbox-ose/Makefile >@@ -1,6 +1,6 @@ > PORTNAME= virtualbox-ose > PORTVERSION= 6.1.46 >-PORTREVISION?= 1 >+PORTREVISION?= 2 > CATEGORIES= emulators > MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/ > DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS} >diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c b/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c >index ea9d35bc1c6..a36c39e1063 100644 >--- a/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c >+++ b/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c >@@ -1,17 +1,18 @@ >---- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2022-07-19 20:58:42 UTC >+--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2023-07-12 16:06:43 UTC > +++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c >-@@ -44,8 +44,10 @@ >+@@ -44,8 +44,11 @@ > #include <sys/fcntl.h> > #include <sys/conf.h> > #include <sys/uio.h> > +#include <sys/mutex.h> >++#include <sys/smp.h> /* mp_maxcpus */ > > #include "../SUPDrvInternal.h" > +#include "freebsd/the-freebsd-kernel.h" > #include <VBox/version.h> > #include <iprt/initterm.h> > #include <iprt/string.h> >-@@ -57,7 +59,14 @@ >+@@ -57,7 +60,14 @@ > #include <iprt/alloc.h> > #include <iprt/err.h> > #include <iprt/asm.h> >@@ -26,7 +27,7 @@ > #ifdef VBOX_WITH_HARDENING > # define VBOXDRV_PERM 0600 > #else >-@@ -76,7 +85,9 @@ static d_ioctl_t VBoxDrvFreeBSDIOCtl; >+@@ -76,7 +86,9 @@ static d_open_t VBoxDrvFreeBSDOpenUsr; > static d_open_t VBoxDrvFreeBSDOpenSys; > static void vboxdrvFreeBSDDtr(void *pvData); > static d_ioctl_t VBoxDrvFreeBSDIOCtl; >@@ -36,7 +37,7 @@ > > > /********************************************************************************************************************************* >-@@ -93,7 +104,8 @@ static moduledata_t g_VBoxDrvFreeBSDModule = >+@@ -93,7 +105,8 @@ static moduledata_t g_VBoxDrvFreeBSDModule = > }; > > /** Declare the module as a pseudo device. */ >@@ -46,7 +47,22 @@ > MODULE_VERSION(vboxdrv, 1); > > /** >-@@ -182,6 +194,13 @@ static int VBoxDrvFreeBSDLoad(void) >+@@ -140,6 +153,14 @@ static SUPDRVDEVEXT g_VBoxDrvFreeBSDDevExt; >+ static int VBoxDrvFreeBSDModuleEvent(struct module *pMod, int enmEventType, void *pvArg) >+ { >+ int rc; >++ >++ /* Refuse to load if mp_maxcpus is wrong */ >++ if (MAXCPU != mp_maxcpus) { >++ printf("vboxdrv: MAXCPU != mp_maxcpus (%d != %d)\n", >++ MAXCPU, mp_maxcpus); >++ return EINVAL; >++ } >++ >+ switch (enmEventType) >+ { >+ case MOD_LOAD: >+@@ -182,6 +203,13 @@ static int VBoxDrvFreeBSDLoad(void) > rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION)); > if (RT_SUCCESS(rc)) > { >@@ -60,7 +76,7 @@ > /* > * Configure character devices. Add symbolic links for compatibility. > */ >-@@ -324,6 +343,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo >+@@ -324,6 +352,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo > > > /** >@@ -106,7 +122,7 @@ > * Deal with the 'slow' I/O control requests. > * > * @returns 0 on success, appropriate errno on failure. >-@@ -372,11 +430,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes >+@@ -372,11 +439,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes > */ > SUPREQHDR Hdr; > pvUser = *(void **)pvData; >@@ -121,7 +137,7 @@ > } > if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC)) > { >-@@ -401,13 +458,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes >+@@ -401,13 +467,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes > OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd)); > return ENOMEM; > } >@@ -139,7 +155,7 @@ > } > if (Hdr.cbIn < cbReq) > RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn); >-@@ -435,9 +491,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes >+@@ -435,9 +500,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes > OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd)); > cbOut = cbReq; > } >@@ -151,7 +167,7 @@ > > Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd)); > >-@@ -540,8 +595,7 @@ bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) >+@@ -540,8 +604,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE > > bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) > { >@@ -161,7 +177,7 @@ > } > > >-@@ -624,20 +678,44 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, >+@@ -624,20 +687,44 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, > #endif /* SUPDRV_WITH_MSR_PROBER */ > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 219913
:
192427
|
244203
|
251748