Patchwork [2/2] Make sure to enable dirty log tracking for VMware VGA

login
register
mail settings
Submitter Anthony Liguori
Date June 8, 2009, 9:48 p.m.
Message ID <1244497683-14391-2-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/28761/
State New, archived
Headers show

Comments

Anthony Liguori - June 8, 2009, 9:48 p.m.
This is needed for VMware VGA to work properly under KVM.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/vmware_vga.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Anthony Liguori - June 8, 2009, 9:53 p.m.
Anthony Liguori wrote:
> This is needed for VMware VGA to work properly under KVM.
>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> ---
>  hw/vmware_vga.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
> index bb17698..246011b 100644
> --- a/hw/vmware_vga.c
> +++ b/hw/vmware_vga.c
> @@ -1203,6 +1203,10 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev, int region_num,
>  #endif
>      cpu_register_physical_memory(s->vram_base, s->vga.vram_size,
>                      iomemtype);
> +
> +    s->vga.map_addr = addr;
> +    s->vga.map_end = addr + s->vga.vram_size;
> +    vga_dirty_log_start(&s->vga);
>  }
>
>  void pci_vmsvga_init(PCIBus *bus)
>   
N.B. depth is still screwed up with VMware vga but the fix for that 
looks a bit more non-obvious.  This VBE issue has been a long standing 
problem though and I suspect it effects other guests though.
Nolan - June 9, 2009, 1:29 a.m.
Anthony Liguori <aliguori <at> us.ibm.com> writes:
>  
> This is needed for VMware VGA to work properly under KVM.
> 
> Signed-off-by: Anthony Liguori <aliguori <at> us.ibm.com>
> ---
>  hw/vmware_vga.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
> index bb17698..246011b 100644
> --- a/hw/vmware_vga.c
> +++ b/hw/vmware_vga.c
> @@ -1203,6 +1203,10 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev, int
region_num,
>  #endif
>      cpu_register_physical_memory(s->vram_base, s->vga.vram_size,
>                      iomemtype);
> +
> +    s->vga.map_addr = addr;
> +    s->vga.map_end = addr + s->vga.vram_size;
> +    vga_dirty_log_start(&s->vga);
>  }
> 
>  void pci_vmsvga_init(PCIBus *bus)

Using the MMU to track writes to VRAM should only be needed when the FIFO is
disabled.  When the FIFO is enabled (SVGA_REG_CONFIG_DONE = 1), the guest will
notify the host via the FIFO when it has written to a region of VRAM directly,
using the SVGA_CMD_UPDATE FIFO command.

Unless I'm confused, this change appears to use the MMU to track VRAM updates
unconditionally.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Avi Kivity - June 9, 2009, 3:37 a.m.
(redirecting)

Nolan wrote:
> Anthony Liguori <aliguori <at> us.ibm.com> writes:
>   
>>  
>> This is needed for VMware VGA to work properly under KVM.
>>
>> Signed-off-by: Anthony Liguori <aliguori <at> us.ibm.com>
>> ---
>>  hw/vmware_vga.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
>> index bb17698..246011b 100644
>> --- a/hw/vmware_vga.c
>> +++ b/hw/vmware_vga.c
>> @@ -1203,6 +1203,10 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev, int
>>     
> region_num,
>   
>>  #endif
>>      cpu_register_physical_memory(s->vram_base, s->vga.vram_size,
>>                      iomemtype);
>> +
>> +    s->vga.map_addr = addr;
>> +    s->vga.map_end = addr + s->vga.vram_size;
>> +    vga_dirty_log_start(&s->vga);
>>  }
>>
>>  void pci_vmsvga_init(PCIBus *bus)
>>     
>
> Using the MMU to track writes to VRAM should only be needed when the FIFO is
> disabled.  When the FIFO is enabled (SVGA_REG_CONFIG_DONE = 1), the guest will
> notify the host via the FIFO when it has written to a region of VRAM directly,
> using the SVGA_CMD_UPDATE FIFO command.
>
> Unless I'm confused, this change appears to use the MMU to track VRAM updates
> unconditionally.
>
Jordan Justen - July 29, 2009, 4:23 p.m.
On Mon, Jun 8, 2009 at 2:53 PM, Anthony Liguori<aliguori@us.ibm.com> wrote:
> Anthony Liguori wrote:
>>
>> This is needed for VMware VGA to work properly under KVM.
>>
>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>> ---
>>  hw/vmware_vga.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
>> index bb17698..246011b 100644
>> --- a/hw/vmware_vga.c
>> +++ b/hw/vmware_vga.c
>> @@ -1203,6 +1203,10 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev,
>> int region_num,
>>  #endif
>>     cpu_register_physical_memory(s->vram_base, s->vga.vram_size,
>>                     iomemtype);
>> +
>> +    s->vga.map_addr = addr;
>> +    s->vga.map_end = addr + s->vga.vram_size;
>> +    vga_dirty_log_start(&s->vga);
>>  }
>>
>>  void pci_vmsvga_init(PCIBus *bus)
>>
>
> N.B. depth is still screwed up with VMware vga but the fix for that looks a
> bit more non-obvious.  This VBE issue has been a long standing problem
> though and I suspect it effects other guests though.
>

I've tried booting Ubuntu 8.10/9.04 using '-vga vmware' on various versions of
kvm and qemu.  The result is always ok video during BIOS post, but garbage
during pre and post X.  Would this be a symptom of the 'VBE' issue that
you mentioned?

> --
> Regards,
>
> Anthony Liguori
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Anthony Liguori - July 29, 2009, 5:15 p.m.
Jordan Justen wrote:
> On Mon, Jun 8, 2009 at 2:53 PM, Anthony Liguori<aliguori@us.ibm.com> wrote:
>   
>> Anthony Liguori wrote:
>>     
>>> This is needed for VMware VGA to work properly under KVM.
>>>
>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>> ---
>>>  hw/vmware_vga.c |    4 ++++
>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
>>> index bb17698..246011b 100644
>>> --- a/hw/vmware_vga.c
>>> +++ b/hw/vmware_vga.c
>>> @@ -1203,6 +1203,10 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev,
>>> int region_num,
>>>  #endif
>>>     cpu_register_physical_memory(s->vram_base, s->vga.vram_size,
>>>                     iomemtype);
>>> +
>>> +    s->vga.map_addr = addr;
>>> +    s->vga.map_end = addr + s->vga.vram_size;
>>> +    vga_dirty_log_start(&s->vga);
>>>  }
>>>
>>>  void pci_vmsvga_init(PCIBus *bus)
>>>
>>>       
>> N.B. depth is still screwed up with VMware vga but the fix for that looks a
>> bit more non-obvious.  This VBE issue has been a long standing problem
>> though and I suspect it effects other guests though.
>>
>>     
>
> I've tried booting Ubuntu 8.10/9.04 using '-vga vmware' on various versions of
> kvm and qemu.  The result is always ok video during BIOS post, but garbage
> during pre and post X.  Would this be a symptom of the 'VBE' issue that
> you mentioned?
>   

Try the latest qemu git.  vmware vga should work there.

I'm not sure about qemu-kvm.  It depends on whether the changes survived 
the merge.

Regards,

Anthony Liguori
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jordan Justen - July 29, 2009, 5:56 p.m.
On Wed, Jul 29, 2009 at 10:15 AM, Anthony Liguori<anthony@codemonkey.ws> wrote:
> Jordan Justen wrote:
>>
>> On Mon, Jun 8, 2009 at 2:53 PM, Anthony Liguori<aliguori@us.ibm.com>
>> wrote:
>>
>>>
>>> Anthony Liguori wrote:
>>>
>>>>
>>>> This is needed for VMware VGA to work properly under KVM.
>>>>
>>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>>> ---
>>>>  hw/vmware_vga.c |    4 ++++
>>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
>>>> index bb17698..246011b 100644
>>>> --- a/hw/vmware_vga.c
>>>> +++ b/hw/vmware_vga.c
>>>> @@ -1203,6 +1203,10 @@ static void pci_vmsvga_map_mem(PCIDevice
>>>> *pci_dev,
>>>> int region_num,
>>>>  #endif
>>>>    cpu_register_physical_memory(s->vram_base, s->vga.vram_size,
>>>>                    iomemtype);
>>>> +
>>>> +    s->vga.map_addr = addr;
>>>> +    s->vga.map_end = addr + s->vga.vram_size;
>>>> +    vga_dirty_log_start(&s->vga);
>>>>  }
>>>>
>>>>  void pci_vmsvga_init(PCIBus *bus)
>>>>
>>>>
>>>
>>> N.B. depth is still screwed up with VMware vga but the fix for that looks
>>> a
>>> bit more non-obvious.  This VBE issue has been a long standing problem
>>> though and I suspect it effects other guests though.
>>>
>>>
>>
>> I've tried booting Ubuntu 8.10/9.04 using '-vga vmware' on various
>> versions of
>> kvm and qemu.  The result is always ok video during BIOS post, but garbage
>> during pre and post X.  Would this be a symptom of the 'VBE' issue that
>> you mentioned?
>>
>
> Try the latest qemu git.  vmware vga should work there.
>
> I'm not sure about qemu-kvm.  It depends on whether the changes survived the
> merge.
>

Yes, this is one of the combinations I tried.  Latest qemu from git with your
two patches applied.

Do you have another distro which you might recommend trying?  (Although,
I'm not too confident this would be the problem.)

> Regards,
>
> Anthony Liguori
>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Anthony Liguori - July 29, 2009, 6:47 p.m.
Jordan Justen wrote:
> Yes, this is one of the combinations I tried.  Latest qemu from git with your
> two patches applied.
>   

Shouldn't need any patches.  I'll try to give it a try in the near future.

Patch

diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index bb17698..246011b 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -1203,6 +1203,10 @@  static void pci_vmsvga_map_mem(PCIDevice *pci_dev, int region_num,
 #endif
     cpu_register_physical_memory(s->vram_base, s->vga.vram_size,
                     iomemtype);
+
+    s->vga.map_addr = addr;
+    s->vga.map_end = addr + s->vga.vram_size;
+    vga_dirty_log_start(&s->vga);
 }
 
 void pci_vmsvga_init(PCIBus *bus)