From: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Modeling x86 early initialization accurately
Date: Tue, 25 Nov 2008 23:48:31 +0100 [thread overview]
Message-ID: <492C80BF.4010103@gmx.net> (raw)
Hi,
current svn HEAD of QEMU assumes all RAM is available directly at x86
CPU startup. The ability to lock processor caches to function as RAM
(Cache-as-RAM) is unimplemented as well.
While that does make it easier for the shipped BIOS to set up working
RAM (i.e. it does nothing about that right now), that simplification
reduces the ability to run alternative firmwares for x86 in QEMU.
coreboot (a free x86 firmware/BIOS replacement) is unable to use
standard x86 early initialization because the MSRs for cache control
(MTRRs) are completely unimplemented and ignored.
Modeling ACPI S3 (Suspend-to-RAM) suffers from similar issues.
Things which need to be changed to model x86 better:
- Start up with all RAM being readonly. Writes should be discarded,
reads will usually return 0xff or be undefined. The "undefined" variant
would allow the code to allocate RAM once and just switch write access
on/off.
- Support MTRRs.
-- Mention MTRR support in CPUID.
-- I sent a patch to dump unknown MSR accesses in general and MTRR
reads/writes in particular. The subject was "[Qemu-devel] [PATCH] x86
MTRR access dumping".
-- It is not really needed to completely implement L1/L2 caches, but the
ability to lock the cache with the help of MTRRs should be available.
Areas with active locked cache do not send writes down to the RAM which
is still readonly. The cache locking is done on a per-page basis (or
even larger granularity), so it should be easier than having to handle
single cache lines.
- Decide what to do for RAM initialization. Do we switch RAM into
read-write mode by a simple QEMU-specific MSR write? Do we want to
implement all memory initialization hardware instead?
- Adapt the currently shipped BIOS to these tasks and/or switch to
coreboot+SeaBIOS.
I'm willing to do most of the work if I know that this won't be rejected
outright.
Regards,
Carl-Daniel
next reply other threads:[~2008-11-25 22:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-25 22:48 Carl-Daniel Hailfinger [this message]
2008-11-26 2:04 ` [Qemu-devel] Modeling x86 early initialization accurately Anthony Liguori
2008-11-26 3:26 ` Carl-Daniel Hailfinger
2008-11-26 16:36 ` Avi Kivity
2008-11-27 2:05 ` Carl-Daniel Hailfinger
2008-11-27 13:28 ` Avi Kivity
2008-11-27 14:22 ` Carl-Daniel Hailfinger
2008-11-26 11:37 ` Paul Brook
2008-11-26 13:29 ` Carl-Daniel Hailfinger
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=492C80BF.4010103@gmx.net \
--to=c-d.hailfinger.devel.2006@gmx.net \
--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).