On Wed, Jun 05, 2019 at 11:00:55PM +0300, Eugene Korenevsky wrote: > There is an imperfection in get_vmx_mem_address(): access length is ignored > when checking the limit. To fix this, pass access length as a function argument. > The access length is obvious since it is used by callers after > get_vmx_mem_address() call. > > Note: both handle_vmread() and handle_vmwrite() should use is_long_mode() > instead of is_64_bit_mode() because VMREAD/VMWRITE opcodes are invalid in > compatibility mode and there is no any reason for extra checking CS.L. > > Signed-off-by: Eugene Korenevsky <ekorenevsky@xxxxxxxxx> > --- > Changes in v2 since v1: fixed logical bug (`len` argument was not used inside > get_vmx_mem_address() function); fixed the subject > Changes in v3 since v2: replace is_64_bit_mode() with is_long_mode() in > handle_vmwrite() Replacing is_64_bit_mode() with is_long_mode() in various functions should be done as a preqreq patch, if only to explain in the changelog that VMX instructions #UD in compatibility mode.