On Tue, Nov 13, 2018 at 01:12:03AM -0500, Krish Sadhukhan wrote: > According to Intel SDM vol 3C, VMCS data is of six different types. But the > single function check_vmentry_prereqs currently holds all the different types > of checks related to those six types of VMCS data. This patch series > re-organizes the checks in that function into six different sub-functions > based on the VMCS data organization. The re-organized code is easier for > readability, enhancement and maintenance. I like the idea, but I think it'd be better to follow the SDM's section for the actual checks (26.1 - 26.3 in my copy) rather than the section that defines the VMCS fields. Many of the consistency checks involve fields of multiple types, e.g. a lot of the checks on host/guest state interact with control settings. Following the SDM means we don't have to make judgment calls on where to put such checks. This also avoids the issue of identifying which checks do/don't result in VMExit as the the SDM explicitly calls out in "Checking and Loading Guest State" that the subsequent checks cause VMExit. And cross-checking our code with SDM should be even easier if we follow the SDM's ordering.