Skip to contentSkip to conversation

Regression in OSSTest Windows install test case

DISCUSSION Wei Liu 4 participants 14 messages Jul 15, 2015 – Jul 16, 2015

lore
Share & tools
lore

Wei Liu

author Reviewed-by Andrew Cooper
#0 lore raw

Hi all

The Windows install test case has been failing reliably in OSSTest for the last 6 runs.

The issue manifest as Windows hit blue screen with garbled text that cannot be recognised when booting. Xen doesn't complain about any failures.

I bisected that and found this commit is to be blamed.

commit 3bbaaec09b1b942f5624dee176da6e416d31f982

Author: Paul Durrant <[email protected]>
Date:   Thu Jul 9 19:04:00 2015 +0200

x86/hvm: unify stdvga mmio intercept with standard mmio intercept

It's clear from the following check in hvmemul_rep_movs:

if ( sp2mt == p2m_mmio_direct || dp2mt == p2m_mmio_direct ||
(sp2mt == p2m_mmio_dm && dp2mt == p2m_mmio_dm) )
return X86EMUL_UNHANDLEABLE;

that mmio <-> mmio copy is not handled. This means the code in the stdvga mmio intercept that explicitly handles mmio <-> mmio copy when hvm_copy_to/from_guest_phys() fails is never going to be executed.

This patch therefore adds a check in hvmemul_do_io_addr() to make sure mmio <-> mmio is disallowed and then registers standard mmio intercept ops in stdvga_init().

With this patch all mmio and portio handled within Xen now goes through process_io_intercept().

Tell me if you need more information or want me to test a patch. I do have test environment at hand.

Wei.

#1 lore raw
Quoted 31 lines · Wei Liu

Hi all

The Windows install test case has been failing reliably in OSSTest for the last 6 runs.

The issue manifest as Windows hit blue screen with garbled text that cannot be recognised when booting. Xen doesn't complain about any failures.

I bisected that and found this commit is to be blamed.

commit 3bbaaec09b1b942f5624dee176da6e416d31f982

Author: Paul Durrant <[email protected]>
Date:   Thu Jul 9 19:04:00 2015 +0200

x86/hvm: unify stdvga mmio intercept with standard mmio intercept

It's clear from the following check in hvmemul_rep_movs:

if ( sp2mt == p2m_mmio_direct || dp2mt == p2m_mmio_direct ||
(sp2mt == p2m_mmio_dm && dp2mt == p2m_mmio_dm) )
return X86EMUL_UNHANDLEABLE;

that mmio <-> mmio copy is not handled. This means the code in the stdvga mmio intercept that explicitly handles mmio <-> mmio copy when hvm_copy_to/from_guest_phys() fails is never going to be executed.

This patch therefore adds a check in hvmemul_do_io_addr() to make sure mmio <-> mmio is disallowed and then registers standard mmio intercept ops in stdvga_init().

Quoted 8 lines

With this patch all mmio and portio handled within Xen now goes through process_io_intercept().

Tell me if you need more information or want me to test a patch. I do have test environment at hand.

Given the nature of the patch, I would not be unduly surprised that the text is garbled.

Which windows and qemu are you using? We have not encountered a single failure like this in XenServer testing.

~Andrew

author
#2 lore raw
Quoted 38 lines · Andrew Cooper
Quoted 37 lines · Wei Liu

Hi all

The Windows install test case has been failing reliably in OSSTest for the last 6 runs.

The issue manifest as Windows hit blue screen with garbled text that cannot be recognised when booting. Xen doesn't complain about any failures.

I bisected that and found this commit is to be blamed.

commit 3bbaaec09b1b942f5624dee176da6e416d31f982

Author: Paul Durrant <[email protected]>
Date:   Thu Jul 9 19:04:00 2015 +0200

x86/hvm: unify stdvga mmio intercept with standard mmio intercept

It's clear from the following check in hvmemul_rep_movs:

