Blame SOURCES/0004-Workaround-for-a-win8.1-32-S4-resume-bug.patch

42a4d9
From 1dfb44fecec3070163d66047815f3cbebabfceb6 Mon Sep 17 00:00:00 2001
42a4d9
From: Radim Krcmar <rkrcmar@redhat.com>
42a4d9
Date: Mon, 10 Mar 2014 15:14:27 +0100
42a4d9
Subject: Workaround for a win8.1-32 S4 resume bug
42a4d9
MIME-Version: 1.0
42a4d9
Content-Type: text/plain; charset=UTF-8
42a4d9
Content-Transfer-Encoding: 8bit
42a4d9
42a4d9
RH-Author: Radim Krcmar <rkrcmar@redhat.com>
42a4d9
Message-id: <1394464467-23560-1-git-send-email-rkrcmar@redhat.com>
42a4d9
Patchwork-id: 58069
42a4d9
O-Subject: [RHEL7.0 seabios PATCH] Workaround for a win8.1-32 S4 resume bug
42a4d9
Bugzilla: 1050775
42a4d9
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
42a4d9
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
42a4d9
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
42a4d9
42a4d9
bug:  https://bugzilla.redhat.com/show_bug.cgi?id=1050775
42a4d9
brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7176174
42a4d9
This patch has no upstream equivalent.
42a4d9
42a4d9
When a 32 bit version of windows 8.1 resumes from suspend, it writes 1
42a4d9
into 0x72 in the early boot because it didn't expect a NULL pointer.
42a4d9
0x72 is lower offset byte of 0x1c interrupt entry, so we jump into a
42a4d9
middle of other function if this interrupt is triggered.
42a4d9
42a4d9
Because 0x1c is only triggered from our handle_08, we detect if our
42a4d9
default value (function that does only iret) has its lower offset byte
42a4d9
overwritten and skip it in that case.
42a4d9
(Windows never sets own callback there, so we always detect this bug
42a4d9
 correctly, as seabios doesn't use it either
42a4d9
 Other sources shouldn't incorrectly overwrite it or use seabios code,
42a4d9
 but it is quite ok even if the guest did this on purpose.)
42a4d9
42a4d9
The reason Windows uses NULL pointer is still unknown, but this bug is
42a4d9
blocking WHQL certification, so we have to work around it in 7.0.
42a4d9
42a4d9
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
42a4d9
---
42a4d9
 src/clock.c | 8 +++++++-
42a4d9
 1 file changed, 7 insertions(+), 1 deletion(-)
42a4d9
42a4d9
diff --git a/src/clock.c b/src/clock.c
42a4d9
index e44e112..298a722 100644
42a4d9
--- a/src/clock.c
42a4d9
+++ b/src/clock.c
42a4d9
@@ -309,7 +309,13 @@ handle_08(void)
42a4d9
     struct bregs br;
42a4d9
     memset(&br, 0, sizeof(br));
42a4d9
     br.flags = F_IF;
42a4d9
-    call16_int(0x1c, &br);
42a4d9
+    struct segoff_s isr1c = GET_IVT(0x1c);
42a4d9
+    // hardcoded address of entry_iret_official with lower segment byte
42a4d9
+    // overwritten by 1
42a4d9
+    if (isr1c.seg == ((SEG_BIOS & ~0xff) | 0x1) && isr1c.offset == 0xff53)
42a4d9
+        dprintf(1, "Worked around win8.1-32 S4 resume bug\n");
42a4d9
+    else
42a4d9
+        call16_int(0x1c, &br);
42a4d9
 
42a4d9
     pic_eoi1();
42a4d9
 }
42a4d9
-- 
42a4d9
1.8.3.1
42a4d9