WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH V3] hvmloader: Enable SCI in QEMU if is not.

To: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir@xxxxxxx>
Subject: [Xen-devel] [PATCH V3] hvmloader: Enable SCI in QEMU if is not.
From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Date: Thu, 28 Jul 2011 14:35:26 +0100
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Tobias Geiger <tobias.geiger@xxxxxxxxx>
Delivery-date: Thu, 28 Jul 2011 06:42:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CA564FA1.1EA68%keir.xen@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CA564FA1.1EA68%keir.xen@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
When booting a Windows guest, the OS report an issue with the ACPI (in a
BSOD). The exact issue is "SCI_EN never becomes set in PM1 Control
Register." (quoted from WinDbg help).

So this patch enables the flags SCI_EN if it is not yet enabled.

Reported-by: Tobias Geiger <tobias.geiger@xxxxxxxxx>
Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/firmware/hvmloader/hvmloader.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/tools/firmware/hvmloader/hvmloader.c 
b/tools/firmware/hvmloader/hvmloader.c
index f8553bb..0637ac0 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -28,6 +28,7 @@
 #include "apic_regs.h"
 #include <xen/version.h>
 #include <xen/hvm/params.h>
+#include <xen/hvm/ioreq.h>
 
 #define ROM_INCLUDE_VGABIOS
 #define ROM_INCLUDE_ETHERBOOT
@@ -381,6 +382,22 @@ static const struct bios_config *detect_bios(void)
     return NULL;
 }
 
+#define SCI_EN                              (1 <<  0)
+#define SMI_CMD_IOPORT                      0xb2
+#define PIIX4_ACPI_ENABLE                   0xf1
+
+static void enable_sci(void)
+{
+    int pm1a_cnt_val = 0;
+
+    pm1a_cnt_val = inb(ACPI_PM1A_CNT_BLK_ADDRESS_V1);
+    if (!(pm1a_cnt_val & SCI_EN)) {
+        outb(SMI_CMD_IOPORT, PIIX4_ACPI_ENABLE);
+    }
+    pm1a_cnt_val = inb(ACPI_PM1A_CNT_BLK_ADDRESS_V1);
+    BUG_ON(!(pm1a_cnt_val & SCI_EN));
+}
+
 int main(void)
 {
     const struct bios_config *bios;
@@ -479,6 +496,7 @@ int main(void)
             printf("Loading ACPI ...\n");
             bios->acpi_build_tables();
         }
+        enable_sci();
         hypercall_hvm_op(HVMOP_set_param, &p);
     }
 
-- 
Anthony PERARD


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel