qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>, Thomas Huth <thuth@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Jing Liu <liujbjl@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2] s390x/cpu: expose the guest crash information
Date: Tue, 19 Sep 2017 16:39:51 +0200	[thread overview]
Message-ID: <e75bfdc7-2a78-41dd-c267-bb76de859899@redhat.com> (raw)
In-Reply-To: <0f1c2678-bf5d-d931-eb7d-0baaf1b4b675@de.ibm.com>

On 19.09.2017 15:56, Christian Borntraeger wrote:
> 
> 
> On 09/19/2017 03:14 PM, David Hildenbrand wrote:
>>
>>>      CPUState *cs = CPU(obj);
>>> @@ -291,6 +345,8 @@ static void s390_cpu_initfn(Object *obj)
>>>      cs->exception_index = EXCP_HLT;
>>>      object_property_add(OBJECT(cpu), "id", "int64_t", s390x_cpu_get_id,
>>>                          s390x_cpu_set_id, NULL, NULL, NULL);
>>> +    object_property_add(obj, "crash-information", "GuestPanicInformation",
>>> +                        s390x_cpu_get_crash_info_qom, NULL, NULL, NULL, NULL);
>>>      s390_cpu_model_register_props(obj);
>>>  #if !defined(CONFIG_USER_ONLY)
>>>      qemu_get_timedate(&tm, 0);
>>> @@ -517,6 +573,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
>>>      cc->do_interrupt = s390_cpu_do_interrupt;
>>>  #endif
>>>      cc->dump_state = s390_cpu_dump_state;
>>> +    cc->get_crash_info = s390x_cpu_get_crash_info;
>>>      cc->set_pc = s390_cpu_set_pc;
>>>      cc->gdb_read_register = s390_cpu_gdb_read_register;
>>>      cc->gdb_write_register = s390_cpu_gdb_write_register;
>>> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
>>> index 0bd97a5..dba32db 100644
>>> --- a/target/s390x/cpu.h
>>> +++ b/target/s390x/cpu.h
>>> @@ -396,6 +396,12 @@ static inline void cpu_get_tb_cpu_state(CPUS390XState* env, target_ulong *pc,
>>>  #define EXCP_IO  7 /* I/O interrupt */
>>>  #define EXCP_MCHK 8 /* machine check */
>>>  
>>> +/* Crash cases. */
>>> +#define EXCP_CRASH_PGM 9
>>> +#define EXCP_CRASH_EXT 10
>>> +#define EXCP_CRASH_WAITPSW 11
>>> +#define EXCP_CRASH_OPEREXC 12
>>> +
>>
>> Okay, looking at cpu_handle_exception() I am pretty sure this won't work
>> with TCG unless cpu->exception_index >= EXCP_INTERRUPT. Maybe define new
>> EXCP_CRASH or store this information somewhere else inside s390 CPU?
> 
> Just asking: 
> Would it be ok to define EXCP_CRASH as 0x20000 or so?
> 

I guess the main problem with EXCP_CRASH is that it will get lost during
migration (if I am not wrong). So cpu->exception_index should most
probably really only be used for "temporary" things, e.g. to exit the
main loop.

Apart from that, I guess introducing it next to the other common code
EXCP_ defines sould be fine!

-- 

Thanks,

David

  reply	other threads:[~2017-09-19 14:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19  7:43 [Qemu-devel] [PATCH v2] s390x/cpu: expose the guest crash information Christian Borntraeger
2017-09-19 13:04 ` Eric Blake
2017-11-07 11:00   ` QingFeng Hao
2017-11-07 19:35     ` Eric Blake
2017-11-08  6:36       ` QingFeng Hao
2017-09-19 13:06 ` David Hildenbrand
2017-09-19 13:27   ` Christian Borntraeger
2017-09-19 13:14 ` David Hildenbrand
2017-09-19 13:56   ` Christian Borntraeger
2017-09-19 14:39     ` David Hildenbrand [this message]
2017-09-20  9:14 ` Cornelia Huck
2017-09-20 11:23   ` Christian Borntraeger
2017-09-20 14:34   ` Eric Blake

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=e75bfdc7-2a78-41dd-c267-bb76de859899@redhat.com \
    --to=david@redhat.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=liujbjl@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /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).