Re: [kvm PATCH v5 3/4] kvm: vmx: refactor vmx_msrs struct for vmalloc

Dave Hansen
2018-10-31T14:12:18Z

On 10/31/18 6:26 AM, Marc Orr wrote:
> +/*
> + * To prevent vmx_msr_entry array from crossing a page boundary, require:
> + * sizeof(*vmx_msrs.vmx_msr_entry.val) to be a power of two. This is guaranteed
> + * through compile-time asserts that:
> + * - NR_AUTOLOAD_MSRS * sizeof(struct vmx_msr_entry) is a power of two
> + * - NR_AUTOLOAD_MSRS * sizeof(struct vmx_msr_entry) <= PAGE_SIZE
> + * - The allocation of vmx_msrs.vmx_msr_entry.val is aligned to its size.
> + */

Why do we need to prevent them from crossing a page boundary?