]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nSVM: introduce struct vmcb_ctrl_area_cached
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Wed, 3 Nov 2021 14:05:26 +0000 (10:05 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Dec 2021 09:24:40 +0000 (04:24 -0500)
commit9a500c4348e4f4311c71e5158e00e571ed71af24
tree22beff4b47b8dffa0a9a300d3cb7fcac66b1cecd
parentebed6d2c9a200a0bd1d0c5d81a5a2832a9674447
KVM: nSVM: introduce struct vmcb_ctrl_area_cached

This structure will replace vmcb_control_area in
svm_nested_state, providing only the fields that are actually
used by the nested state. This avoids having and copying around
uninitialized fields. The cost of this, however, is that all
functions (in this case vmcb_is_intercept) expect the old
structure, so they need to be duplicated.

In addition, in svm_get_nested_state() user space expects a
vmcb_control_area struct, so we need to copy back all fields
in a temporary structure before copying it to userspace.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20211103140527.752797-7-eesposit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/nested.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h