Changeset View
Standalone View
sys/amd64/include/vmm.h
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | |||||
#define VM_INTINFO_RSVD 0x7ffff000 | #define VM_INTINFO_RSVD 0x7ffff000 | ||||
#define VM_INTINFO_VALID 0x80000000 | #define VM_INTINFO_VALID 0x80000000 | ||||
#define VM_INTINFO_TYPE 0x700 | #define VM_INTINFO_TYPE 0x700 | ||||
#define VM_INTINFO_HWINTR (0 << 8) | #define VM_INTINFO_HWINTR (0 << 8) | ||||
#define VM_INTINFO_NMI (2 << 8) | #define VM_INTINFO_NMI (2 << 8) | ||||
#define VM_INTINFO_HWEXCEPTION (3 << 8) | #define VM_INTINFO_HWEXCEPTION (3 << 8) | ||||
#define VM_INTINFO_SWINTR (4 << 8) | #define VM_INTINFO_SWINTR (4 << 8) | ||||
#ifdef _KERNEL | /* | ||||
* 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. | |||||
markj: Should this be "VM name" instead of "VM string"? | |||||
* 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_MIN_NAMELEN 6 | |||||
#define VM_MAX_NAMELEN \ | |||||
(SPECNAMELEN - VM_MAX_PREFIXLEN - VM_MAX_SUFFIXLEN - 1) | |||||
#define VM_MAX_NAMELEN 32 | #ifdef _KERNEL | ||||
jhbUnsubmitted Not Done Inline ActionsOne last nit. Can we keep as many of these constants under #ifdef _KERNEL to avoid leaking them into userland and ending up as part of the ABI? Maybe at least VM_MIN_NAMELEN and VM_MAX_NAMELEN could be under #ifdef _KERNEL still. Does anything use VM_MIN_NAMELEN btw? jhb: One last nit. Can we keep as many of these constants under #ifdef _KERNEL to avoid leaking… | |||||
scottlAuthorUnsubmitted Done Inline ActionsMIN is used by the CTASSERT below. I'm deliberately keeping them out of _KERNEL because the app should know the limitations on the lengths before passing them to the kernel. The only one that the app can't do much about is VM_MAX_PREFIXLEN, but separating out just that one has minimal value. scottl: MIN is used by the CTASSERT below. I'm deliberately keeping them out of _KERNEL because the… | |||||
jhbUnsubmitted Not Done Inline ActionsAre you planning on changing userland vs just letting it return the error from the ioctl / sysctl when it fails as it does today? If not, I think it's better to let the limit be set by the kernel and not really visible to the application as a constant. jhb: Are you planning on changing userland vs just letting it return the error from the ioctl /… | |||||
CTASSERT(VM_MAX_NAMELEN >= VM_MIN_NAMELEN); | |||||
struct vm; | struct vm; | ||||
struct vm_exception; | struct vm_exception; | ||||
struct seg_desc; | struct seg_desc; | ||||
struct vm_exit; | struct vm_exit; | ||||
struct vm_run; | struct vm_run; | ||||
struct vhpet; | struct vhpet; | ||||
struct vioapic; | struct vioapic; | ||||
▲ Show 20 Lines • Show All 575 Lines • Show Last 20 Lines |
Should this be "VM name" instead of "VM string"?