From: Alex Williamson Date: Mon, 10 Dec 2012 17:32:45 +0000 (-0700) Subject: KVM: Restrict non-existing slot state transitions X-Git-Tag: v3.9-rc1~97^2~102 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0736cf0550b349a5d5a374d65ca0488cc2eee40;p=pandora-kernel.git KVM: Restrict non-existing slot state transitions The API documentation states: When changing an existing slot, it may be moved in the guest physical memory space, or its flags may be modified. An "existing slot" requires a non-zero npages (memory_size). The only transition we should therefore allow for a non-existing slot should be to create the slot, which includes setting a non-zero memory_size. We currently allow calls to modify non-existing slots, which is pointless, confusing, and possibly wrong. With this we know that the invalidation path of __kvm_set_memory_region is always for a delete or move and never for adding a zero size slot. Reviewed-by: Gleb Natapov Signed-off-by: Alex Williamson Signed-off-by: Marcelo Tosatti --- Reading git-diff-tree failed