From: tip-bot for Akinobu Mita <akinobu.mita@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
akinobu.mita@gmail.com, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/asm] x86: Introduce GDT_ENTRY_INIT(), initialize bad_bios_desc statically
Date: Mon, 10 Aug 2009 09:12:35 GMT [thread overview]
Message-ID: <tip-c7425314c755d5f94da7c978205c85a7c6201212@git.kernel.org> (raw)
In-Reply-To: <20090809080350.GA4765@localhost.localdomain>
Commit-ID: c7425314c755d5f94da7c978205c85a7c6201212
Gitweb: http://git.kernel.org/tip/c7425314c755d5f94da7c978205c85a7c6201212
Author: Akinobu Mita <akinobu.mita@gmail.com>
AuthorDate: Sun, 9 Aug 2009 17:03:52 +0900
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 10 Aug 2009 11:10:52 +0200
x86: Introduce GDT_ENTRY_INIT(), initialize bad_bios_desc statically
Fully initialize bad_bios_desc statically instead of doing some
fields statically and some dynamically.
Suggested-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
LKML-Reference: <20090809080350.GA4765@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/apm_32.c | 19 +++++++++----------
drivers/pnp/pnpbios/bioscalls.c | 5 ++---
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index febb2da..39a4462 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -403,7 +403,15 @@ static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
static struct apm_user *user_list;
static DEFINE_SPINLOCK(user_list_lock);
-static struct desc_struct bad_bios_desc = GDT_ENTRY_INIT(0x4092, 0, 0);
+
+/*
+ * Set up a segment that references the real mode segment 0x40
+ * that extends up to the end of page zero (that we have reserved).
+ * This is for buggy BIOS's that refer to (real mode) segment 0x40
+ * even though they are called in protected mode.
+ */
+static struct desc_struct bad_bios_desc = GDT_ENTRY_INIT(0x4092,
+ (unsigned long)__va(0x400UL), PAGE_SIZE - 0x400 - 1);
static const char driver_version[] = "1.16ac"; /* no spaces */
@@ -2332,15 +2340,6 @@ static int __init apm_init(void)
pm_flags |= PM_APM;
/*
- * Set up a segment that references the real mode segment 0x40
- * that extends up to the end of page zero (that we have reserved).
- * This is for buggy BIOS's that refer to (real mode) segment 0x40
- * even though they are called in protected mode.
- */
- set_desc_base(&bad_bios_desc, (unsigned long)__va(0x40UL << 4));
- set_desc_limit(&bad_bios_desc, 4095 - (0x40 << 4));
-
- /*
* Set up the long jump entry point to the APM BIOS, which is called
* from inline assembly.
*/
diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
index bd035e3..fc83783 100644
--- a/drivers/pnp/pnpbios/bioscalls.c
+++ b/drivers/pnp/pnpbios/bioscalls.c
@@ -60,7 +60,8 @@ do { \
set_desc_limit(&gdt[(selname) >> 3], (size) - 1); \
} while(0)
-static struct desc_struct bad_bios_desc = GDT_ENTRY_INIT(0x4092, 0, 0);
+static struct desc_struct bad_bios_desc = GDT_ENTRY_INIT(0x4092,
+ (unsigned long)__va(0x400UL), PAGE_SIZE - 0x400 - 1);
/*
* At some point we want to use this stack frame pointer to unwind
@@ -476,8 +477,6 @@ void pnpbios_calls_init(union pnp_bios_install_struct *header)
pnp_bios_callpoint.offset = header->fields.pm16offset;
pnp_bios_callpoint.segment = PNP_CS16;
- set_desc_base(&bad_bios_desc, (unsigned long)__va(0x40UL << 4));
- set_desc_limit(&bad_bios_desc, 4095 - (0x40 << 4));
for_each_possible_cpu(i) {
struct desc_struct *gdt = get_cpu_gdt_table(i);
if (!gdt)
prev parent reply other threads:[~2009-08-10 9:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-08 9:49 [PATCH tip:x86/asm] x86: Introduce GDT_ENTRY_INIT() Akinobu Mita
2009-08-08 15:48 ` [tip:x86/asm] x86: Introduce GDT_ENTRY_INIT(), fix APM tip-bot for Ingo Molnar
2009-08-08 21:05 ` [PATCH tip:x86/asm] x86: Introduce GDT_ENTRY_INIT() H. Peter Anvin
2009-08-09 8:03 ` [PATCH tip:x86/asm] x86: Introduce GDT_ENTRY_INIT(), initialize bad_bios_desc statically Akinobu Mita
2009-08-10 9:12 ` tip-bot for Akinobu Mita [this message]
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=tip-c7425314c755d5f94da7c978205c85a7c6201212@git.kernel.org \
--to=akinobu.mita@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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.