From: Dirk Behme <dirk.behme@googlemail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Wrong reset of MIPS hflags EXL after interrupt?
Date: Wed, 16 Aug 2006 22:18:22 +0200 [thread overview]
Message-ID: <44E37D8E.3050801@gmail.com> (raw)
In-Reply-To: <20060816182908.GC6387@networkno.de>
Thiemo Seufer wrote:
> Dirk Behme wrote:
>>I'm not sure, but while playing with MIPS interrupts, it
>>seems to me that something with reset of interrupt flag
>>MIPS_HFLAG_EXL (0x04) at exception exit (eret) is wrong. It
>>seems to me that only one interrupt is executed because
>>after eret, MIPS_HFLAG_EXL stays set in env->hflags. Then,
>>at next interrupt, system correctly checks for
>>MIPS_HFLAG_EXL, but this is still set and no further
>>interrupt happens.
>
> This explains some weirdness I saw on my hacked up qemu
> when running a mips32r2-compiled Linux kernel.
This was the reason why I first tried it with a small test
program before using Linux ;)
>>Debugging shows that op_eret() in MIPS op.c correctly reset
>>this bit: env->hflags &= ~MIPS_HFLAG_EXL; But debug output
>>at end of e.g. save_cpu_state() (debug output of ctx->hflags
>>and ctx->saved_hflags ) or in function which tries to issue
>>(next) timer interrupt (debug output of env->hflags)
>>MIPS_HFLAG_EXL is still (again?) set everywhere. Looks like
>>the correct env->hflags from op_eret() is overwritten
>>somewhere later with wrong value.
>>
>>These three ctx->hflags, ctx->saved_hflags and env->hflags
>>are confusing me ;) Where are they synchronized after eret?
>>Or who overwrites the env->hflags correctly set by eret
>>again? Any ideas, why eret sets env->hflags correctly and
>>later global env->hflags has still/again wrong value? Any
>>other hints?
>
> AFAIU qemu maintains an environment stack, I guess popping the
> environment restores the old flag contents.
Anybody with a short explanation of the basics of this? I
think this would really help debugging this issue.
Many thanks
Dirk
next prev parent reply other threads:[~2006-08-16 20:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-16 17:04 [Qemu-devel] Wrong reset of MIPS hflags EXL after interrupt? Dirk Behme
2006-08-16 18:29 ` Thiemo Seufer
2006-08-16 20:18 ` Dirk Behme [this message]
2006-08-17 6:30 ` Marius Groeger
2006-08-17 6:51 ` Dirk Behme
2006-08-17 7:01 ` Marius Groeger
2006-08-18 8:32 ` Marius Groeger
2006-08-18 10:01 ` Thiemo Seufer
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=44E37D8E.3050801@gmail.com \
--to=dirk.behme@googlemail.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).