if ( sp2mt == p2m_mmio_direct || dp2mt == p2m_mmio_direct ||
(sp2mt == p2m_mmio_dm && dp2mt == p2m_mmio_dm) )
return X86EMUL_UNHANDLEABLE;

that mmio <-> mmio copy is not handled. This means the code in the stdvga mmio intercept that explicitly handles mmio <-> mmio copy when hvm_copy_to/from_guest_phys() fails is never going to be executed.

This patch therefore adds a check in hvmemul_do_io_addr() to make sure mmio <-> mmio is disallowed and then registers standard mmio intercept ops in stdvga_init().

With this patch all mmio and portio handled within Xen now goes through process_io_intercept().

Quoted 9 lines
Quoted 2 lines

Tell me if you need more information or want me to test a patch. I do have test environment at hand.

Given the nature of the patch, I would not be unduly surprised that the text is garbled.

Which windows and qemu are you using? We have not encountered a single failure like this in XenServer testing.

win7-x64.iso from OSSTest.

QEMU emulator version 2.2.1, Copyright (c) 2003-2008 Fabrice Bellard

Quoted 1 line

~Andrew

#3 lore raw
Quoted 56 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 15 July 2015 15:46
To: Andrew Cooper
Cc: Wei Liu; [email protected]; Jan Beulich; Paul Durrant
Subject: Re: Regression in OSSTest Windows install test case

Quoted 18 lines · Andrew Cooper
Quoted 17 lines · Wei Liu

Hi all

The Windows install test case has been failing reliably in OSSTest for the last 6 runs.

The issue manifest as Windows hit blue screen with garbled text that cannot be recognised when booting. Xen doesn't complain about any failures.

I bisected that and found this commit is to be blamed.

commit 3bbaaec09b1b942f5624dee176da6e416d31f982

Author: Paul Durrant <[email protected]>
Date:   Thu Jul 9 19:04:00 2015 +0200

x86/hvm: unify stdvga mmio intercept with standard mmio intercept

Quoted 8 lines
Quoted 8 lines
    It's clear from the following check in hvmemul_rep_movs:

        if ( sp2mt == p2m_mmio_direct || dp2mt == p2m_mmio_direct ||
             (sp2mt == p2m_mmio_dm && dp2mt == p2m_mmio_dm) )
            return X86EMUL_UNHANDLEABLE;

    that mmio <-> mmio copy is not handled. This means the code in the
    stdvga mmio intercept that explicitly handles mmio <-> mmio copy

when

Quoted 3 lines
Quoted 3 lines

hvm_copy_to/from_guest_phys() fails is never going to be executed.

This patch therefore adds a check in hvmemul_do_io_addr() to make

sure

Quoted 1 line
Quoted 1 line
    mmio <-> mmio is disallowed and then registers standard mmio

intercept ops

Quoted 3 lines
Quoted 3 lines

in stdvga_init().

With this patch all mmio and portio handled within Xen now goes

through

Quoted 11 lines
Quoted 7 lines

process_io_intercept().

Tell me if you need more information or want me to test a patch. I do have test environment at hand.

Given the nature of the patch, I would not be unduly surprised that the text is garbled.

Quoted 9 lines
Quoted 1 line

Which windows and qemu are you using? We have not encountered a

single

Quoted 2 lines

failure like this in XenServer testing.

win7-x64.iso from OSSTest.

QEMU emulator version 2.2.1, Copyright (c) 2003-2008 Fabrice Bellard

Ok, could be a bad interaction with upstream QEMU then. I'll try to repro. Most of my dev testing was done with win7 32 bit and upstream QEMU though.

Paul

Quoted 2 lines
Quoted 2 lines

~Andrew

#4 lore raw
In reply to Wei Liu
Quoted 56 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 15 July 2015 15:46
To: Andrew Cooper
Cc: Wei Liu; [email protected]; Jan Beulich; Paul Durrant
Subject: Re: Regression in OSSTest Windows install test case

