All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>,
	mingo@redhat.com, linux-kernel@vger.kernel.org,
	tglx@linutronix.de, linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/asm] x86: Introduce GDT_ENTRY_INIT()
Date: Tue, 4 Aug 2009 14:18:38 +0200	[thread overview]
Message-ID: <20090804121838.GA4367@elte.hu> (raw)
In-Reply-To: <4A76FF8E.80507@zytor.com>


* H. Peter Anvin <hpa@zytor.com> wrote:

> On 08/03/2009 08:11 AM, Akinobu Mita wrote:
> >>>>
> >> OK, I spotted the following error, which certainly would explain a crash on
> >> an APM machine:
> >>
> >>        /* data */
> >> -       [GDT_ENTRY_APMBIOS_BASE+2]      = { { { 0x0000ffff, 0x00409200 } }
> >> },
> >> +       [GDT_ENTRY_APMBIOS_BASE+2]      = GDT_ENTRY_INIT(0x409a, 0, 0xffff),
> > 
> > Oops, I really should have checked the binary because the compiler should
> > generate same code with this patch.
> > 
> 
> Well, it doesn't even on the best of days, because the last hunk changes
> a dynamic initializer to a strange mix between static and dynamic:
> 
> -static struct desc_struct bad_bios_desc;
> +static struct desc_struct bad_bios_desc = GDT_ENTRY_INIT(0x4092, 0, 0);
> 
>  /*
>   * At some point we want to use this stack frame pointer to unwind
> @@ -476,9 +476,6 @@ void pnpbios_calls_init(union
> pnp_bios_install_struct *header)
>         pnp_bios_callpoint.offset = header->fields.pm16offset;
>         pnp_bios_callpoint.segment = PNP_CS16;
> 
> -       bad_bios_desc.a = 0;
> -       bad_bios_desc.b = 0x00409200;
> -
>         set_desc_base(&bad_bios_desc, (unsigned long)__va(0x40UL << 4));
>         set_desc_limit(&bad_bios_desc, 4095 - (0x40 << 4));
> 
> This is about at strange as it comes; I think we could simply do:
> 
> GDT_ENTRY_INIT(0x4092, (unsigned long)__va(0x400UL), 4095-0x400);
> 
> Although perhaps the 4095 should really be PAGE_SIZE-1...

I've removed the patch for now - please resubmit when fixed.

	Ingo

  reply	other threads:[~2009-08-04 12:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-18 15:08 [PATCH 1/4] x86: use get_desc_base() Akinobu Mita
2009-07-18 15:09 ` [PATCH 2/4] x86: remove unused patch_espfix_desc() Akinobu Mita
2009-07-20 12:01   ` [tip:x86/asm] x86: Remove " tip-bot for Akinobu Mita
2009-07-18 15:11 ` [PATCH 3/4] x86: introduce set_desc_base() and set_desc_limit() Akinobu Mita
2009-07-20 12:01   ` [tip:x86/asm] x86: Introduce " tip-bot for Akinobu Mita
2009-07-18 15:12 ` [PATCH 4/4] x86: introduce GDT_ENTRY_INIT() Akinobu Mita
2009-07-20 12:01   ` [tip:x86/asm] x86: Introduce GDT_ENTRY_INIT() tip-bot for Akinobu Mita
2009-08-03  6:20     ` Ingo Molnar
2009-08-03  6:27       ` H. Peter Anvin
2009-08-03 15:11         ` Akinobu Mita
2009-08-03 15:17           ` H. Peter Anvin
2009-08-04 12:18             ` Ingo Molnar [this message]
2009-08-08 15:48   ` tip-bot for Akinobu Mita
2009-07-20 12:01 ` [tip:x86/asm] x86: Use get_desc_base() tip-bot for Akinobu Mita

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=20090804121838.GA4367@elte.hu \
    --to=mingo@elte.hu \
    --cc=akinobu.mita@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --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.