Currently the amd apic page and intel guest_msrs pages are stored as 2 dimension arrays inside a parent datastructure, one of these indexes is vCPU, by moving these to there own 1 dimension structure with the vCPU index left in the parent it facilitates future changes to malloc these data structures at run time.
Details
- Reviewers
tychon pmooney_pfmooney.com rgrimes - Group Reviewers
bhyve
Recompile vmm.ko and load guest with 16 vCPUs on both amd and intel hosts.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
sys/amd64/vmm/intel/vmx_msr.c | ||
---|---|---|
327 | My only thought would be to maybe change this to a 'struct vmx_msrs *' and then you would have: struct vmx_msrs *guest_msrs; guest_msrs = &vmx->guest_msrs[vcpuid]; and then guest_msrs[XXX] just becomes guest_msrs.reg[XXX]. |
sys/amd64/vmm/intel/vmx_msr.c | ||
---|---|---|
327 | I started on this, but that blows the patch up as every guest_msrs[] has to be changed in each function. The way I have it now it just touches the local pointer setup and leaves the other code lines alone. Do we really want to do this? |
sys/amd64/vmm/intel/vmx_msr.c | ||
---|---|---|
327 | As Patrick noted, it lets the compiler and static analyzers safely check the bounds on guest_msrs[] (which doesn't happen today, so that would be a bonus to do). While the patch is larger I do think it is clearer. |
Implemented as part of 0f00260c679f8d192f9d673fe4fb94b47a2ac6c5 and 215d2fd53f6c254cb900e1775abae86d3fdada65.