Quoted 18 lines · Andrew Cooper
Quoted 17 lines · Wei Liu

Hi all

The Windows install test case has been failing reliably in OSSTest for the last 6 runs.

The issue manifest as Windows hit blue screen with garbled text that cannot be recognised when booting. Xen doesn't complain about any failures.

I bisected that and found this commit is to be blamed.

commit 3bbaaec09b1b942f5624dee176da6e416d31f982

Author: Paul Durrant <[email protected]>
Date:   Thu Jul 9 19:04:00 2015 +0200

x86/hvm: unify stdvga mmio intercept with standard mmio intercept

Quoted 8 lines
Quoted 8 lines
    It's clear from the following check in hvmemul_rep_movs:

        if ( sp2mt == p2m_mmio_direct || dp2mt == p2m_mmio_direct ||
             (sp2mt == p2m_mmio_dm && dp2mt == p2m_mmio_dm) )
            return X86EMUL_UNHANDLEABLE;

    that mmio <-> mmio copy is not handled. This means the code in the
    stdvga mmio intercept that explicitly handles mmio <-> mmio copy

when

Quoted 3 lines
Quoted 3 lines

hvm_copy_to/from_guest_phys() fails is never going to be executed.

This patch therefore adds a check in hvmemul_do_io_addr() to make

sure

Quoted 1 line
Quoted 1 line
    mmio <-> mmio is disallowed and then registers standard mmio

intercept ops

Quoted 3 lines
Quoted 3 lines

in stdvga_init().

With this patch all mmio and portio handled within Xen now goes

through

Quoted 11 lines
Quoted 7 lines

process_io_intercept().

Tell me if you need more information or want me to test a patch. I do have test environment at hand.

Given the nature of the patch, I would not be unduly surprised that the text is garbled.

Quoted 9 lines
Quoted 1 line

Which windows and qemu are you using? We have not encountered a

single

Quoted 2 lines

failure like this in XenServer testing.

win7-x64.iso from OSSTest.

QEMU emulator version 2.2.1, Copyright (c) 2003-2008 Fabrice Bellard

BTW, does the xl cfg specify cirrus or stdvga?

Paul

Quoted 2 lines
Quoted 2 lines

~Andrew

author
#5 lore raw
Quoted 61 lines · Paul Durrant
Quoted 61 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 15 July 2015 15:46
To: Andrew Cooper
Cc: Wei Liu; [email protected]; Jan Beulich; Paul Durrant
Subject: Re: Regression in OSSTest Windows install test case

Quoted 18 lines · Andrew Cooper
Quoted 17 lines · Wei Liu

Hi all

The Windows install test case has been failing reliably in OSSTest for the last 6 runs.

The issue manifest as Windows hit blue screen with garbled text that cannot be recognised when booting. Xen doesn't complain about any failures.

I bisected that and found this commit is to be blamed.

commit 3bbaaec09b1b942f5624dee176da6e416d31f982

Author: Paul Durrant <[email protected]>
Date:   Thu Jul 9 19:04:00 2015 +0200

x86/hvm: unify stdvga mmio intercept with standard mmio intercept

Quoted 8 lines
Quoted 8 lines
    It's clear from the following check in hvmemul_rep_movs:

        if ( sp2mt == p2m_mmio_direct || dp2mt == p2m_mmio_direct ||
             (sp2mt == p2m_mmio_dm && dp2mt == p2m_mmio_dm) )
            return X86EMUL_UNHANDLEABLE;

    that mmio <-> mmio copy is not handled. This means the code in the
    stdvga mmio intercept that explicitly handles mmio <-> mmio copy

when

Quoted 3 lines
Quoted 3 lines

hvm_copy_to/from_guest_phys() fails is never going to be executed.

This patch therefore adds a check in hvmemul_do_io_addr() to make

sure

Quoted 1 line
Quoted 1 line
    mmio <-> mmio is disallowed and then registers standard mmio

