From: Gleb Natapov <gleb@redhat.com>
To: bochs-developers@lists.sourceforge.net
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v3 3/6] Preserve memory content during SMM init.
Date: Mon, 10 Nov 2008 11:11:49 +0200 [thread overview]
Message-ID: <20081110091149.11822.9390.stgit@dhcp-1-237.local> (raw)
In-Reply-To: <20081110091134.11822.34230.stgit@dhcp-1-237.local>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
bios/rombios32.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/bios/rombios32.c b/bios/rombios32.c
index 86942f4..53ae5e1 100644
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -731,6 +731,12 @@ static void smm_init(PCIDevice *d)
value = pci_config_readl(d, 0x58);
if ((value & (1 << 25)) == 0) {
+ /* enable the SMM memory window */
+ pci_config_writeb(&i440_pcidev, 0x72, 0x02 | 0x48);
+
+ /* save original memory content */
+ memcpy((void *)0xa8000, (void *)0x38000, 0x8000);
+
/* copy the SMM relocation code */
memcpy((void *)0x38000, &smm_relocation_start,
&smm_relocation_end - &smm_relocation_start);
@@ -747,8 +753,8 @@ static void smm_init(PCIDevice *d)
/* wait until SMM code executed */
while (inb(0xb3) != 0x00);
- /* enable the SMM memory window */
- pci_config_writeb(&i440_pcidev, 0x72, 0x02 | 0x48);
+ /* restore original memory content */
+ memcpy((void *)0x38000, (void *)0xa8000, 0x8000);
/* copy the SMM code */
memcpy((void *)0xa8000, &smm_code_start,
next prev parent reply other threads:[~2008-11-10 9:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-10 9:11 [Qemu-devel] [PATCH v3 0/6] Support for S3 ACPI state (suspend to memory) in BIOS Gleb Natapov
2008-11-10 9:11 ` [Qemu-devel] [PATCH v3 1/6] Move PIC initialization out of line to save space in post code area Gleb Natapov
2008-11-13 0:10 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v3 1/6] Move PIC initialization out ofline " Sebastian Herbszt
2008-11-13 19:15 ` [Qemu-devel] " Stanislav Shwartsman
2008-11-13 20:00 ` Anthony Liguori
2008-11-14 9:47 ` Gleb Natapov
2008-11-14 20:36 ` [Qemu-devel] RE: [Bochs-developers] [PATCH v3 1/6] Move PICinitialization " Sebastian Herbszt
2008-11-10 9:11 ` [Qemu-devel] [PATCH v3 2/6] Add S3 state to DSDT. Handle resume event in the BIOS Gleb Natapov
2008-11-15 17:43 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v3 2/6] Add S3 state to DSDT. Handleresume " Sebastian Herbszt
2008-11-15 17:56 ` Gleb Natapov
2008-11-10 9:11 ` Gleb Natapov [this message]
2008-11-10 9:11 ` [Qemu-devel] [PATCH v3 4/6] Execute rombios32 code from rom address 0xe0000 Gleb Natapov
2008-11-10 9:11 ` [Qemu-devel] [PATCH v3 5/6] Don't use unreserved memory in BIOS Gleb Natapov
2008-11-13 0:43 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v3 5/6] Don't use unreserved memory inBIOS Sebastian Herbszt
2008-11-13 7:41 ` Gleb Natapov
2008-11-10 9:12 ` [Qemu-devel] [PATCH v3 6/6] Don't power down vga card on entering S3 state Gleb Natapov
2008-11-10 12:07 ` Glauber Costa
2008-11-10 13:28 ` Gleb Natapov
2008-11-10 20:25 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v3 6/6] Don't power down vga card onentering " Sebastian Herbszt
2008-11-10 21:20 ` Gleb Natapov
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=20081110091149.11822.9390.stgit@dhcp-1-237.local \
--to=gleb@redhat.com \
--cc=bochs-developers@lists.sourceforge.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).