From: Paul Durrant Subject: [PATCH (for 4.6)] x86/hvm: Unconditionally buffer writes to VRAM Date: Thu, 16 Jul 2015 10:24:35 +0100 Message-ID: <1437038675-14095-1-git-send-email-paul.durrant@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZFfPF-0001gC-SA for xen-devel@lists.xenproject.org; Thu, 16 Jul 2015 09:24:41 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Paul Durrant , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org When c/s 3bbaaec09 "unify stdvga mmio intercept with standard mmio intercept" was added, a small semantic change was made. Prior to this patch the hypervisor unconditionally sent all guest writes to the VGA aperture as buffered ioreqs, whereas after the patch it only does this when the VGA model is in 'stdvga' mode (sequencer register #7 == 0). When installing Windows 7 (64-bit) using the default QEMU VGA model (== cirrus), Windows leaves 'stdvga' mode early in boot and hence all further writes to the VGA aperture are done using synchronous ioreqs which slows down boot by several orders of magnitude (thanks to the elaborate splash screen that Windows presents). This can be viewed as a regression and so this patch re-instates previous buffering behaviour. Signed-off-by: Paul Durrant Tested-by: Wei Liu Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/hvm/stdvga.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c index 6d22b22..f50bff7 100644 --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -441,7 +441,7 @@ static int stdvga_mem_write(const struct hvm_io_handler *handler, }; struct hvm_ioreq_server *srv; - if ( !s->cache ) + if ( !s->cache || !s->stdvga ) goto done; /* Intercept mmio write */ @@ -503,9 +503,6 @@ static bool_t stdvga_mem_accept(const struct hvm_io_handler *handler, spin_lock(&s->lock); - if ( !s->stdvga ) - goto reject; - if ( p->dir == IOREQ_WRITE && p->count > 1 ) { /* @@ -526,7 +523,7 @@ static bool_t stdvga_mem_accept(const struct hvm_io_handler *handler, goto reject; } - else if ( p->dir == IOREQ_READ && !s->cache ) + else if ( p->dir == IOREQ_READ && (!s->cache || !s->stdvga) ) goto reject; /* s->lock intentionally held */ -- 1.7.10.4