qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] linux-user: Turn gdt_table into local variable
Date: Sun, 13 Jul 2008 22:28:40 +0200	[thread overview]
Message-ID: <487A6578.8020501@web.de> (raw)

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,

             reply	other threads:[~2008-07-13 20:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-13 20:28 Jan Kiszka [this message]
2008-07-13 22:11 ` [Qemu-devel] [PATCH] linux-user: Turn gdt_table into local variable Paul Brook
2008-07-14  7:14   ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=487A6578.8020501@web.de \
    --to=jan.kiszka@web.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).