* [Qemu-devel] [PATCH] linux-user: Turn gdt_table into local variable
@ 2008-07-13 20:28 Jan Kiszka
2008-07-13 22:11 ` Paul Brook
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2008-07-13 20:28 UTC (permalink / raw)
To: qemu-devel
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 <jan.kiszka@web.de>
---
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,
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-14 7:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-13 20:28 [Qemu-devel] [PATCH] linux-user: Turn gdt_table into local variable Jan Kiszka
2008-07-13 22:11 ` Paul Brook
2008-07-14 7:14 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).