From nobody Wed Aug 28 19:12:47 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 4WvDZS2208z5MZW8; Wed, 28 Aug 2024 19:12:48 +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 4WvDZS0g4nz4pc9; Wed, 28 Aug 2024 19:12:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872368; 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=xCaCC1lyWx/mGAwnSwLqinjhhvQy/0Qj00VfVklbALA=; b=BQNhinNjVpr/2v6FizPa2gNtorvU07VP5ibb8jBMaYNsPe1xy3UQL2rH8lpdX8pOYkanxX Ki0V6MNgJWl/omvplh/34IphX7yE5kB0F5eSvkPhxQ08Bc9SOsGI0IIlPHbQ611a5Tj446 zF/vLptnYNjVV5waubLX6rDyv9I7BM8YjA8Uk/PyQfwLEk2YWUW9jqEJ+/RQofu61AmBS1 FnlLiISd2iPwJoCS3GTpVGISrmxDbyvtt2VT1uf5M/gtrLOZZVET5Jk+Zk2KZw37w70jDN bQykUT023enQlgFMLlG74ogRxf9aInYFOHC3KBW6i4qiuQDKT/b5+p8hnMP23w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724872368; a=rsa-sha256; cv=none; b=sEhTFGq9nbPqeZKrHarsKi4qsXwYUSB0xOVU67LSjjBJcna4YUhueHWsTuQOo6/VW//OLH tWLoeoz6QUVQNwW9GDQ1vft7NeIpRcx2KjR1zxw1JI1qCI3Qw2rw+TjROxqGLXdlPy//cy tOUOOwNOMqCJ8UJw6dAhuGTSo67otRsCKKh52atbPAAdvt0tbjvAdG2R4Ue8WVkdgwElmR qKklxre51tvVdbzkmHEbRSIjSJscH99HJZ9pNmnklwoyDrwlJ6UI1bp1bSXSpwaRdJaFsn Oe/4KcEjRdCELIHli2xAyWmJnMW4u1BjD1A5TWSGsknIX/OS7y1/fVbLQmXmfQ== 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=1724872368; 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=xCaCC1lyWx/mGAwnSwLqinjhhvQy/0Qj00VfVklbALA=; b=DPyEwbG+jXf5KSFH9d2t/ThtbCUzZFw/hCG/qkPq8S5/N4vQFoX0NzNyRaSfsyaz5YqLfn 6H32UzNvRsdhPVZNYWp91DtaIsi63mujbcubFBNkSmhbC4iNxFS9uNANuMuziHriQTup+v IEl7uzSi7LTwW9Hauwp1pW9g7RJtVDaikVZxcaVagve9IWjTD3uBCmiLg2KWmqAEMAPi/M iCraJYcC90l7SahNAEEfG8ahfw+OFv+4krj536LrIi5F3nn7syo5ELAxQrKVLehyq/EzsT gA403iTby5yjXkClU027MpkgM8dypRpd4mM0xgA8SP+4mqafogpVmLKsnIJKiA== 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 4WvDZS06LVzmXB; Wed, 28 Aug 2024 19:12:48 +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 47SJClwX059235; Wed, 28 Aug 2024 19:12:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SJCl4M059232; Wed, 28 Aug 2024 19:12:47 GMT (envelope-from git) Date: Wed, 28 Aug 2024 19:12:47 GMT Message-Id: <202408281912.47SJCl4M059232@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: a852dc580c1c - main - vmm: Harmonize compat ioctl definitions 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: a852dc580c1c261bc50fd9788b52abca0004661b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a852dc580c1c261bc50fd9788b52abca0004661b commit a852dc580c1c261bc50fd9788b52abca0004661b Author: Mark Johnston AuthorDate: 2024-08-28 18:57:43 +0000 Commit: Mark Johnston CommitDate: 2024-08-28 19:12:32 +0000 vmm: Harmonize compat ioctl definitions For compat ioctls and structures, we use a mix of suffixes: _old, _fbsd, _. Standardize on _ to make things more consistent. No functional change intended. Reported by: jhb Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D46449 --- sys/amd64/vmm/vmm_dev_machdep.c | 34 +++++++++++++++++----------------- sys/dev/vmm/vmm_dev.c | 24 ++++++++++++------------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sys/amd64/vmm/vmm_dev_machdep.c b/sys/amd64/vmm/vmm_dev_machdep.c index 792807568212..2d0ceadaedfe 100644 --- a/sys/amd64/vmm/vmm_dev_machdep.c +++ b/sys/amd64/vmm/vmm_dev_machdep.c @@ -59,16 +59,16 @@ #include "io/vrtc.h" #ifdef COMPAT_FREEBSD13 -struct vm_stats_old { +struct vm_stats_13 { int cpuid; /* in */ int num_entries; /* out */ struct timeval tv; uint64_t statbuf[MAX_VM_STATS]; }; -#define VM_STATS_OLD _IOWR('v', IOCNUM_VM_STATS, struct vm_stats_old) +#define VM_STATS_13 _IOWR('v', IOCNUM_VM_STATS, struct vm_stats_13) -struct vm_snapshot_meta_old { +struct vm_snapshot_meta_13 { void *ctx; /* unused */ void *dev_data; const char *dev_name; /* identify userspace devices */ @@ -79,8 +79,8 @@ struct vm_snapshot_meta_old { enum vm_snapshot_op op; }; -#define VM_SNAPSHOT_REQ_OLD \ - _IOWR('v', IOCNUM_SNAPSHOT_REQ, struct vm_snapshot_meta_old) +#define VM_SNAPSHOT_REQ_13 \ + _IOWR('v', IOCNUM_SNAPSHOT_REQ, struct vm_snapshot_meta_13) struct vm_exit_ipi_13 { uint32_t mode; @@ -131,14 +131,14 @@ const struct vmmdev_ioctl vmmdev_machdep_ioctls[] = { VMMDEV_IOCTL(VM_UNMAP_PPTDEV_MMIO, VMMDEV_IOCTL_LOCK_ALL_VCPUS), #ifdef BHYVE_SNAPSHOT #ifdef COMPAT_FREEBSD13 - VMMDEV_IOCTL(VM_SNAPSHOT_REQ_OLD, VMMDEV_IOCTL_LOCK_ALL_VCPUS), + VMMDEV_IOCTL(VM_SNAPSHOT_REQ_13, VMMDEV_IOCTL_LOCK_ALL_VCPUS), #endif VMMDEV_IOCTL(VM_SNAPSHOT_REQ, VMMDEV_IOCTL_LOCK_ALL_VCPUS), VMMDEV_IOCTL(VM_RESTORE_TIME, VMMDEV_IOCTL_LOCK_ALL_VCPUS), #endif #ifdef COMPAT_FREEBSD13 - VMMDEV_IOCTL(VM_STATS_OLD, VMMDEV_IOCTL_LOCK_ONE_VCPU), + VMMDEV_IOCTL(VM_STATS_13, VMMDEV_IOCTL_LOCK_ONE_VCPU), #endif VMMDEV_IOCTL(VM_INJECT_NMI, VMMDEV_IOCTL_LOCK_ONE_VCPU), VMMDEV_IOCTL(VM_LAPIC_IRQ, VMMDEV_IOCTL_LOCK_ONE_VCPU), @@ -196,7 +196,7 @@ vmmdev_machdep_ioctl(struct vm *vm, struct vcpu *vcpu, u_long cmd, caddr_t data, #ifdef BHYVE_SNAPSHOT struct vm_snapshot_meta *snapshot_meta; #ifdef COMPAT_FREEBSD13 - struct vm_snapshot_meta_old *snapshot_old; + struct vm_snapshot_meta_13 *snapshot_13; #endif #endif int error; @@ -270,13 +270,13 @@ vmmdev_machdep_ioctl(struct vm *vm, struct vcpu *vcpu, u_long cmd, caddr_t data, } break; } - case VM_STATS_OLD: { - struct vm_stats_old *vmstats_old; + case VM_STATS_13: { + struct vm_stats_13 *vmstats_13; - vmstats_old = (struct vm_stats_old *)data; - getmicrotime(&vmstats_old->tv); - error = vmm_stat_copy(vcpu, 0, nitems(vmstats_old->statbuf), - &vmstats_old->num_entries, vmstats_old->statbuf); + vmstats_13 = (struct vm_stats_13 *)data; + getmicrotime(&vmstats_13->tv); + error = vmm_stat_copy(vcpu, 0, nitems(vmstats_13->statbuf), + &vmstats_13->num_entries, vmstats_13->statbuf); break; } #endif @@ -502,14 +502,14 @@ vmmdev_machdep_ioctl(struct vm *vm, struct vcpu *vcpu, u_long cmd, caddr_t data, error = vm_snapshot_req(vm, snapshot_meta); break; #ifdef COMPAT_FREEBSD13 - case VM_SNAPSHOT_REQ_OLD: + case VM_SNAPSHOT_REQ_13: /* * The old structure just has an additional pointer at * the start that is ignored. */ - snapshot_old = (struct vm_snapshot_meta_old *)data; + snapshot_13 = (struct vm_snapshot_meta_13 *)data; snapshot_meta = - (struct vm_snapshot_meta *)&snapshot_old->dev_data; + (struct vm_snapshot_meta *)&snapshot_13->dev_data; error = vm_snapshot_req(vm, snapshot_meta); break; #endif diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index fa9357b3b566..f43429de4d4c 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -29,17 +29,17 @@ #include #if defined(__amd64__) && defined(COMPAT_FREEBSD12) -struct vm_memseg_fbsd12 { +struct vm_memseg_12 { int segid; size_t len; char name[64]; }; -_Static_assert(sizeof(struct vm_memseg_fbsd12) == 80, "COMPAT_FREEBSD12 ABI"); +_Static_assert(sizeof(struct vm_memseg_12) == 80, "COMPAT_FREEBSD12 ABI"); -#define VM_ALLOC_MEMSEG_FBSD12 \ - _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg_fbsd12) -#define VM_GET_MEMSEG_FBSD12 \ - _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg_fbsd12) +#define VM_ALLOC_MEMSEG_12 \ + _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg_12) +#define VM_GET_MEMSEG_12 \ + _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg_12) #endif struct devmem_softc { @@ -339,7 +339,7 @@ static const struct vmmdev_ioctl vmmdev_ioctls[] = { VMMDEV_IOCTL(VM_STATS, VMMDEV_IOCTL_LOCK_ONE_VCPU), #if defined(__amd64__) && defined(COMPAT_FREEBSD12) - VMMDEV_IOCTL(VM_ALLOC_MEMSEG_FBSD12, + VMMDEV_IOCTL(VM_ALLOC_MEMSEG_12, VMMDEV_IOCTL_XLOCK_MEMSEGS | VMMDEV_IOCTL_LOCK_ALL_VCPUS), #endif VMMDEV_IOCTL(VM_ALLOC_MEMSEG, @@ -352,7 +352,7 @@ static const struct vmmdev_ioctl vmmdev_ioctls[] = { VMMDEV_IOCTL_XLOCK_MEMSEGS | VMMDEV_IOCTL_LOCK_ALL_VCPUS), #if defined(__amd64__) && defined(COMPAT_FREEBSD12) - VMMDEV_IOCTL(VM_GET_MEMSEG_FBSD12, VMMDEV_IOCTL_SLOCK_MEMSEGS), + VMMDEV_IOCTL(VM_GET_MEMSEG_12, VMMDEV_IOCTL_SLOCK_MEMSEGS), #endif VMMDEV_IOCTL(VM_GET_MEMSEG, VMMDEV_IOCTL_SLOCK_MEMSEGS), VMMDEV_IOCTL(VM_MMAP_GETNEXT, VMMDEV_IOCTL_SLOCK_MEMSEGS), @@ -489,13 +489,13 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, break; } #if defined(__amd64__) && defined(COMPAT_FREEBSD12) - case VM_ALLOC_MEMSEG_FBSD12: + case VM_ALLOC_MEMSEG_12: error = alloc_memseg(sc, (struct vm_memseg *)data, - sizeof(((struct vm_memseg_fbsd12 *)0)->name)); + sizeof(((struct vm_memseg_12 *)0)->name)); break; - case VM_GET_MEMSEG_FBSD12: + case VM_GET_MEMSEG_12: error = get_memseg(sc, (struct vm_memseg *)data, - sizeof(((struct vm_memseg_fbsd12 *)0)->name)); + sizeof(((struct vm_memseg_12 *)0)->name)); break; #endif case VM_ALLOC_MEMSEG: