WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.0.4-testing] [QEMU] Align VGA ram allocation

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0.4-testing] [QEMU] Align VGA ram allocation
From: "Xen patchbot-3.0.4-testing" <patchbot-3.0.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 03 Jan 2007 14:15:36 -0800
Delivery-date: Wed, 03 Jan 2007 14:16:04 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1166708599 0
# Node ID 2871dd01664b5e13c0f9efd03477af40aa151a79
# Parent  d6ae86aecc372e66110653ed98836a2b4f6d21fb
[QEMU] Align VGA ram allocation
This makes the SSE-optimized vram_dirty() safe again.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>

Based on xen-unstable changeset 13118:dae6bc4241dbc3beb87b8530bcfc5127c6d92eb0
---
 tools/ioemu/hw/vga.c     |   11 ++++++++---
 tools/ioemu/hw/vga_int.h |    1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

diff -r d6ae86aecc37 -r 2871dd01664b tools/ioemu/hw/vga.c
--- a/tools/ioemu/hw/vga.c      Thu Dec 21 11:22:39 2006 +0000
+++ b/tools/ioemu/hw/vga.c      Thu Dec 21 13:43:19 2006 +0000
@@ -2002,7 +2002,10 @@ void vga_common_init(VGAState *s, Displa
     s->vram_shadow = (uint8_t *)((long)(s->vram_shadow + TARGET_PAGE_SIZE - 1)
                                  & ~(TARGET_PAGE_SIZE - 1));
 
-    s->vram_ptr = qemu_malloc(vga_ram_size);
+    /* Video RAM must be 128-bit aligned for SSE optimizations later */
+    s->vram_alloc = qemu_malloc(vga_ram_size + 15);
+    s->vram_ptr = (uint8_t *)((long)(s->vram_alloc + 15) & ~15L);
+
     s->vram_offset = vga_ram_offset;
     s->vram_size = vga_ram_size;
     s->ds = ds;
@@ -2126,7 +2129,7 @@ void *vga_update_vram(VGAState *s, void 
     }
 
     if (!vga_ram_base) {
-        vga_ram_base = qemu_malloc(vga_ram_size);
+        vga_ram_base = qemu_malloc(vga_ram_size + TARGET_PAGE_SIZE + 1);
         if (!vga_ram_base) {
             fprintf(stderr, "reallocate error\n");
             return NULL;
@@ -2134,8 +2137,10 @@ void *vga_update_vram(VGAState *s, void 
     }
 
     /* XXX lock needed? */
+    old_pointer = s->vram_alloc;
+    s->vram_alloc = vga_ram_base;
+    vga_ram_base = (uint8_t *)((long)(vga_ram_base + 15) & ~15L);
     memcpy(vga_ram_base, s->vram_ptr, vga_ram_size);
-    old_pointer = s->vram_ptr;
     s->vram_ptr = vga_ram_base;
 
     return old_pointer;
diff -r d6ae86aecc37 -r 2871dd01664b tools/ioemu/hw/vga_int.h
--- a/tools/ioemu/hw/vga_int.h  Thu Dec 21 11:22:39 2006 +0000
+++ b/tools/ioemu/hw/vga_int.h  Thu Dec 21 13:43:19 2006 +0000
@@ -78,6 +78,7 @@
 #define VGA_MAX_HEIGHT 2048
 
 #define VGA_STATE_COMMON                                                \
+    uint8_t *vram_alloc;                                                \
     uint8_t *vram_ptr;                                                  \
     uint8_t *vram_shadow;                                               \
     unsigned long vram_offset;                                          \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.0.4-testing] [QEMU] Align VGA ram allocation, Xen patchbot-3.0.4-testing <=