* [Qemu-devel] [PATCH] exec: save exception_index field
@ 2014-07-31 5:41 Pavel Dovgaluk
2014-07-31 6:56 ` Andreas Färber
0 siblings, 1 reply; 4+ messages in thread
From: Pavel Dovgaluk @ 2014-07-31 5:41 UTC (permalink / raw)
To: qemu-devel; +Cc: 'Paolo Bonzini'
This patch adds subsection with exception_index field to the VMState for
correct saving the CPU state.
Without this patch simulator could miss the pending exception in the saved
virtual machine state.
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
exec.c | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/exec.c b/exec.c
index 765bd94..7581c06 100644
--- a/exec.c
+++ b/exec.c
@@ -430,15 +430,50 @@ static int cpu_common_post_load(void *opaque, int version_id)
return 0;
}
+static int cpu_common_pre_load(void *opaque)
+{
+ CPUState *cpu = opaque;
+
+ cpu->exception_index = 0;
+
+ return 0;
+}
+
+static bool cpu_common_exception_index_needed(void *opaque)
+{
+ CPUState *cpu = opaque;
+
+ return cpu->exception_index != 0;
+}
+
+static const VMStateDescription vmstate_cpu_common_exception_index = {
+ .name = "cpu_common/exception_index",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_INT32(exception_index, CPUState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
const VMStateDescription vmstate_cpu_common = {
.name = "cpu_common",
.version_id = 1,
.minimum_version_id = 1,
+ .pre_load = cpu_common_pre_load,
.post_load = cpu_common_post_load,
.fields = (VMStateField[]) {
VMSTATE_UINT32(halted, CPUState),
VMSTATE_UINT32(interrupt_request, CPUState),
VMSTATE_END_OF_LIST()
+ },
+ .subsections = (VMStateSubsection[]) {
+ {
+ .vmsd = &vmstate_cpu_common_exception_index,
+ .needed = cpu_common_exception_index_needed,
+ } , {
+ /* empty */
+ }
}
};
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] exec: save exception_index field
2014-07-31 5:41 [Qemu-devel] [PATCH] exec: save exception_index field Pavel Dovgaluk
@ 2014-07-31 6:56 ` Andreas Färber
2014-08-25 11:09 ` Pavel Dovgaluk
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2014-07-31 6:56 UTC (permalink / raw)
To: Pavel Dovgaluk, qemu-devel; +Cc: 'Paolo Bonzini', Peter Maydell
Hi,
Am 31.07.2014 07:41, schrieb Pavel Dovgaluk:
> This patch adds subsection with exception_index field to the VMState for
> correct saving the CPU state.
> Without this patch simulator could miss the pending exception in the saved
> virtual machine state.
>
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> ---
> exec.c | 35 +++++++++++++++++++++++++++++++++++
> 1 files changed, 35 insertions(+), 0 deletions(-)
Doh, this resolves my request from the big series,
Reviewed-by: Andreas Färber <afaerber@suse.de>
I'll wait for more review before I take it, please keep me CC'ed.
Thanks,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] exec: save exception_index field
2014-07-31 6:56 ` Andreas Färber
@ 2014-08-25 11:09 ` Pavel Dovgaluk
2014-08-25 16:40 ` Andreas Färber
0 siblings, 1 reply; 4+ messages in thread
From: Pavel Dovgaluk @ 2014-08-25 11:09 UTC (permalink / raw)
To: 'Andreas Färber', qemu-devel
Cc: 'Paolo Bonzini', 'Peter Maydell'
> From: Andreas Färber [mailto:afaerber@suse.de]
> Am 31.07.2014 07:41, schrieb Pavel Dovgaluk:
> > This patch adds subsection with exception_index field to the VMState for
> > correct saving the CPU state.
> > Without this patch simulator could miss the pending exception in the saved
> > virtual machine state.
> >
> > Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> > ---
> > exec.c | 35 +++++++++++++++++++++++++++++++++++
> > 1 files changed, 35 insertions(+), 0 deletions(-)
>
> Doh, this resolves my request from the big series,
>
> Reviewed-by: Andreas Färber <afaerber@suse.de>
>
> I'll wait for more review before I take it, please keep me CC'ed.
No more reviews yet.
Will this patch be applied?
Pavel Dovgalyuk
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] exec: save exception_index field
2014-08-25 11:09 ` Pavel Dovgaluk
@ 2014-08-25 16:40 ` Andreas Färber
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Färber @ 2014-08-25 16:40 UTC (permalink / raw)
To: Pavel Dovgaluk, qemu-devel
Cc: 'Paolo Bonzini', 'Peter Maydell'
Am 25.08.2014 13:09, schrieb Pavel Dovgaluk:
>> From: Andreas Färber [mailto:afaerber@suse.de]
>> Am 31.07.2014 07:41, schrieb Pavel Dovgaluk:
>>> This patch adds subsection with exception_index field to the VMState for
>>> correct saving the CPU state.
>>> Without this patch simulator could miss the pending exception in the saved
>>> virtual machine state.
>>>
>>> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
>>> ---
>>> exec.c | 35 +++++++++++++++++++++++++++++++++++
>>> 1 files changed, 35 insertions(+), 0 deletions(-)
>>
>> Doh, this resolves my request from the big series,
>>
>> Reviewed-by: Andreas Färber <afaerber@suse.de>
>>
>> I'll wait for more review before I take it, please keep me CC'ed.
>
> No more reviews yet.
> Will this patch be applied?
Thanks for the reminder, applied to qom-cpu now:
https://github.com/afaerber/qemu-cpu/commits/qom-cpu
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-08-25 16:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31 5:41 [Qemu-devel] [PATCH] exec: save exception_index field Pavel Dovgaluk
2014-07-31 6:56 ` Andreas Färber
2014-08-25 11:09 ` Pavel Dovgaluk
2014-08-25 16:40 ` Andreas Färber
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).