[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 2/5] Preserve memory content during SMM init.
From: |
Gleb Natapov |
Subject: |
[Qemu-devel] [PATCH v4 2/5] Preserve memory content during SMM init. |
Date: |
Sun, 16 Nov 2008 11:33:55 +0200 |
User-agent: |
StGIT/0.14.2 |
Signed-off-by: Gleb Natapov <address@hidden>
---
bios/rombios32.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/bios/rombios32.c b/bios/rombios32.c
index 7b354a8..7075aa9 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,
[Qemu-devel] [PATCH v4 2/5] Preserve memory content during SMM init.,
Gleb Natapov <=
[Qemu-devel] [PATCH v4 3/5] Execute rombios32 code from rom address 0xe0000., Gleb Natapov, 2008/11/16
[Qemu-devel] [PATCH v4 4/5] Don't use unreserved memory in BIOS., Gleb Natapov, 2008/11/16
[Qemu-devel] [PATCH v4 5/5] Don't power down vga card on entering S3 state., Gleb Natapov, 2008/11/16
[Qemu-devel] Re: [Bochs-developers] [PATCH v4 0/5] Support for S3 ACPI state(suspend to memory) in BIOS, Sebastian Herbszt, 2008/11/16