From nobody Tue May 10 20:50:04 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9BBDF1ADA31F; Tue, 10 May 2022 20:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KyVXr3vrzz3pWl; Tue, 10 May 2022 20:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652215804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NbrnwVG9tye56BRe/YZYTNH+9XezBYJZLZ1XdlwQOBQ=; b=hOqMo4+D3z3mUwU3nijxKN24G+5byjF1Y8jtGdyj3733SLOi+jYSe2kE/lvCXLsi6I22Je OLEBr+VgCV+ymFAlcNpgrJzLfSpIIwjt4sKTTqNR0yv/tGAzEhB9nqiusamir38zfy44Vk 94hsUNu0JUHWmCbIP1cN0Hc3KZykFmjgfpX7lnyp7OdQj29lvSCPI+SAg9kS9B0eRSH/gJ efUgv/Z+XG0Mn91sJKdr2UIX3UdvzqepUVtNXGVaY77Qe8bqQG3K2roHtmVqOovzGSAZqI g0y9CUIIEOOut4Ak50vusl+JILob2UbBVXdTJO9P46zJrKAwUTrlugHiYL228Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66CF5465B; Tue, 10 May 2022 20:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24AKo4xr058345; Tue, 10 May 2022 20:50:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24AKo4G8058342; Tue, 10 May 2022 20:50:04 GMT (envelope-from git) Date: Tue, 10 May 2022 20:50:04 GMT Message-Id: <202205102050.24AKo4G8058342@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: John Baldwin Subject: git: bc6d5725ed6c - main - emulators/virtualbox-ose-kmod*: Tie to a specific release branch. List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc6d5725ed6c7b6538da70328d89afe901736a90 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652215804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NbrnwVG9tye56BRe/YZYTNH+9XezBYJZLZ1XdlwQOBQ=; b=BvIURVA+Sf9sTT2vQLpGPxzRYi2nAaxrMqi2//QVlVQUuI3Y0lWN5vx4MO++W47kHV9ohh 1OfeuIgLsj1NN9H/ER5bQnnXTBx1EPRGYj5ga4ZEzDDpEGuA74t4eewTBqnpvPhX6FVu7C GBVQNWVhkZiRbwsZs+u+7tMkUfoWyzIb6eBAyUqYBEmMi728U3Y3A3QSaPY+gfzHDOLYIL hA1Om5HZWmY59uOtVJQbT+qNm0PRgum/FfgPovxarZo8uES8OKjzRbnnYKmTebqDFP+yOZ O35b8en4MlbRIZ5i2hCO2WXqyTq8ulQx1ci3DYVDMAf/QwMO52NI0TOv+kgGNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652215804; a=rsa-sha256; cv=none; b=F7KNpI6BoCCeughzFZnW+GEdrtogDGFLKeSJQMA2HUflWgcUkhqo0w98jZU0BkbnYubKda WGsMj5vzvritj/a2h0ixNH0baG+foOw1QLTWYjhmvicsJgiTqYTeROF+tf4DJru0MvWLzt 9sy9ncaTVCHkDe8GfkZqPnRAN6n2mmdr9ISsNR3bQZenc4ctx1fSVmJTe82SnXdY05ml9y WiqQnZVsJoYA1yyPsKPdy9EsdFDfeskp56NAUUQpK2f2GNU9epssXq+LCLDALV5dMOOu1i 63t0FLJrdz5HVEmjF02IlgGLyWCSnIjTXdAfMgEovEJYpzMRxWAmjy5eIjWFlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb (doc, src committer): URL: https://cgit.FreeBSD.org/ports/commit/?id=bc6d5725ed6c7b6538da70328d89afe901736a90 commit bc6d5725ed6c7b6538da70328d89afe901736a90 Author: John Baldwin AuthorDate: 2022-05-10 20:48:31 +0000 Commit: John Baldwin CommitDate: 2022-05-10 20:48:31 +0000 emulators/virtualbox-ose-kmod*: Tie to a specific release branch. Use a more restricted range of supported __FreeBSD_version values for the virtualbox kernel module since it uses internal KPIs for which KBI stability is not guaranteed. DECLARE_MODULE_TIED would tie the module to a specific __FreeBSD_version which would cause the module to stop loading when an SA or EN is pushed on a release branch. Instead, use DECLARE_MODULE_MAXVER with an upper bound that is limited to the range of a releng branch so that a module built on X.Y will load on X.Y with SAs or ENs applied but will fail to load on X.Y-1 or X.Y+1. Reviewed by: kevans, imp, madpilot, lwhsu (earlier version) Differential Revision: https://reviews.freebsd.org/D16119 --- emulators/virtualbox-ose-kmod-legacy/Makefile | 3 ++ .../files/pkg-message.in | 10 +++++++ emulators/virtualbox-ose-kmod/Makefile | 4 +++ emulators/virtualbox-ose-kmod/files/pkg-message.in | 10 +++++++ ...ox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c | 32 ++++++++++++++-------- ...ox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c | 28 +++++++++++++------ 6 files changed, 67 insertions(+), 20 deletions(-) diff --git a/emulators/virtualbox-ose-kmod-legacy/Makefile b/emulators/virtualbox-ose-kmod-legacy/Makefile index 06b78180fb46..dedde4502e84 100644 --- a/emulators/virtualbox-ose-kmod-legacy/Makefile +++ b/emulators/virtualbox-ose-kmod-legacy/Makefile @@ -19,6 +19,9 @@ BUILD_DEPENDS= kmk:devel/kBuild CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox +SUB_FILES= pkg-message +SUB_LIST= OPSYS=${OPSYS} OSREL=${OSREL} + USES= cpe kmod tar:bzip2 PATCHDIR= ${.CURDIR}/../${PORTNAME}-legacy/files WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} diff --git a/emulators/virtualbox-ose-kmod-legacy/files/pkg-message.in b/emulators/virtualbox-ose-kmod-legacy/files/pkg-message.in new file mode 100644 index 000000000000..4e03cc0b5ec7 --- /dev/null +++ b/emulators/virtualbox-ose-kmod-legacy/files/pkg-message.in @@ -0,0 +1,10 @@ +[ +{ type: install + message: < @@ -33,7 +33,17 @@ /********************************************************************************************************************************* -@@ -182,6 +192,13 @@ static int VBoxDrvFreeBSDLoad(void) +@@ -93,7 +103,8 @@ static moduledata_t g_VBoxDrvFreeBSDModule = + }; + + /** Declare the module as a pseudo device. */ +-DECLARE_MODULE(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY); ++#define KERNEL_RELBRANCHEND (roundup(__FreeBSD_version, 500) - 1) ++DECLARE_MODULE_WITH_MAXVER(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY, KERNEL_RELBRANCHEND); + MODULE_VERSION(vboxdrv, 1); + + /** +@@ -182,6 +193,13 @@ static int VBoxDrvFreeBSDLoad(void) rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION)); if (RT_SUCCESS(rc)) { @@ -47,7 +57,7 @@ /* * Configure character devices. Add symbolic links for compatibility. */ -@@ -311,7 +328,21 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo +@@ -311,7 +329,21 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo PSUPDRVSESSION pSession; devfs_get_cdevpriv((void **)&pSession); @@ -69,7 +79,7 @@ * Deal with the fast ioctl path first. */ if ( ( ulCmd == SUP_IOCTL_FAST_DO_RAW_RUN -@@ -325,6 +356,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo +@@ -325,6 +357,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo /** @@ -115,7 +125,7 @@ * Deal with the 'slow' I/O control requests. * * @returns 0 on success, appropriate errno on failure. -@@ -373,11 +443,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -373,11 +444,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes */ SUPREQHDR Hdr; pvUser = *(void **)pvData; @@ -130,7 +140,7 @@ } if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC)) { -@@ -402,13 +471,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -402,13 +472,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd)); return ENOMEM; } @@ -148,7 +158,7 @@ } if (Hdr.cbIn < cbReq) RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn); -@@ -436,9 +504,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -436,9 +505,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd)); cbOut = cbReq; } @@ -160,7 +170,7 @@ Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd)); -@@ -541,8 +608,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE +@@ -541,8 +609,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) { @@ -170,7 +180,7 @@ } -@@ -625,11 +691,25 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, +@@ -625,11 +692,25 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, #endif /* SUPDRV_WITH_MSR_PROBER */ @@ -196,7 +206,7 @@ va_start(va, pszFormat); cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va); -@@ -637,12 +717,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) +@@ -637,12 +718,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) printf("%s", szMsg); 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 fb3a4470d560..2e2c292d7ee8 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,5 +1,5 @@ ---- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2021-10-18 17:58:03 UTC -+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c +--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2021-10-18 10:58:03.000000000 -0700 ++++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c 2021-11-19 15:31:33.152269000 -0800 @@ -44,8 +44,10 @@ #include #include @@ -36,7 +36,17 @@ /********************************************************************************************************************************* -@@ -182,6 +193,13 @@ static int VBoxDrvFreeBSDLoad(void) +@@ -93,7 +104,8 @@ static moduledata_t g_VBoxDrvFreeBSDModule = + }; + + /** Declare the module as a pseudo device. */ +-DECLARE_MODULE(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY); ++#define KERNEL_RELBRANCHEND (roundup(__FreeBSD_version, 500) - 1) ++DECLARE_MODULE_WITH_MAXVER(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY, KERNEL_RELBRANCHEND); + MODULE_VERSION(vboxdrv, 1); + + /** +@@ -182,6 +194,13 @@ static int VBoxDrvFreeBSDLoad(void) rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION)); if (RT_SUCCESS(rc)) { @@ -50,7 +60,7 @@ /* * Configure character devices. Add symbolic links for compatibility. */ -@@ -324,6 +342,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo +@@ -324,6 +343,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo /** @@ -96,7 +106,7 @@ * Deal with the 'slow' I/O control requests. * * @returns 0 on success, appropriate errno on failure. -@@ -372,11 +429,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -372,11 +430,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes */ SUPREQHDR Hdr; pvUser = *(void **)pvData; @@ -111,7 +121,7 @@ } if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC)) { -@@ -401,13 +457,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -401,13 +458,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd)); return ENOMEM; } @@ -129,7 +139,7 @@ } if (Hdr.cbIn < cbReq) RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn); -@@ -435,9 +490,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -435,9 +491,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd)); cbOut = cbReq; } @@ -141,7 +151,7 @@ Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd)); -@@ -540,8 +594,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE +@@ -540,8 +595,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) { @@ -151,7 +161,7 @@ } -@@ -624,19 +677,43 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, +@@ -624,19 +678,43 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, #endif /* SUPDRV_WITH_MSR_PROBER */