qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Reiser <jreiser@BitWagon.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] qemu-0.8.2 i386 -kernel hangs when gdt and idt are zero length
Date: Sat, 14 Oct 2006 08:59:49 -0700	[thread overview]
Message-ID: <45310975.8020704@BitWagon.com> (raw)

Hi,

Under qemu-0.8.2 when emulating i386 -kernel in protected mode,
and if both the idt and gdt have length zero, then trying
to load a segment register loops for a very long time.

	cli
	lidtl  empty_idt
	lgdtl  empty_gdt  # %cs info persists in internal registers
	movl $0x18,%eax
	movl %eax,%ds  # qemu-0.8.2 hangs here

	.data
  empty_idt:
	.short 0  # length is zero
	.long 0
  empty_gdt:
	.short 0  # length is zero
	.long 0

Because the gdt has length 0, then the descriptor for segment
0x18>>3 does not exist in memory.  The Intel manual claims the
hardware gives "#GP(selector)" fault for loading the segment
register when the selector index is not within limits, but
delivery of the exception depends on the idt.  When the idt
also has zero length, then real hardware enters double-fault
territory (perhaps triple-fault?) and shuts down.

It would be nice if qemu emulation detected such a situation,
then issued an informative message, in addition to
looping forever as an "emulation" of hardware shutdown.

-- 
John Reiser, jreiser@BitWagon.com

             reply	other threads:[~2006-10-14 15:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-14 15:59 John Reiser [this message]
2006-10-15 15:35 ` [Qemu-devel] qemu-0.8.2 i386 -kernel hangs when gdt and idt are zero length Fabrice Bellard

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=45310975.8020704@BitWagon.com \
    --to=jreiser@bitwagon.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).