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-unstable] [QEMU] Align VGA ram allocation

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [QEMU] Align VGA ram allocation
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Dec 2006 09:05:16 -0800
Delivery-date: Thu, 21 Dec 2006 09:06:02 -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 dae6bc4241dbc3beb87b8530bcfc5127c6d92eb0
# Parent  5c46e27e3915734b1a98bce8fce1239e57990c8c
[QEMU] Align VGA ram allocation
This makes the SSE-optimized vram_dirty() safe again.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 tools/ioemu/hw/vga.c     |   11 ++++++++---
 tools/ioemu/hw/vga_int.h |    1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

diff -r 5c46e27e3915 -r dae6bc4241db tools/ioemu/hw/vga.c
--- a/tools/ioemu/hw/vga.c      Thu Dec 21 12:08:27 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 5c46e27e3915 -r dae6bc4241db tools/ioemu/hw/vga_int.h
--- a/tools/ioemu/hw/vga_int.h  Thu Dec 21 12:08:27 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-unstable] [QEMU] Align VGA ram allocation, Xen patchbot-unstable <=