intercept ops

Quoted 3 lines
Quoted 3 lines

in stdvga_init().

With this patch all mmio and portio handled within Xen now goes

through

Quoted 5 lines
Quoted 5 lines

process_io_intercept().

Quoted 7 lines
Quoted 2 lines

Tell me if you need more information or want me to test a patch. I do have test environment at hand.

Given the nature of the patch, I would not be unduly surprised that the text is garbled.

Which windows and qemu are you using? We have not encountered a

single

Quoted 2 lines

failure like this in XenServer testing.

Quoted 8 lines
Quoted 4 lines

win7-x64.iso from OSSTest.

QEMU emulator version 2.2.1, Copyright (c) 2003-2008 Fabrice Bellard

BTW, does the xl cfg specify cirrus or stdvga?

Paul

Here is the config I use (slightly modified from the one in OSSTest). No setting with regard to video card, so it should be the cirrus.

---
name = 'win'
memory = 512
vif = [ 'type=ioemu,mac=5a:36:0e:98:50:33' ]
#
on_poweroff = 'destroy'
on_reboot = 'preserve'
on_crash = 'preserve'
#
vcpus = 2
#
kernel = 'hvmloader'
builder = 'hvm'
#
disk = [

                'phy:/dev/DATA/win,hda,w',              
'file:/data/win7-x64.iso,hdc:cdrom,r'
              ]

#
usb=1
usbdevice='tablet'
#
#stdvga=1
keymap='en-gb';
#
sdl=0
opengl=0
vnc=1
vncunused=1
vncdisplay=0
vnclisten='0.0.0.0'

#
#boot = 'dc'
boot = 'c'
device_model_version='qemu-xen'
serial='file:/dev/stderr'

#
viridian=1

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

~Andrew

#6 lore raw
Quoted 81 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 15 July 2015 15:54
To: Paul Durrant
Cc: Wei Liu; Andrew Cooper; [email protected]; Jan Beulich
Subject: Re: Regression in OSSTest Windows install test case

Quoted 18 lines · Paul Durrant
Quoted 18 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 15 July 2015 15:46
To: Andrew Cooper
Cc: Wei Liu; [email protected]; Jan Beulich; Paul Durrant
Subject: Re: Regression in OSSTest Windows install test case

Quoted 10 lines · Andrew Cooper
Quoted 9 lines · Wei Liu

Hi all

The Windows install test case has been failing reliably in OSSTest for the last 6 runs.

The issue manifest as Windows hit blue screen with garbled text that cannot be recognised when booting. Xen doesn't complain about any failures.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

I bisected that and found this commit is to be blamed.

commit 3bbaaec09b1b942f5624dee176da6e416d31f982

Author: Paul Durrant <[email protected]>
Date:   Thu Jul 9 19:04:00 2015 +0200

x86/hvm: unify stdvga mmio intercept with standard mmio

intercept

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

It's clear from the following check in hvmemul_rep_movs:

if ( sp2mt == p2m_mmio_direct || dp2mt == p2m_mmio_direct

||
> > > >              (sp2mt == p2m_mmio_dm && dp2mt == p2m_mmio_dm) )
> > > >             return X86EMUL_UNHANDLEABLE;
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
    that mmio <-> mmio copy is not handled. This means the code in

the

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
    stdvga mmio intercept that explicitly handles mmio <-> mmio copy

when

Quoted 1 line
Quoted 1 line

hvm_copy_to/from_guest_phys() fails is never going to be

executed.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

This patch therefore adds a check in hvmemul_do_io_addr() to

make

Quoted 30 lines
Quoted 18 lines

sure

Quoted 1 line
Quoted 1 line
    mmio <-> mmio is disallowed and then registers standard mmio

intercept ops

Quoted 3 lines
Quoted 3 lines

in stdvga_init().

With this patch all mmio and portio handled within Xen now goes

through

Quoted 11 lines
Quoted 7 lines

