]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commit
x86/hvm: make sure stdvga cache cannot be re-enabled
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 6 Nov 2015 14:17:00 +0000 (15:17 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 6 Nov 2015 14:17:00 +0000 (15:17 +0100)
commit22a1fbb575df3a3a7726cdeb5ddf19cc8f60827c
tree7c4de7950825382d763d26b7ba75914b960c0b83
parent897cc6d07acd3e66356f021c5f7f9a49ef061d5d
x86/hvm: make sure stdvga cache cannot be re-enabled

As soon as the cache is disabled, it will become out-of-sync with the
VGA device model and since no mechanism exists to acquire current VRAM
state from the device model, re-enabling it leads to stale data
being seen by the guest.

The problem was introduced by commit 3bbaaec0 ("x86/hvm: unify stdvga
mmio intercept with standard mmio intercept") and can be seen by
deliberately crashing a Windows guest; the BSOD output is corrupted.

This patch changes the existing 'cache' boolean in hvm_hw_stdvga into a
tri-state enum and only allows the state to move from 'uninitialized' to
'enabled'. Once the cache state becomes 'disabled' it will remain so for
the lifetime of the VM.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/save.c
xen/arch/x86/hvm/stdvga.c
xen/include/asm-x86/hvm/io.h