From nobody Sun Sep 1 14:09:40 2024 X-Original-To: dev-commits-src-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 4WxYfs0WKxz5VGcM; Sun, 01 Sep 2024 14:09:41 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxYfr5R73z4Qfx; Sun, 1 Sep 2024 14:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199780; 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=5FsGTa4BPyawrhgoaPnxrh54ccANbd6G7NDH8uYlQOE=; b=f3Fh0Ivke5gqdOKMZFshZZ/Xpv6jzxZYs5pPfBnXgDf/Bq7uV1Mn18Ax0gPbVB9kBdvlOn uF/+Mabvjv41862SKFtT31KDqJRM7AeFZsePjMux5pkrAfTriEDayyWOJiV3FO5G1ElcRg J9h0Cnd3p8mgWsgHBcTsb1C5FtHuBKwOoUItUhgB783D+SDafnSbqM4+HQSq3klL+7SJtB UB1afdo/QdnM2fXoS91/gPdEdZis2X3q7nlANZtgxh7Ez5qy6vlIVsE/Y/4Ib5GcUbcdaK xPpwgwI0Q23fkQPN6DCYn4adpo2CoU87ZX3tHXAvQxkfn4sM1BMZeR/ijfDQuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725199780; a=rsa-sha256; cv=none; b=Iy+fS0nKbcdzB+CKl9B0LEmVSdILZ10xoKOIYfzEbUcW3udJkUiQkUIAnADTU0awfJE66l wsU+K9bVsFZgMSttuj6kthERWQRNJGsbFq4iDyQ0ZXi9g0Pk1Y9oej54Jg+D/kOPQsmllj yqaSl0zxxWHXkd83BNtcEoNw96w/Hj25TyN8qoymt8PJlof5HJEzT5lQU9HULmAXZz28h8 BJ2v3iEq6Qk0JWExRdi1iDUhdZ/CG7LBFPJeEpliX1J5dE/LEMWJvVR8w626Tz33syNaHc BIJieb1kb/dl7ut9wwd6BA9S5L9fiLSWHktwwh7iVi4oRe4/XLuSWkg4xzO9Zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199780; 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=5FsGTa4BPyawrhgoaPnxrh54ccANbd6G7NDH8uYlQOE=; b=Wtgd7PJ4Yze/GQL6WcMhy+AI6eKzPP+7mQ3w1pjrzaCMdw5MZaY7xRvv6DIvYYsloArGE9 pk4756pBJ/4kfZ50DOzz25IHGtdZ0WwPykHqStrTfGtAG5VDW6WelByELYbqOSGtxyDj7p h7snS9NBzpCqqdl1NIC9I97dwGQJDAu2IZi4xgJeFtjesuypB2m/MY7PM/S9/31sD40Uxu W81JzpD+qiPvXuV2hEyNR9twy0E8uXelcc70qeeC9PzHUQ4d0l+CME3h6rWJNkobepWniX XqbidGT//1de8TM8Dx3+hhMBFwaVe6ehxKipDyvBrSsjVzMwaRMzQAZvG7zndw== 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 4WxYfr52R7zXcw; Sun, 1 Sep 2024 14:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 481E9eFp099555; Sun, 1 Sep 2024 14:09:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481E9e3w099552; Sun, 1 Sep 2024 14:09:40 GMT (envelope-from git) Date: Sun, 1 Sep 2024 14:09:40 GMT Message-Id: <202409011409.481E9e3w099552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 780675e1bed9 - main - arm64: Fix the VM_MAX_NAMELEN definition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 780675e1bed9fa8e328327e3b6416642a16b2a98 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=780675e1bed9fa8e328327e3b6416642a16b2a98 commit 780675e1bed9fa8e328327e3b6416642a16b2a98 Author: Mark Johnston AuthorDate: 2024-09-01 14:00:20 +0000 Commit: Mark Johnston CommitDate: 2024-09-01 14:03:15 +0000 arm64: Fix the VM_MAX_NAMELEN definition The maximum VM name length has changed since the arm64 vmm code was forked. For now, just sync with the amd64 definitions, since they permit longer VM names. As arm64/vmm is implemented only in main, I won't bother dealing with backward compat. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D46484 --- sys/arm64/include/vmm.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/sys/arm64/include/vmm.h b/sys/arm64/include/vmm.h index 05b013557c06..acbd8f5cbcb9 100644 --- a/sys/arm64/include/vmm.h +++ b/sys/arm64/include/vmm.h @@ -102,14 +102,30 @@ enum vm_reg_name { #define VM_INTINFO_HWEXCEPTION (3 << 8) #define VM_INTINFO_SWINTR (4 << 8) -#define VM_MAX_SUFFIXLEN 15 - #define VM_GUEST_BASE_IPA 0x80000000UL /* Guest kernel start ipa */ -#ifdef _KERNEL - -#define VM_MAX_NAMELEN 32 +/* + * The VM name has to fit into the pathname length constraints of devfs, + * governed primarily by SPECNAMELEN. The length is the total number of + * characters in the full path, relative to the mount point and not + * including any leading '/' characters. + * A prefix and a suffix are added to the name specified by the user. + * The prefix is usually "vmm/" or "vmm.io/", but can be a few characters + * longer for future use. + * The suffix is a string that identifies a bootrom image or some similar + * image that is attached to the VM. A separator character gets added to + * the suffix automatically when generating the full path, so it must be + * accounted for, reducing the effective length by 1. + * The effective length of a VM name is 229 bytes for FreeBSD 13 and 37 + * bytes for FreeBSD 12. A minimum length is set for safety and supports + * a SPECNAMELEN as small as 32 on old systems. + */ +#define VM_MAX_PREFIXLEN 10 +#define VM_MAX_SUFFIXLEN 15 +#define VM_MAX_NAMELEN \ + (SPECNAMELEN - VM_MAX_PREFIXLEN - VM_MAX_SUFFIXLEN - 1) +#ifdef _KERNEL struct vm; struct vm_exception; struct vm_exit;