From: "Hervé Poussineau" <hpoussin@reactos.org>
To: QEMU Developers <qemu-devel@nongnu.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] Windows NT4 regression due to 0b57e287 ("cpu_physical_memory_write_rom() needs to do TB invalidates")
Date: Sat, 03 Nov 2012 22:05:08 +0100 [thread overview]
Message-ID: <50958704.5050307@reactos.org> (raw)
This commit breaks Windows NT4 boot.
QEMU crashes when NT4 switches from 80x25 to 80x43 resolution.
First bad commit is:
commit 0b57e287138728f72d88b06e69b970c5d745c44a
Author: David Gibson <david@gibson.dropbear.id.au>
Date: Mon Sep 10 12:30:57 2012 +1000
cpu_physical_memory_write_rom() needs to do TB invalidates
cpu_physical_memory_write_rom(), despite the name, can also be used to
write images into RAM - and will often be used that way if the machine
uses load_image_targphys() into RAM addresses.
However, cpu_physical_memory_write_rom(), unlike
cpu_physical_memory_rw()
doesn't invalidate any cached TBs which might be affected by the region
written.
This was breaking reset (under full emu) on the pseries machine - we
loaded
our firmware image into RAM, and while executing it rewrite the code at
the entry point (correctly causing a TB invalidate/refresh). When we
reset the firmware image was reloaded, but the TB from the rewrite was
still active and caused us to get an illegal instruction trap.
This patch fixes the bug by duplicating the tb invalidate code from
cpu_physical_memory_rw() in cpu_physical_memory_write_rom().
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
gdb gives:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb3584b70 (LWP 22345)]
#0 0x80276a36 in helper_stl_mmu (env=0x80bf9f48, addr=4294836352,
val=0, mmu_idx=-2134925496)
at softmmu_template.h:254
254 tlb_addr = env->tlb_table[mmu_idx][index].add_write
(gdb) bt
#0 0x80276a36 in helper_stl_mmu (env=0x80bf9f48, addr=4294836352,
val=0, mmu_idx=-2134925496)
at softmmu_template.h:254
#1 0xb537aa9e in code_gen_buffer ()
#2 0x0005849 in ?? ()
#3 0x80af3ce0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) p env
$1 = (struct CPUX86State *) 0x80bf9f48
(gdb) p index
$2 = 224
Command line is
qemu-system-i386 -cpu pentium -hda nt40.qcow2
KVM is not used.
Reverting the commit (and fixing the conflict) lets Windows NT4 work again.
Regards,
Hervé
next reply other threads:[~2012-11-03 21:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-03 21:05 Hervé Poussineau [this message]
2012-11-03 21:15 ` [Qemu-devel] Windows NT4 regression due to 0b57e287 ("cpu_physical_memory_write_rom() needs to do TB invalidates") Blue Swirl
2012-11-03 21:34 ` Hervé Poussineau
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=50958704.5050307@reactos.org \
--to=hpoussin@reactos.org \
--cc=david@gibson.dropbear.id.au \
--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).