From: Alexander Graf <agraf@suse.de>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "lkundrak@v3.sk" <lkundrak@v3.sk>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH] Resend: x86: Reboot CPU on triple fault
Date: Mon, 12 Jan 2009 16:58:26 +0100 [thread overview]
Message-ID: <3CE5FCB0-8B5B-4EBE-863C-6355B749C414@suse.de> (raw)
In-Reply-To: <496B342B.7050409@siemens.com>
On 12.01.2009, at 13:14, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> lkundrak@v3.sk wrote:
>> This is a (slightly adjusted for 2009-01-04 SVN) resend of Jan
>> Kiszka's
>> Reboot CPU on triple fault patch (see patch file for the exact
>> reference)
>>
>> It seems like a consensus was reached on how to deal with tripple
>> faults,
>> but noone commited the last version (8) of the patch anyways.
>>
>> Just for the record -- 386BSD relies on this behavior to reset the
>> CPU --
>> it unmaps the whole address space in order to trigger a tripple
>> fault.
>>
>
> Good that you picked this up! It is still on my to-do list to get this
> in, but with medium prio. However, let's try to push it a bit.
>
>> This is a slightly adjusted (for 2009-01-04 SVN) "reset on tripple
>> fault patch"
>>
>> Originally from:
>>
>> Subject: [Qemu-devel] Re: [PATCH] x86: Reboot CPU on triple fault -
>> Version 8
>> Message-ID: <483C340E.1030207@siemens.com>
>> Date: Tue, 27 May 2008 18:17:18 +0200
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Note that I posted an enhanced version on 2008-09-02, also covering
> reset logging for non-x86 archs. Please use that one.
>
> ...
>> Index: target-i386/op_helper.c
>> ===================================================================
>> --- target-i386/op_helper.c (revision 6159)
>> +++ target-i386/op_helper.c (working copy)
>> @@ -1244,6 +1244,9 @@
>> }
>> }
>>
>> +/* This should come from sysemu.h - if we could include it here...
>> */
>> +void qemu_system_reset_request(void);
>> +
>> /*
>> * Check nested exceptions and change to double or triple fault if
>> * needed. It should only be called, if this is not an interrupt.
>> @@ -1261,9 +1264,19 @@
>> fprintf(logfile, "check_exception old: 0x%x new 0x%x\n",
>> env->old_exception, intno);
>>
>> - if (env->old_exception == EXCP08_DBLE)
>> - cpu_abort(env, "triple fault");
>> +#if !defined(CONFIG_USER_ONLY)
>> + if (env->old_exception == EXCP08_DBLE) {
>> + if (env->intercept)
>> + helper_vmexit(SVM_EXIT_SHUTDOWN, 0);
>>
>> + if (loglevel & CPU_LOG_RESET)
>> + fprintf(logfile, "Triple fault\n");
>> +
>> + qemu_system_reset_request();
>> + return EXCP_HLT;
>> + }
>> +#endif
>> +
>> if ((first_contributory && second_contributory)
>> || (env->old_exception == EXCP0E_PAGE &&
>> (second_contributory || (intno == EXCP0E_PAGE)))) {
>
> I meanwhile think that SVM hook should rather look like this
>
> helper_svm_check_intercept_param(SVM_EXIT_SHUTDOWN, 0);
>
>
> in order to properly check if shutdown events are actually
> intercepted.
> Alexander, am I right?
Yes, sounds right. Any reason not to put the intercept in
reset_request? (asking blindly, I don't have access to the qemu source
right now)
Alex
>
>
> Jan
>
> --
> Siemens AG, Corporate Technology, CT SE 26
> Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2009-01-12 15:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-04 15:45 [Qemu-devel] [PATCH] Resend: x86: Reboot CPU on triple fault lkundrak
2009-01-12 12:14 ` [Qemu-devel] " Jan Kiszka
2009-01-12 15:58 ` Alexander Graf [this message]
2009-01-12 16:05 ` Jan Kiszka
2009-01-12 16:41 ` Alexander Graf
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=3CE5FCB0-8B5B-4EBE-863C-6355B749C414@suse.de \
--to=agraf@suse.de \
--cc=jan.kiszka@siemens.com \
--cc=lkundrak@v3.sk \
--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).