process_io_intercept().

Tell me if you need more information or want me to test a patch. I do have test environment at hand.

Given the nature of the patch, I would not be unduly surprised that the text is garbled.

Quoted 9 lines
Quoted 1 line

Which windows and qemu are you using? We have not encountered a

single

Quoted 2 lines

failure like this in XenServer testing.

win7-x64.iso from OSSTest.

QEMU emulator version 2.2.1, Copyright (c) 2003-2008 Fabrice Bellard

BTW, does the xl cfg specify cirrus or stdvga?

Quoted 8 lines
Quoted 1 line

Paul

Here is the config I use (slightly modified from the one in OSSTest). No setting with regard to video card, so it should be the cirrus.

---
name = 'win'
memory = 512

^^^^ Wow. That's ambitious for Windows 7!

Paul

Quoted 42 lines

vif = [ 'type=ioemu,mac=5a:36:0e:98:50:33' ]
#
on_poweroff = 'destroy'
on_reboot = 'preserve'
on_crash = 'preserve'
#
vcpus = 2
#
kernel = 'hvmloader'
builder = 'hvm'
#
disk = [

                'phy:/dev/DATA/win,hda,w',
'file:/data/win7-x64.iso,hdc:cdrom,r'
              ]

#
usb=1
usbdevice='tablet'
#
#stdvga=1
keymap='en-gb';
#
sdl=0
opengl=0
vnc=1
vncunused=1
vncdisplay=0
vnclisten='0.0.0.0'

#
#boot = 'dc'
boot = 'c'
device_model_version='qemu-xen'
serial='file:/dev/stderr'

#
viridian=1

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

~Andrew

author
#7 lore raw

On Wed, Jul 15, 2015 at 03:55:24PM +0100, Paul Durrant wrote:
[...]

Quoted 9 lines
Quoted 6 lines

Here is the config I use (slightly modified from the one in OSSTest). No setting with regard to video card, so it should be the cirrus.

---
name = 'win'
memory = 512

^^^^ Wow. That's ambitious for Windows 7!

I notice that too. But the installation seems to finish in a reasonable time. :-P

Wei.

#8 lore raw

Il 15/07/2015 16:57, Wei Liu ha scritto:

Quoted 4 lines · Paul Durrant

[...]

Quoted 2 lines
Quoted 2 lines

Here is the config I use (slightly modified from the one in OSSTest). No setting with regard to video card, so it should be the cirrus.

Cirrus driver is not available for windows 7, support of it is near abandonment in upstream if I remember good what I read one year ago (or more) in qemu-devel, is better use stdvga instead in windows >=vista. A had also strange graphic and performance problem with cirrus on windows 7 2-3 years ago, since then I have not set the cirrus on vm windows 7.
Try to vga="stdvga"

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

---
name = 'win'
memory = 512

^^^^ Wow. That's ambitious for Windows 7!

I notice that too. But the installation seems to finish in a reasonable time. :-P

Years ago on my tests system with few ram I tried to decrease ram as possible but I saw that with windows 7 (even if 32 bit) with < 1 gb made occasional problems that wasted my tests.
About performance for run tests (after windows install even if basic) 2 gb of ram at least is needed for don't waste large amount of time on massive numbers of tests.
I saw many occasional windows tests fail on "[Xen-devel] [xen-unstable test] ....: regressions - FAIL" that I was unable to reproduce doing same tests (windows install, shutdown, save/restore) and that blocked push for days even if I not saw "real bug/regression" was found. If these are only caused by "bad" xl cfg values rare to find on real users domUs I think is bad and should be improved.

Quoted 7 lines

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#9 lore raw
In reply to Wei Liu
Quoted 39 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 15 July 2015 15:40
To: [email protected]
Cc: Wei Liu; Jan Beulich; Andrew Cooper; Paul Durrant
Subject: Regression in OSSTest Windows install test case

Hi all

