diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-06-06 12:57:05 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-09-27 13:45:37 +0200 |
commit | 8b306e2f3c41939ea528e6174c88cfbfff893ce1 (patch) | |
tree | c3e6a123b243333b309771bd4db3a60d90e1f26b /arch/x86/ia32/Makefile | |
parent | cd39e1176d320157831ce030b4c869bd2d5eb142 (diff) | |
download | linux-8b306e2f3c41939ea528e6174c88cfbfff893ce1.tar.bz2 |
KVM: VMX: avoid double list add with VT-d posted interrupts
In some cases, for example involving hot-unplug of assigned
devices, pi_post_block can forget to remove the vCPU from the
blocked_vcpu_list. When this happens, the next call to
pi_pre_block corrupts the list.
Fix this in two ways. First, check vcpu->pre_pcpu in pi_pre_block
and WARN instead of adding the element twice in the list. Second,
always do the list removal in pi_post_block if vcpu->pre_pcpu is
set (not -1).
The new code keeps interrupts disabled for the whole duration of
pi_pre_block/pi_post_block. This is not strictly necessary, but
easier to follow. For the same reason, PI.ON is checked only
after the cmpxchg, and to handle it we just call the post-block
code. This removes duplication of the list removal code.
Cc: Huangweidong <weidong.huang@huawei.com>
Cc: Gonglei <arei.gonglei@huawei.com>
Cc: wangxin <wangxinxin.wang@huawei.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Tested-by: Longpeng (Mike) <longpeng2@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/ia32/Makefile')
0 files changed, 0 insertions, 0 deletions