From: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
To: qemu-devel@nongnu.org
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] MTRR support on x86 [resend]
Date: Thu, 22 Jan 2009 04:03:51 +0100 [thread overview]
Message-ID: <4977E217.2030303@gmx.net> (raw)
In-Reply-To: <497754BD.2000402@gmx.net>
On 21.01.2009 18:00, Carl-Daniel Hailfinger wrote:
> The current codebase ignores MTRR (Memory Type Range Register)
> configuration writes and reads because Qemu does not implement caching.
> All BIOS/firmware in know of for x86 do implement a mode called
> Cache-as-RAM (CAR) which locks down the CPU cache lines and uses the CPU
> cache like RAM before RAM is enabled. Qemu assumes RAM is accessible
> from the start, but it would be nice to be able to run real
> BIOS/firmware in Qemu. For that, we need CAR support and for CAR support
> we have to support MTRRs.
>
> This patch is a first step in that direction. MTRRs are MSRs supported
> by all recent x86 CPUs, even old i586. Besides influencing cache, the
> MTRRs can be written and read back, so discarding MTRR writes violates
> the expectations of existing code out there.
>
> An added benefit of this patch is that it fixes the following Linux
> kernel error message present in recent kernels (provided the BIOS has
> the recent MTRR patches applied):
> ------------[ cut here ]------------
> WARNING: at arch/x86/kernel/cpu/mtrr/main.c:1500 mtrr_trim_uncached_memory+0x382/0x384()
> WARNING: strange, CPU MTRRs all blank?
> Modules linked in:
> Supported: Yes
> Pid: 0, comm: swapper Not tainted 2.6.27.7-9-default #1
> [<c0106570>] dump_trace+0x6b/0x249
> [<c01070a5>] show_trace+0x20/0x39
> [<c0343c02>] dump_stack+0x71/0x76
> [<c012acb2>] warn_slowpath+0x6f/0x90
> [<c0542f8f>] mtrr_trim_uncached_memory+0x382/0x384
> [<c053f24d>] setup_arch+0x40d/0x639
> [<c053a6ac>] start_kernel+0x6b/0x31f
> =======================
> ---[ end trace 4eaa2a86a8e2da22 ]---
>
> Handle common x86 MTRR reads and writes, but don't act on them.
>
> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
>
Just a short heads-up: Since one of the BIOS MTRR support patches is a
bit incomplete, this patch is not enough to silence that Linux warning.
I'll post a new patch with improved compatibility tomorrow.
Regards,
Carl-Daniel
--
http://www.hailfinger.org/
next prev parent reply other threads:[~2009-01-22 3:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-04 22:43 [Qemu-devel] [PATCH] MTRR support on x86, part 1 Carl-Daniel Hailfinger
2008-12-11 20:59 ` Anthony Liguori
2008-12-11 21:14 ` Carl-Daniel Hailfinger
2008-12-11 22:10 ` Carl-Daniel Hailfinger
2008-12-11 22:37 ` Carl-Daniel Hailfinger
2009-01-21 17:00 ` [Qemu-devel] [PATCH] MTRR support on x86 [resend] Carl-Daniel Hailfinger
2009-01-22 3:03 ` Carl-Daniel Hailfinger [this message]
2009-01-26 17:53 ` Anthony Liguori
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=4977E217.2030303@gmx.net \
--to=c-d.hailfinger.devel.2006@gmx.net \
--cc=mtosatti@redhat.com \
--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).