The Windows install test case has been failing reliably in OSSTest for the last 6 runs.

The issue manifest as Windows hit blue screen with garbled text that cannot be recognised when booting. Xen doesn't complain about any failures.

I bisected that and found this commit is to be blamed.

commit 3bbaaec09b1b942f5624dee176da6e416d31f982

Author: Paul Durrant <[email protected]>
Date:   Thu Jul 9 19:04:00 2015 +0200
    x86/hvm: unify stdvga mmio intercept with standard mmio intercept

    It's clear from the following check in hvmemul_rep_movs:

        if ( sp2mt == p2m_mmio_direct || dp2mt == p2m_mmio_direct ||
             (sp2mt == p2m_mmio_dm && dp2mt == p2m_mmio_dm) )
            return X86EMUL_UNHANDLEABLE;

    that mmio <-> mmio copy is not handled. This means the code in the
    stdvga mmio intercept that explicitly handles mmio <-> mmio copy when
    hvm_copy_to/from_guest_phys() fails is never going to be executed.

    This patch therefore adds a check in hvmemul_do_io_addr() to make sure
    mmio <-> mmio is disallowed and then registers standard mmio intercept

ops
in stdvga_init().

Quoted 9 lines

With this patch all mmio and portio handled within Xen now goes through process_io_intercept().

Tell me if you need more information or want me to test a patch. I do have test environment at hand.

I think I found the semantic difference. Prior to this patch it would seem that stdvga buffered writes even when not in stdvga mode. When I tested your config (using cirrus), windows drops out of stdvga quite early in boot which slows down the splash screen to a crawl. When I just uncommented the single line 'stdvga=1' then I got through the splash screen several orders of magnitude faster. So, I think this (compile tested only) incremental patch should fix the test:

xen/arch/x86/hvm/stdvga.c +2 -5
index 6d22b22..d528155 100644
@@ -441,7 +441,7 @@ static int stdvga_mem_write(const struct hvm_io_handler *han
     };
     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
 
     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
 
         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 */

I can't say that I like the idea of unconditionally buffering VRAM writes, but I'll test patch and post it.

Paul

Quoted 1 line

Wei.

author Tested-by
#10 lore raw

On Thu, Jul 16, 2015 at 09:39:42AM +0100, Paul Durrant wrote:
[...]

Quoted 36 lines

I think I found the semantic difference. Prior to this patch it would seem that stdvga buffered writes even when not in stdvga mode. When I tested your config (using cirrus), windows drops out of stdvga quite early in boot which slows down the splash screen to a crawl. When I just uncommented the single line 'stdvga=1' then I got through the splash screen several orders of magnitude faster. So, I think this (compile tested only) incremental patch should fix the test:

xen/arch/x86/hvm/stdvga.c +2 -5
index 6d22b22..d528155 100644
@@ -441,7 +441,7 @@ static int stdvga_mem_write(const struct hvm_io_handler *han
     };
     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
 
     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
 
         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 */
Quoted 2 lines

I can't say that I like the idea of unconditionally buffering VRAM writes, but I'll test patch and post it.

Thank you for the fix. It fixes the problem for me.

Quoted 7 lines

Paul

Quoted 1 line

Wei.

#11 lore raw
Quoted 51 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 16 July 2015 10:03
To: Paul Durrant
Cc: Wei Liu; [email protected]; Jan Beulich; Andrew Cooper
Subject: Re: Regression in OSSTest Windows install test case

On Thu, Jul 16, 2015 at 09:39:42AM +0100, Paul Durrant wrote:
[...]

Quoted 1 line

I think I found the semantic difference. Prior to this patch it would seem

that stdvga buffered writes even when not in stdvga mode. When I tested your config (using cirrus), windows drops out of stdvga quite early in boot which slows down the splash screen to a crawl. When I just uncommented the single line 'stdvga=1' then I got through the splash screen several orders of magnitude faster.

