All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Kevin O'Connor <kevin@koconnor.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	seabios@seabios.org, qemu-devel@nongnu.org,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [SeaBIOS] [PATCH] acpi: hide 64-bit PCI hole for Windows XP
Date: Fri, 09 Aug 2013 11:45:59 +0200	[thread overview]
Message-ID: <5204BA57.4010007@redhat.com> (raw)
In-Reply-To: <20130809041306.GB6869@morn.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]

  Hi,

> Converting src/smm.c to use a runtime value isn't hard - just change
> the assembler from: "mov $" __stringify(PORT_ACPI_PM_BASE) " + 0x04,
> %dx\n" to: "mov 4(my_acpi_base), %dx\n" and make sure to define the
> global variable my_acpi_base as VARFSEG.

The apm fix brought a ctl register variable we can use directly, so I
tried the attached patch, then got this:

  Linking out/rom.o
out/code32flat.o: In function `smm_relocation_end':
(.text.asm./home/kraxel/projects/seabios/src/smm.c.72+0x37): relocation
truncated to fit: R_386_16 against symbol `acpi_pm1a_cnt' defined in
.data.varfseg./home/kraxel/projects/seabios/src/acpi.c.21 section in
out/code32flat.o
out/code32flat.o: In function `smm_relocation_end':
(.text.asm./home/kraxel/projects/seabios/src/smm.c.72+0x46): relocation
truncated to fit: R_386_16 against symbol `acpi_pm1a_cnt' defined in
.data.varfseg./home/kraxel/projects/seabios/src/acpi.c.21 section in
out/code32flat.o
make: *** [out/rom.o] Error 1

cheers,
  Gerd


[-- Attachment #2: 0001-wip-make-pmbase-runtime.patch --]
[-- Type: text/plain, Size: 1689 bytes --]

From 2d3cf0af70727664c0ab5f17dae99b9f3043b631 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri, 9 Aug 2013 11:43:51 +0200
Subject: [PATCH] [wip] make pmbase runtime

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 src/acpi.c |    2 +-
 src/acpi.h |    2 +-
 src/smm.c  |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/acpi.c b/src/acpi.c
index 8db1ed4..db33595 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -18,7 +18,7 @@
 
 #include "acpi-dsdt.hex"
 
-u32 acpi_pm1a_cnt VARFSEG;
+u16 acpi_pm1a_cnt VARFSEG;
 
 static void
 build_header(struct acpi_table_header *h, u32 sig, int len, u8 rev)
diff --git a/src/acpi.h b/src/acpi.h
index f0d24d4..5c478a1 100644
--- a/src/acpi.h
+++ b/src/acpi.h
@@ -36,7 +36,7 @@ struct rsdp_descriptor {        /* Root System Descriptor Pointer */
 };
 
 extern struct rsdp_descriptor *RsdpAddr;
-extern u32 acpi_pm1a_cnt;
+extern u16 acpi_pm1a_cnt;
 
 /* Table structure from Linux kernel (the ACPI tables are under the
    BSD license) */
diff --git a/src/smm.c b/src/smm.c
index a424a29..a788a82 100644
--- a/src/smm.c
+++ b/src/smm.c
@@ -48,7 +48,7 @@ ASM32FLAT(
     "  jne 1f\n"
 
     /* ACPI disable */
-    "  mov $" __stringify(PORT_ACPI_PM_BASE) " + 0x04, %dx\n" /* PMCNTRL */
+    "  mov (acpi_pm1a_cnt), %dx\n" /* PMCNTRL */
     "  inw %dx, %ax\n"
     "  andw $~1, %ax\n"
     "  outw %ax, %dx\n"
@@ -60,7 +60,7 @@ ASM32FLAT(
     "  jne 2f\n"
 
     /* ACPI enable */
-    "  mov $" __stringify(PORT_ACPI_PM_BASE) " + 0x04, %dx\n" /* PMCNTRL */
+    "  mov (acpi_pm1a_cnt), %dx\n" /* PMCNTRL */
     "  inw %dx, %ax\n"
     "  orw $1, %ax\n"
     "  outw %ax, %dx\n"
-- 
1.7.9.7


  parent reply	other threads:[~2013-08-09  9:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1375167638-4325-1-git-send-email-imammedo@redhat.com>
     [not found] ` <20130731055959.GA31017@redhat.com>
     [not found]   ` <20130731081459.77eba7bb@nial.usersys.redhat.com>
     [not found]     ` <51FFCCF4.706@redhat.com>
     [not found]       ` <20130805181618.GB4244@redhat.com>
     [not found]         ` <911613672.9763982.1375729901921.JavaMail.root@redhat.com>
     [not found]           ` <20130806143901.GA17072@redhat.com>
     [not found]             ` <1243962588.10286037.1375807384073.JavaMail.root@redhat.com>
     [not found]               ` <20130806165820.GB20305@redhat.com>
     [not found]                 ` <5201F763.3030507@redhat.com>
2013-08-08  6:04                   ` [Qemu-devel] [SeaBIOS] [PATCH] acpi: hide 64-bit PCI hole for Windows XP Michael S. Tsirkin
     [not found]                   ` <20130807095019.GA26266@redhat.com>
     [not found]                     ` <5202218C.70005@redhat.com>
     [not found]                       ` <20130807111031.GC3068@redhat.com>
     [not found]                         ` <52023A52.6010208@redhat.com>
     [not found]                           ` <20130807123509.GA10670@redhat.com>
     [not found]                             ` <520257F8.1080501@redhat.com>
     [not found]                               ` <20130807145312.GA14308@redhat.com>
     [not found]                                 ` <52034F73.4040904@redhat.com>
2013-08-08  8:37                                   ` Michael S. Tsirkin
2013-08-08  8:57                                     ` Gerd Hoffmann
2013-08-08  9:52                                       ` Michael S. Tsirkin
2013-08-08 10:21                                         ` Gerd Hoffmann
2013-08-08 14:13                                           ` Michael S. Tsirkin
2013-08-08 14:56                                             ` Gerd Hoffmann
2013-08-09  4:13                                               ` Kevin O'Connor
2013-08-09  6:25                                                 ` Gerd Hoffmann
2013-08-10  3:10                                                   ` Kevin O'Connor
2013-08-12  6:05                                                     ` Gerd Hoffmann
2013-08-12 22:42                                                       ` Kevin O'Connor
2013-08-13  6:49                                                         ` Gerd Hoffmann
2013-08-14 12:38                                                           ` Kevin O'Connor
2013-08-14 14:52                                                             ` Gerd Hoffmann
2013-08-09  9:45                                                 ` Gerd Hoffmann [this message]
2013-08-10  3:30                                                   ` Kevin O'Connor
2013-08-10 15:50                                                     ` Kevin O'Connor
2013-08-09 15:49                                                 ` Michael S. Tsirkin
2013-08-10  3:06                                                   ` Kevin O'Connor
2013-08-12  6:37                                                   ` Gerd Hoffmann
2013-08-12  7:56                                                     ` Michael S. Tsirkin
2013-08-12 13:08                                                   ` Laszlo Ersek
     [not found]                                   ` <20130808082212.GA26837@redhat.com>
     [not found]                                     ` <52035C2F.4040700@redhat.com>
2013-08-08  9:37                                       ` Michael S. Tsirkin

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=5204BA57.4010007@redhat.com \
    --to=kraxel@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.