qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] linux-user: Turn gdt_table into local variable


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH] linux-user: Turn gdt_table into local variable
Date: Sun, 13 Jul 2008 22:28:40 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

qemu_malloc[z] does not return memory suited for direct guest access,
but that is mandatory for gdt_table. Local host variables are safe, so
re-convert that (small) table.

This patch, together with the one for page_find_alloc, fixes the
reported qemu-i386 regression [1].

[1] http://permalink.gmane.org/gmane.comp.emulators.qemu/26987

Signed-off-by: Jan Kiszka <address@hidden>
---
 linux-user/main.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: b/linux-user/main.c
===================================================================
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -258,6 +258,8 @@ void fork_end(int child)
 /***********************************************************/
 /* CPUX86 core interface */
 
+uint64_t gdt_table[TARGET_GDT_ENTRIES];
+
 void cpu_smm_update(CPUState *env)
 {
 }
@@ -2470,9 +2472,7 @@ int main(int argc, char **argv)
 
     /* linux segment setup */
     {
-        uint64_t *gdt_table;
-        gdt_table = qemu_mallocz(sizeof(uint64_t) * TARGET_GDT_ENTRIES);
-        env->gdt.base = h2g((unsigned long)gdt_table);
+        env->gdt.base = h2g(gdt_table);
         env->gdt.limit = sizeof(uint64_t) * TARGET_GDT_ENTRIES - 1;
 #ifdef TARGET_ABI32
         write_dt(&gdt_table[__USER_CS >> 3], 0, 0xfffff,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]