xen/arch/x86/hvm/stdvga.c static int stdvga_mem_write(const struct

Quoted 7 lines

So, I think this (compile tested only) incremental patch should fix the test:

xen/arch/x86/hvm/stdvga.c +0 -0
index 6d22b22..d528155 100644
@@ -441,7 +441,7 @@ static int stdvga_mem_write(const struct

hvm_io_handler *han

xen/arch/x86/hvm/stdvga.c static bool_t stdvga_mem_accept(const struct

Quoted 9 lines
xen/arch/x86/hvm/stdvga.c +1 -1
     };
     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

xen/arch/x86/hvm/stdvga.c static bool_t stdvga_mem_accept(const struct

Quoted 10 lines
xen/arch/x86/hvm/stdvga.c +0 -3
     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

Quoted 7 lines
xen/arch/x86/hvm/stdvga.c +1 -1
         goto reject;
     }
-    else if ( p->dir == IOREQ_READ && !s->cache )
+    else if ( p->dir == IOREQ_READ && !s->cache && !s->stdvga )
         goto reject;
 
Quoted 7 lines
Quoted 3 lines
xen/arch/x86/hvm/stdvga.c +0 -0
     /* s->lock intentionally held */
 

I can't say that I like the idea of unconditionally buffering VRAM writes, but

I'll test patch and post it.

Quoted 1 line

Thank you for the fix. It fixes the problem for me.

Cool. There's actually a small bug-ette in it. The line:

else if ( p->dir == IOREQ_READ && !s->cache && !s->stdvga )

should be:

else if ( p->dir == IOREQ_READ && (!s->cache || !s->stdvga) )

I don't think that will affect the behaviour in this case though since I very much doubt Windows is reading VRAM at this stage. Could you perhaps re-test with that change?

Cheers,

Paul

Quoted 10 lines
Quoted 7 lines

Paul

Quoted 1 line

Wei.

author Tested-by
#12 lore raw
Quoted 61 lines · Paul Durrant
Quoted 51 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 16 July 2015 10:03
To: Paul Durrant
Cc: Wei Liu; [email protected]; Jan Beulich; Andrew Cooper
Subject: Re: Regression in OSSTest Windows install test case

On Thu, Jul 16, 2015 at 09:39:42AM +0100, Paul Durrant wrote:
[...]

Quoted 1 line

I think I found the semantic difference. Prior to this patch it would seem

that stdvga buffered writes even when not in stdvga mode. When I tested your config (using cirrus), windows drops out of stdvga quite early in boot which slows down the splash screen to a crawl. When I just uncommented the single line 'stdvga=1' then I got through the splash screen several orders of magnitude faster.

xen/arch/x86/hvm/stdvga.c static int stdvga_mem_write(const struct

Quoted 7 lines

So, I think this (compile tested only) incremental patch should fix the test:

xen/arch/x86/hvm/stdvga.c +0 -0
index 6d22b22..d528155 100644
@@ -441,7 +441,7 @@ static int stdvga_mem_write(const struct

hvm_io_handler *han

xen/arch/x86/hvm/stdvga.c static bool_t stdvga_mem_accept(const struct

Quoted 9 lines
xen/arch/x86/hvm/stdvga.c +1 -1
     };
     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

xen/arch/x86/hvm/stdvga.c static bool_t stdvga_mem_accept(const struct

Quoted 10 lines
xen/arch/x86/hvm/stdvga.c +0 -3
     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

Quoted 7 lines
xen/arch/x86/hvm/stdvga.c +1 -1
         goto reject;
     }
-    else if ( p->dir == IOREQ_READ && !s->cache )
+    else if ( p->dir == IOREQ_READ && !s->cache && !s->stdvga )
         goto reject;
 
Quoted 7 lines
Quoted 3 lines
xen/arch/x86/hvm/stdvga.c +0 -0
     /* s->lock intentionally held */
 

I can't say that I like the idea of unconditionally buffering VRAM writes, but

I'll test patch and post it.

Quoted 1 line

Thank you for the fix. It fixes the problem for me.

Cool. There's actually a small bug-ette in it. The line:

Quoted 8 lines

else if ( p->dir == IOREQ_READ && !s->cache && !s->stdvga )

should be:

else if ( p->dir == IOREQ_READ && (!s->cache || !s->stdvga) )

I don't think that will affect the behaviour in this case though since I very much doubt Windows is reading VRAM at this stage. Could you perhaps re-test with that change?

It works. So again:

Quoted 14 lines

Cheers,

Paul

Quoted 10 lines
Quoted 7 lines

Paul

Quoted 1 line

Wei.

#13 lore raw
Quoted 80 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 16 July 2015 10:12
To: Paul Durrant
Cc: Wei Liu; [email protected]; Jan Beulich; Andrew Cooper
Subject: Re: Regression in OSSTest Windows install test case

Quoted 11 lines · Paul Durrant
Quoted 11 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 16 July 2015 10:03
To: Paul Durrant
Cc: Wei Liu; [email protected]; Jan Beulich; Andrew Cooper
Subject: Re: Regression in OSSTest Windows install test case

On Thu, Jul 16, 2015 at 09:39:42AM +0100, Paul Durrant wrote:
[...]

Quoted 1 line

I think I found the semantic difference. Prior to this patch it would seem

that stdvga buffered writes even when not in stdvga mode. When I

tested

Quoted 2 lines
Quoted 2 lines

your config (using cirrus), windows drops out of stdvga quite early in boot which slows down the splash screen to a crawl. When I just

uncommented

Quoted 1 line
Quoted 1 line

the single line 'stdvga=1' then I got through the splash screen several

orders

Quoted 2 lines
Quoted 2 lines

of magnitude faster.

Quoted 1 line

So, I think this (compile tested only) incremental patch should fix the

test:

Quoted 35 lines
Quoted 35 lines

xen/arch/x86/hvm/stdvga.c static int stdvga_mem_write(const struct

Quoted 6 lines
xen/arch/x86/hvm/stdvga.c +0 -0
index 6d22b22..d528155 100644
@@ -441,7 +441,7 @@ static int stdvga_mem_write(const struct

hvm_io_handler *han

xen/arch/x86/hvm/stdvga.c static bool_t stdvga_mem_accept(const struct

Quoted 9 lines
xen/arch/x86/hvm/stdvga.c +1 -1
     };
     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

xen/arch/x86/hvm/stdvga.c static bool_t stdvga_mem_accept(const struct

Quoted 10 lines
xen/arch/x86/hvm/stdvga.c +0 -3
     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

Quoted 7 lines
xen/arch/x86/hvm/stdvga.c +1 -1
         goto reject;
     }
-    else if ( p->dir == IOREQ_READ && !s->cache )
+    else if ( p->dir == IOREQ_READ && !s->cache && !s->stdvga )
         goto reject;
 
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
xen/arch/x86/hvm/stdvga.c +0 -0
     /* s->lock intentionally held */
 

I can't say that I like the idea of unconditionally buffering VRAM writes,

but

Quoted 13 lines
Quoted 4 lines

I'll test patch and post it.

Quoted 1 line

Thank you for the fix. It fixes the problem for me.

Cool. There's actually a small bug-ette in it. The line:

else if ( p->dir == IOREQ_READ && !s->cache && !s->stdvga )

should be:

else if ( p->dir == IOREQ_READ && (!s->cache || !s->stdvga) )

Quoted 8 lines
Quoted 1 line

I don't think that will affect the behaviour in this case though since I very

much doubt Windows is reading VRAM at this stage. Could you perhaps re- test with that change?

Quoted 1 line

It works. So again:

Excellent. Thanks,

Paul

Quoted 15 lines
Quoted 15 lines

Cheers,

Paul

Quoted 10 lines
Quoted 7 lines

Paul

Quoted 1 line

Wei.