Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106930578
D37170.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
D37170.diff
View Options
diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c
--- a/sys/amd64/vmm/io/vlapic.c
+++ b/sys/amd64/vmm/io/vlapic.c
@@ -905,7 +905,7 @@
}
}
-static VMM_STAT_ARRAY(IPIS_SENT, VM_MAXCPU, "ipis sent to vcpu");
+static VMM_STAT_ARRAY(IPIS_SENT, VMM_STAT_NELEMS_VCPU, "ipis sent to vcpu");
static void
vlapic_set_tpr(struct vlapic *vlapic, uint8_t val)
diff --git a/sys/amd64/vmm/vmm_stat.h b/sys/amd64/vmm/vmm_stat.h
--- a/sys/amd64/vmm/vmm_stat.h
+++ b/sys/amd64/vmm/vmm_stat.h
@@ -58,6 +58,8 @@
void vmm_stat_register(void *arg);
+#define VMM_STAT_NELEMS_VCPU (-1)
+
#define VMM_STAT_FDEFINE(type, nelems, desc, func, scope) \
struct vmm_stat_type type[1] = { \
{ -1, nelems, desc, func, scope } \
diff --git a/sys/amd64/vmm/vmm_stat.c b/sys/amd64/vmm/vmm_stat.c
--- a/sys/amd64/vmm/vmm_stat.c
+++ b/sys/amd64/vmm/vmm_stat.c
@@ -70,6 +70,9 @@
if (vst->scope == VMM_STAT_SCOPE_AMD && !vmm_is_svm())
return;
+ if (vst->nelems == VMM_STAT_NELEMS_VCPU)
+ vst->nelems = VM_MAXCPU;
+
if (vst_num_elems + vst->nelems >= MAX_VMM_STAT_ELEMS) {
printf("Cannot accommodate vmm stat type \"%s\"!\n", vst->desc);
return;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 8, 3:42 PM (45 m, 26 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15723711
Default Alt Text
D37170.diff (1 KB)
Attached To
Mode
D37170: vmm stat: Add a special nelems constant for arrays sized by vCPU count.
Attached
Detach File
Event Timeline
Log In to Comment