Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F158001672
D57067.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D57067.id.diff
View Options
diff --git a/lib/libsys/getrlimit.2 b/lib/libsys/getrlimit.2
--- a/lib/libsys/getrlimit.2
+++ b/lib/libsys/getrlimit.2
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd July 25, 2024
+.Dd May 18, 2026
.Dt GETRLIMIT 2
.Os
.Sh NAME
@@ -128,6 +128,8 @@
.It Dv RLIMIT_VMEM
An alias for
.Dv RLIMIT_AS .
+.It Dv RLIMIT_VMM
+The limit of the number of VMM instances per user id.
.El
.Pp
A resource limit is specified as a soft limit and a hard limit.
diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c
--- a/sys/dev/vmm/vmm_dev.c
+++ b/sys/dev/vmm/vmm_dev.c
@@ -105,10 +105,6 @@
SYSCTL_UINT(_hw_vmm, OID_AUTO, maxcpu, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
&vm_maxcpu, 0, "Maximum number of vCPUs");
-u_int vm_maxvmms;
-SYSCTL_UINT(_hw_vmm, OID_AUTO, maxvmms, CTLFLAG_RWTUN,
- &vm_maxvmms, 0, "Maximum number of VMM instances per user");
-
static void devmem_destroy(void *arg);
static int devmem_create_cdev(struct vmmdev_softc *sc, int id, char *devmem);
static void vmmdev_destroy(struct vmmdev_softc *sc);
@@ -1022,7 +1018,7 @@
"VMs cannot be created in the current jail"));
}
- if (!chgvmmcnt(cred->cr_ruidinfo, 1, vm_maxvmms)) {
+ if (!chgvmmcnt(cred->cr_ruidinfo, 1, lim_cur(curthread, RLIMIT_VMM))) {
sx_xunlock(&vmmdev_mtx);
return (ENOMEM);
}
@@ -1258,7 +1254,6 @@
}
if (vm_maxcpu == 0)
vm_maxcpu = 1;
- vm_maxvmms = 4 * mp_ncpus;
error = vmm_modinit();
if (error == 0)
vmm_initialized = true;
diff --git a/usr.bin/login/login.conf b/usr.bin/login/login.conf
--- a/usr.bin/login/login.conf
+++ b/usr.bin/login/login.conf
@@ -44,6 +44,7 @@
:kqueues=unlimited:\
:umtxp=unlimited:\
:pipebuf=unlimited:\
+ :vms=unlimited:\
:priority=0:\
:umask=022:\
:charset=UTF-8:\
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 28, 9:07 AM (10 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33581964
Default Alt Text
D57067.id.diff (1 KB)
Attached To
Mode
D57067: vmm: Fully adopt the getrlimit(2) machinery for limiting the number of VMM instances
Attached
Detach File
Event Timeline
Log In to Comment